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.hqwc.cn/news/166815.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

LinkedList的插入速度一定比ArrayList快吗?

目录 一、有一道经典的面试题,“ArrayList 和 LinkedList 的区别是什么?”1、小白答法:2、入门答法:3、系统回答 二、LinkedList的插入速度一定比ArrayList快吗?三、分析一下两种数据结构的add源码1、先分析熟悉的Arra…

ZZ308 物联网应用与服务赛题第F套

2023年全国职业院校技能大赛 中职组 物联网应用与服务 任 务 书 (F卷) 赛位号:______________ 竞赛须知 一、注意事项 1.检查硬件设备、电脑设备是否正常。检查竞赛所需的各项设备、软件和竞赛材料等; 2.竞赛任务中所使用…

基于SSM的社区生鲜电商平台

末尾获取源码 开发语言:Java Java开发工具:JDK1.8 后端框架:SSM 前端:Vue 数据库:MySQL5.7和Navicat管理工具结合 服务器:Tomcat8.5 开发软件:IDEA / Eclipse 是否Maven项目:是 目录…

Unity Mirror学习(一) SyncVars特性使用

官网中所说的网络对象,指的是挂了 NetworkIdentity组件的对象 官网中所说的玩家对象,指的是NetworkManager脚本上的PlayerPrefab预制体 这个概念对阅读官网文档很重要,我刚开始并不理解,走了歪路 SyncVars(同步变量&a…

ruoyi前后端分离版本开发框架解读---让你快速入门

后端结构 com.ruoyi ├── common // 工具类 │ └── annotation // 自定义注解 │ └── config // 全局配置 │ └── constant // 通用常量 │ └── core …

【Mysql】where 条件子句之逻辑运算符

逻辑运算符 and &&or ||not ! student表 一.查询分数在80 - 90之间 and写法 &&写法 区间(between ....and......) 二.查询分数不为88 !写法 not写法 三.查询分数大于88或者年龄小于22 满足其中一个条件即可 or写法 ||写法

Xilinx FPGA SPIx4 配置速度50M约束语句(Vivado开发环境)

qspi_50m.xdc文件: set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design] set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design] set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design] set_property CONFIG_VOLTAGE 3.3 [curren…

华为交换机端口 access、trunk和hybrid收发数据规则

文章目录 1. 三个端口类型处理数据帧的汇总表2. access 端口3. trunk端口4. Hybrid 端口(交换机的默认端口类型)5.常用命令 1. 三个端口类型处理数据帧的汇总表 端口类型收到不带VLAN标签的帧的处理规则收到带VLAN标签的帧的处理规则发送帧时的处理规则…

数据采集代码示例

首先,你需要安装一个 Lua 的爬虫库,例如 Luanode 或者 Lush: lua local ltn12 require("ltn12") local http require("") local response http.request{ host "", port , path "/", …

HarmonyOS应用开发

引言 本章将深入探讨 HarmonyOS 应用开发的关键方面,包括应用的生命周期、数据存储和网络访问。了解这些内容对于创建功能丰富、高效的 HarmonyOS 应用至关重要。 目录 HarmonyOS 应用的生命周期HarmonyOS 应用的数据存储HarmonyOS 应用的网络访问总结 1. Harmo…

Java设计模式之迭代器模式

定义 提供一个对象来顺序访问聚合对象中的一系列数据,而不暴露聚合对象的内部表示。 结构 迭代器模式主要包含以下角色: 抽象聚合角色:定义存储、添加、删除聚合元素以及创建迭代器对象的接口。具体聚合角色:实现抽象聚合类&a…

休眠和睡眠有哪些区别?如何让电脑一键休眠?

电脑中有休眠和睡眠,那么它们有什么区别呢?下面我们就通过本文来了解一下。 休眠和睡眠的区别 电脑在睡眠状态时,会切断内存之外的设备电源,电脑会进入睡眠状态,当再次唤醒电脑后,不会影响睡眠前保存好的工…