当前位置: 首页 > news >正文

Jenkins CICD过程常见异常

1 Status [126]

Exception when publishing, exception message [Exec exit status not zero. Status [126]

1.1 报错日志

SSH: EXEC: STDOUT/STDERR from command [/app/***/publish.sh] ...
bash: /app/***/publish.sh: Permission denied
SSH: EXEC: completed after 200 ms
SSH: Disconnecting configuration [***] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [126]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE

1.2 原因

Jenkins调用的脚本文件权限不够

1.3 解决方案

chmod增加权限

chmod 777 publish.sh

2 Status [127]

Exception when publishing, exception message [Exec exit status not zero. Status [127]]

2.1 报错日志

SSH: EXEC: STDOUT/STDERR from command [/app/***/publish.sh] ...
bash: /app/***/publish.sh: No such file or directory
SSH: EXEC: completed after 200 ms
SSH: Disconnecting configuration [***] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE

2.2 原因

脚本文件目录错误

2.3 解决方案

将Jenkins配置中的脚本目录地址改正确。

当 SSH Server 中配置Remote Directory后:

  • Remote directory 填写相对地址
  • Exec command 填写绝对地址

3 ERROR: Error cloning remote repo ‘origin’

3.1 报错日志

Cloning the remote Git repository
Cloning repository http://****:3000/***/***.git> /usr/bin/git init /home/jenkins/workspace/*** # timeout=10> Fetching upstream changes from http://****:3000/***/***.git> /usr/bin/git --version # timeout=10> using GIT_ASKPASS to set credentials > /usr/bin/git fetch --tags --progress http://****:3000/***/***.git +refs/heads/*:refs/remotes/origin/*> ERROR: Error cloning remote repo 'origin'> hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress http://****:3000/***/***.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:> stdout: > stderr: fatal: unable to access 'http://****:3000/***/***.git/': The requested URL returned error: 500at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:442)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:655)at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)at hudson.scm.SCM.checkout(SCM.java:504)at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)at hudson.model.Run.execute(Run.java:1810)at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)at hudson.model.ResourceController.execute(ResourceController.java:97)at hudson.model.Executor.run(Executor.java:429)ERROR: Error cloning remote repo 'origin'
SSH: Current build result is [FAILURE], not going to run.
Finished: FAILURE

3.2 原因

从描述信息来看,是无法拉取远程代码,之前明明是好正常的,怎么突然一下就不行了呢?那你想想,是不是最近负责这个项目的人离职了,O(∩_∩)O哈哈~
这个原因主要是 Git 用户被注销了,无法通过该用户获取 Git 代码。

3.3 解决方案

从【配置】中,找到配置 Git 远程地址的地方,下图中会报红,将【Credentials】改成自己的用户就可以了。

4 ERROR: Exception when publishing, exception message [Failure]

4.1 报错日志

Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /home/jenkins/workspace/***/pom.xml to ***/***/0.0.1-SNAPSHOT/***-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /home/jenkins/workspace/***/target/***-0.0.1-SNAPSHOT.jar to ***/***/0.0.1-SNAPSHOT/***-0.0.1-SNAPSHOT.jar
channel stopped
SSH: Connecting from host [****]
SSH: Connecting with configuration [****] ...
SSH: Disconnecting configuration [] ...
ERROR: Exception when publishing, exception message [Failure]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE

4.2 原因

发生这个错误,一般是磁盘空间不足了,这种情况在测试环境比较常见(毕竟生产环境会有监控提醒的)!

4.3 解决

查询磁盘使用情况命令:

df -h

使用删除文件命令,删掉多余日志:

rm -rf file
http://www.lryc.cn/news/225389.html

相关文章:

  • Java11新增特性
  • 安卓常见设计模式13------过滤器模式(Kotlin版)
  • 使用spark进行递归的可行方案
  • Spring -Spring之依赖注入源码解析(下)--实践(流程图)
  • 前端设计模式之【单例模式】
  • 设备零部件更换ar远程指导系统加强培训效果
  • 文本生成高精准3D模型,北京智源AI研究院等出品—3D-GPT
  • Netty入门指南之NIO 网络编程
  • LeetCode(6)轮转数组【数组/字符串】【中等】
  • 华为云Ascend310服务器使用
  • 【poi导出excel模板——通过建造者模式+策略模式+函数式接口实现】
  • 自适应模糊PID控制器在热交换器温度控制中的应用
  • 【系统救援】 Ubuntu重启失败,报错:UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
  • 【数据结构】树与二叉树(八):二叉树的中序遍历(非递归算法NIO)
  • 第九章 排序【数据结构】【精致版】
  • 基于element-plus定义表格行内编辑配置化
  • WebGL-Vue3-TS-Threejs:基础练习 / Javascript 3D library / demo
  • 2022年12月 Python(四级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • 确定性 vs 非确定性:GPT 时代的新编程范式
  • 【Linux奇遇记】我和Linux的初次相遇
  • 剪贴板劫持--PasteJacker的使用
  • 说一下vue2的响应式原理?
  • 如何使用CORS和CSP保护前端应用程序安全
  • C/C++输出硬币翻转 2021年6月电子学会青少年软件编程(C/C++)等级考试一级真题答案解析
  • ipad可能会在iOS 16中失去智能家居中心功能
  • maven打包可运行jar
  • Arcgis连接Postgis数据库(Postgre入门十)
  • 【蓝桥杯选拔赛真题17】C++时间换算 第十二届蓝桥杯青少年创意编程大赛C++编程选拔赛真题解析
  • 【腾讯云 HAI域探秘】探索AI绘画之路:利用腾讯云HAI服务打造智能画家
  • 安卓常见设计模式10------责任链模式(Kotlin版)