解决:ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [-1]]
来源:互联网 发布:政府机构邮箱搜索软件 编辑:程序博客网 时间:2024/04/30 12:21
问题:今天Jenkins使用Publish Over SSH Plugin遇到一个问题:错误如下
SSH: Connecting from host [localhost.localdomain]SSH: Connecting with configuration [47.94.8.78] ...SSH: EXEC: STDOUT/STDERR from command [rm -rf /var/tmp/garage/server/centerunzip -oq /var/tmp/remote-deploy/garage-dacheng-server.war -d /var/tmp/garage/server/centerps -ef |grep tomcat-center |awk '{print $2}'|xargs kill -9 1>/dev/null 2>&1 | exit 0service tomcat-center start] ...SSH: EXEC: completed after 1,007 msSSH: Disconnecting configuration [47.94.8.78] ...ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [-1]]Build step 'Send build artifacts over SSH' changed build result to UNSTABLEFinished: UNSTABLE
“Exec exit status not zero” 说明进程没有正常结束,经过排除,问题锁定在:ps -ef |grep tomcat-center |awk '{print $2}'|xargs kill -9 1>/dev/null 2>&1 | exit 0
分析:
ps -ef | grep tomcat-center 查询到的是两条记录(如下图):第一条是我们要查找并关闭的,第二条是查找进程自身。
当管道进行到kill的时候,两条进程一同被杀死,而Jenkins仍然在等待查找进程自身返回exit 0,事实上它永远等不到了,因为进程都没了,
最终会报异常"Exec exit status not zero"
解决:
使用“grep -v grep”排除掉它自身就可以
原来:ps -ef |grep tomcat-center |awk '{print $2}'|xargs kill -9
改后:ps -ef |grep tomcat-center | grep -v grep |awk '{print $2}'|xargs kill -9
阅读全文
1 0
- 解决:ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [-1]]
- ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after XXX ms
- ERROR: Exception when publishing, exception message [Failure] Build step 'Send files or execute comm
- DevC++出现[Error] ld returned 1 exit status解决
- Uncaught exception 'Apache_Solr_HttpTransportException' with message ''0' Status: Communication
- error: command 'gcc' failed with exit status when installing psycopg2
- error: collect2: ld returned 1 exit status
- error: collect2: ld returned 1 exit status
- error: collect2: ld returned 1 exit status
- collect2: error: ld returned 1 exit status
- collect2: error: ld returned 1 exit status
- 错误[Error] ld returned 1 exit status
- [error] ld returned 1 exit status 问题
- “Non Zero Exit Status” R 3.0.1 'XML' and 'RCurl'
- HTTP Status 500 - Exception report
- HTTP Status 500 - could not execute query; nested exception is org.hibernate.exception.JDBCConnectio
- returned 1 exit status
- error: %preun(keepalived-1.2.7-3.el6.x86_64) scriptlet failed, exit status 1 解决
- Use powershell config network
- SQLyog 激活 注册码
- ORCLE 查询一段时间(时间点不定,时差确定)内符合一定条件的数据
- Spring:IOC—控制反转(3)
- MFC自定义控件
- 解决:ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [-1]]
- 卷积神经网络CNN知识点
- 解决solr4.10.3在solrhome下添加多个solrcore遇到的问题总结
- XML学习---利用Java对XML文档的增、删、改、查
- Android.mk介绍(一)
- select onChange事件
- 你值得了解的 10 个有趣的 Linux 命令行小技巧
- detected problems with app native libraries(please consult log for detail):
- Linux 命令行工具使用小贴士及技巧