詹金斯在重新启动我的SQL&QUOT失败;须藤:没有TTY present和指定对不起没有askpass程序,再试一次"我的、重新启动、再试、金斯

2023-09-11 10:50:15 作者:无人问我粥可暖

我刚刚配置詹金斯和pre-构建步骤我试图重新启动詹金斯,但我结束了以下错误

 开始修订c5b9f8daac092efc5396d80f568a2cf89ae8b697(产地/ HEAD,产地/主站)的建设
签出修订c5b9f8daac092efc5396d80f568a2cf89ae8b697(产地/ HEAD,产地/主)
未更改记录分支来源/ HEAD
未更改记录分支来源/主
[Web应用程序] $ / bin / sh的-xe /tmp/hudson5215632082686866774.sh
+须藤/etc/init.d/mysql重启
须藤:没有TTY present并没有指定askpass程序
对不起,再试一次。
须藤:没有TTY present并没有指定askpass程序
对不起,再试一次。
须藤:没有TTY present并没有指定askpass程序
对不起,再试一次。
须藤:3不正确的密码尝试
构建步骤执行shell标记建设成为失败
表面处理:失败
 

我用Google搜索,发现一些答案的Jenkins从哪儿冒出来开始失败使用sudo:没有TTY present和

指定任何askpass程序

但遗憾的是没有帮助我

我的/ etc / sudoers文件看起来像这样

 #
#此文件必须进行编辑与'visudo命令命令,作为根。
#
#请考虑/etc/sudoers.d/而不是增加本地内容
#直接修改该文件。
#
#参见手册页关于如何写sudoers文件的细节。
#
默认env_reset
默认secure_path =在/ usr / local / sbin中:在/ usr / local / bin目录:/ usr / sbin目录:在/ usr / bin中:/ sbin目录:/ bin中

#主机别名规范

#用户别名规范

#CMND别名规范

#用户特权规范
根ALL =(ALL:ALL)ALL

管理员组的成员#可能获得root权限
%管理ALL =(ALL)NOPASSWD:ALL

#允许须藤组的成员来执行任意命令
%须藤ALL =(ALL:ALL)ALL

#见sudoers的(5)上的#包括指令的详细信息:

#includedir /etc/sudoers.d
 

解决方案

通过添加以下内容: 默认值:用户名进行身份验证 到/ etc / sudoers文件 你不应该得到的错误,但这个用户名可以访问不要求输入密码

五连败 复赛4战全负 灰熊仅领先西部第九1个胜场

I just configured jenkins and in the pre-build steps i am trying to restart jenkins but i end up with the following error

Commencing build of Revision c5b9f8daac092efc5396d80f568a2cf89ae8b697 (origin/HEAD, origin/master)
Checking out Revision c5b9f8daac092efc5396d80f568a2cf89ae8b697 (origin/HEAD, origin/master)
No change to record in branch origin/HEAD
No change to record in branch origin/master
[webapp] $ /bin/sh -xe /tmp/hudson5215632082686866774.sh
+ sudo /etc/init.d/mysql restart
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
Build step 'Execute shell' marked build as failure
Finished: FAILURE

I googled and saw some answers at Jenkins out of nowhere starts failing with sudo: no tty present and no askpass program specified

But unfortunately that didn't help me

My /etc/sudoers looks like this

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

解决方案

By adding the following: Defaults:username !authenticate to your /etc/sudoers you should not get the error but this username will be accessible without asking for a password

 
精彩推荐
图片推荐