Jenkins CICD过程常见异常

这篇具有很好参考价值的文章主要介绍了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 填写绝对地址

exception when publishing, exception message [exec exit status not zero. sta,构建工具,jenkins,elasticsearch,运维

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: 500

	at 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

使用删除文件命令,删掉多余日志:文章来源地址https://www.toymoban.com/news/detail-780272.html

rm -rf file

到了这里,关于Jenkins CICD过程常见异常的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Jenkins中Publish Over SSH插件使用(1)

    SSH插件 前言Publish Over SSH插件是jenkins里面必不可少的插件之一,主要的功能有两个把jenkins服务器上的文件,传输到远程nginx, 远程执行shell命令和脚本。 1. SSH插件下载与配置 1.1 下载Publish over SSH插件 系统管理—》管理插件 下载后的本地路径:$JENKINS_HOME/plugins/publish_over 1.2 全

    2024年02月21日
    浏览(34)
  • jenkins的cicd操作

    持续集成( Continuous Integration) 持续频繁的(每天多次)将本地代码“集成”到主干分支,并保证主干分支可用 持续交付(Continuous Delivery) 是持续集成的下一步,持续频繁地将软件的新版本交付到类生产环境(类似于预发),交付给测试、产品验收。 持续交付强调的是“

    2024年02月14日
    浏览(34)
  • Jenkins 持续集成 【CICD】

    持续集成是一种开发实践,它倡导团队成员频繁的集成他们的工作,每次集成都通过自动化构建(包括编译、构建、打包、部署、自动化测试)来验证,从而尽快地发现集成中的错误。让产品可以快速迭代,同时还能保持高质量。 Jenkins是基于Java开发的持续集成工具,开源免

    2024年04月12日
    浏览(32)
  • 基于Jenkins的CICD

    已安装docker并设置为开机自启 已安装Docker-Compose 基于docker安装Jenkins jenkins官网 编写docker-compose.yml文件 首次启动会因为数据卷data目录没有权限导致启动失败,设置data目录写权限(/usr/local/docker/jenkins_docker/data) 启动jenkins 在/usr/local/docker/jenkins_docker目录下执行 访问地址 账号密码

    2024年04月22日
    浏览(48)
  • Jenkins和gitlab实现CICD

    在开发TracerBackend服务的时候,每次更改代码之后需要推送到gitlab,然后ssh登录到Ubuntu的服务器上部署新的代码。服务成功启动之后,在本地执行测试用例,觉得这一套操作流程还是挺复杂的。想起公司的代码发布流程,只要个人分支的代码测试通过之后,合并到master分支的时

    2024年04月22日
    浏览(36)
  • 【CICD】Jenkins 常用操作手册

    词汇 说明 Node 作为 Jenkins 环境的一部分并能够执行Pipeline或项目的机器,无论是 Master 还是Agent 都被认为是 Node。 Master 存储配置,加载插件以及为 Jenkins 呈现各种用户界面的主控节点 Agent 通常是一台主机或容器,连接到 Jenkins 主控节点,并执行主控节点下发的任务 Executor 节

    2024年03月19日
    浏览(36)
  • Publish Over SSH插件的使用(jenkins远程服务器发送文件)

    用于连接ssh服务器,然后在该服务器上做一些操作。例如连接服务器,部署服务到该服务器上 添加服务器列表 注意 添加完点击 Test Configuration 确保服务器配置能连接成功 安装好插件后,上传文件到其他服务器上要选择 Send files or execute commands over SSH 注意 1、 SSH Server Name 表示要

    2023年04月08日
    浏览(40)
  • CICD中的Jenkins和Ansible解决方案

    每一次重装系统或者是需要在服务器上正确运行软件,我们都需要重新安装所有的package、dependency并进行相应配置的微调。而这一过程可能就会因为疏忽导致错误,因此需要自动化部署 持续整合,持续交付(CI/CD)的实践,我们能够周期性的对产品进行各种专业测试,如果出

    2024年02月01日
    浏览(30)
  • CICD 流程学习(五)Jenkins后端工程构建

    案例1:数据库服务部署 MySQL部署 Redis部署 案例2:Jenkins全局工具配置 配置JDK环境    配置Git工具  配置Maven工具 配置邮件工具   案例3:Jenkins后端工程构建 Jenkins中创建HIS-BACKEND工程    测试HIS-BACKEND工程构建   案例4:Jenkins后端自动发布 添加SSH服务器     HIS-BACKEND工程配置

    2024年02月08日
    浏览(30)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包