ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,000

1、遇到的错误信息

错误信息截图

ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,000 ms] 
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE 
Finished: UNSTABLE

执行完命令后一直转圈,执行脚本不退出,然后超时出现上述错误信息,实际已启动成功。

2、错误原因

在使用Jenkins进行远程部署时,构建后执行的脚本没有正常退出导致。 jenkins 无法判断命令是否执行完成。

Since you are executing a script from a non-TTY environment; The Jenkins is not able to get the exit properly, out of your script.

意思是:因为你是从一个非tty环境执行脚本;Jenkins不能正常从你的脚本中退出。

3、解决办法

截图

解释:

Since you are executing a script from a non-TTY environment; The Jenkins is not able to get the exit properly, out of your script.

What you want is to exit immediately, after script execution! Don't want to wait for the entire timeout to happen and then disconnect improperly!

Solution: Make it Exec in PTY. (Please tick the check-box as shown in attached screenshot)

 

4、继续

但是这种情况虽然结果显示success,但是实际并未启动成功,可能的原因是刚启动,pty(伪终端)就断开连接。后来各方搜索又在脚本后加上sleep 1,完美解决。

 

 

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值