报错信息1:Exception when publishing, exception message

最近一直在做Jenkins项目,也经常会出现一些报错信息,今天在测试的时候出现了下面的报错信息,所以现在记录一下我的报错过程及解决方案。

...............省略部分内容........................
[JENKINS] Archiving /root/.jenkins/workspace/one_plus/target/easy-springmvc-maven.war to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.war
channel stopped
SSH: Connecting from host [bogon]
SSH: Connecting with configuration [test] ...
ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [test]. Message [java.net.NoRouteToHostException: 没有到主机的路由 (Host unreachable)]]]
Finished: UNSTABLE

原因及解决办法:
在我思考并查找后发现原因是我的连接的后端服务器IP地址改变了,我之前用的地址是192.168.119.134,但是因为后端地址改变了没有更换所以连接不成功。

解决:更换为正确的地址测试成功,再次发送Jenkins服务器端的密钥

[root@bogon ~]# ssh-copy-id -i root@192.168.119.148

重新构建:成功

报错信息2:

Started by user jun
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/test
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://gitee.com/yangge666a/testweb> git init /root/.jenkins/workspace/test # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /root/.jenkins/workspace/testat org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1049)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:802)at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1225)at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1308)at hudson.scm.SCM.checkout(SCM.java:540)at hudson.model.AbstractProject.checkout(AbstractProject.java:1217)at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)at hudson.model.Run.execute(Run.java:1897)at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)at hudson.model.ResourceController.execute(ResourceController.java:101)at hudson.model.Executor.run(Executor.java:442)
Caused by: hudson.plugins.git.GitException: Error performing git command: git init /root/.jenkins/workspace/testat org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2746)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2660)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2656)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1981)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1047)... 12 more
Caused by: java.io.IOException: Cannot run program "git" (in directory "/root/.jenkins/workspace/test"): error=2, 没有那个文件或目录at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)at hudson.Proc$LocalProc.<init>(Proc.java:254)at hudson.Proc$LocalProc.<init>(Proc.java:223)at hudson.Launcher$LocalLauncher.launch(Launcher.java:997)at hudson.Launcher$ProcStarter.start(Launcher.java:509)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2727)... 16 more
Caused by: java.io.IOException: error=2, 没有那个文件或目录at java.lang.UNIXProcess.forkAndExec(Native Method)at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)at java.lang.ProcessImpl.start(ProcessImpl.java:134)at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)... 21 more
ERROR: Error cloning remote repo 'origin'
Sending e-mails to: yolo_yi@163.com
Finished: FAILURE

解决方案:

java.io.IOException: Cannot run program “git” (in directory “/root/.jenkins/workspace/test”): error=2, 没有那个文件或目录,看了这句话说不能运行git项目,说明在jenkins服务器上没有安装git

在Jenkins服务器上做了以下操作

[root@localhost ]# yum -y install git

报错信息3:ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]

...................前面信息太多省略........................
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:39 min
[INFO] Finished at: 2023-01-15T21:07:55+08:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /root/.jenkins/workspace/test/pom.xml to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/test/target/easy-springmvc-maven.war to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.war
SSH: Connecting from host [localhost]
SSH: Connecting with configuration [test162] ...
channel stopped
SSH: EXEC: completed after 214 ms
SSH: Disconnecting configuration [test162] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
Sending e-mails to: yolo_yi@163.com
Finished: UNSTABLE

原因:没有将脚本文件放在脚本目录下

我定义的:

但是我存放的错误:

再次构建成功:

报错信息4:

Started by user jun
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/gitlab
The recommended git tool is: NONE
using credential 43d744f4-170f-426d-a34b-cccca19404b9> git rev-parse --resolve-git-dir /root/.jenkins/workspace/gitlab/.git # timeout=10
Fetching changes from the remote Git repository> git config remote.origin.url git@192.168.119.161:root/jenkins-for-gitlab.git # timeout=10
Fetching upstream changes from git@192.168.119.161:root/jenkins-for-gitlab.git> git --version # timeout=10> git --version # 'git version 1.8.3.1'
using GIT_SSH to set credentials gitlab
Verifying host key using known hosts file> git fetch --tags --progress git@192.168.119.161:root/jenkins-for-gitlab.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@192.168.119.161:root/jenkins-for-gitlab.gitat hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1002)at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1244)at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1308)at hudson.scm.SCM.checkout(SCM.java:540)at hudson.model.AbstractProject.checkout(AbstractProject.java:1217)at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)at hudson.model.Run.execute(Run.java:1897)at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)at hudson.model.ResourceController.execute(ResourceController.java:101)at hudson.model.Executor.run(Executor.java:442)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress git@192.168.119.161:root/jenkins-for-gitlab.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: No ECDSA host key is known for 192.168.119.161 and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:87)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1000)... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

出错原因:

stderr: No ECDSA host key is known for 192.168.119.161 and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

通过这几行可以看出192.168.119.161没有被分发密钥,所以主机认证失败

解决:

##我们在Jenkins向gitlab分发密钥,再次构建
[root@localhost ~]#  ssh-copy-id -i root@192.168.119.161
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.119.161 (192.168.119.161)' can't be established.
ECDSA key fingerprint is SHA256:ntUPfvW1LRY8s42ot/wG2AlcFvtzgig3SJWTGLCnTLI.
ECDSA key fingerprint is MD5:5a:a0:c9:8a:24:63:fb:90:82:1f:d8:aa:4d:5d:67:2f.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.119.161's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'root@192.168.119.161'"
and check to make sure that only the key(s) you wanted were added.[root@localhost ~]# ssh root@192.168.119.161
Last login: Sun Jan 15 21:26:00 2023 from 192.168.119.1
[root@localhost ~]# exit
登出
Connection to 192.168.119.161 closed.

jenkin构建报错信息及解决方案相关推荐

  1. jest自动化测试遇到的一些报错信息及解决方案

    jest自动化测试遇到的一些报错信息及解决方案 参考文章: (1)jest自动化测试遇到的一些报错信息及解决方案 (2)https://www.cnblogs.com/susu8/p/9519157. ...

  2. phpredis报错信息:protocol error, got ‘o‘ as reply type byte解决方案

    phpredis报错信息:protocol error, got 'o' as reply type byte解决方案 参考文章: (1)phpredis报错信息:protocol error, go ...

  3. python find函数_Python 装饰器填坑指南 | 最常见的报错信息、原因和解决方案

    本文为霍格沃兹测试学院学员学习笔记,进阶学习文末加群. Python 装饰器简介 装饰器(Decorator)是 Python 非常实用的一个语法糖功能.装饰器本质是一种返回值也是函数的函数,可以称之 ...

  4. 【全网最暴力解决方案】使用gdb调试时遭遇“Missing separate debuginfos, use: debuginfo-install glibc....”报错信息

    问题现象 日前在CentOS 6虚拟机上使用gdb调试一个由简单的.c文件编译生成的可执行程序遭遇如下gdb报错 Missing separate debuginfos, use: debuginfo ...

  5. 报错信息:RunJar jarFile [mainClass] args...解决方案

    报错信息:RunJar jarFile [mainClass] args... 分析原因:没有指定主方法: 解决方案: 选中红框内主方法即可解决!

  6. 【报错信息】Google Play 上架报错 ( Your app contains ads that do not comply with our Families ad | 退出亲子同乐计划 )

    文章目录 一.报错信息 二.向 Google Play 政策团队询问细节信息 三.解决方案 ( 暂时 ) 一.报错信息 Google Play 上架应用 , 又又又被拒了 ; 报错信息 : Hi De ...

  7. 【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )

    文章目录 一.报错信息 二.问题分析 三.解决方案 一.报错信息 参考 [Flutter]Flutter Gallery 官方示例简介 博客 ; Flutter Galley 开源项目运行时 , 部署 ...

  8. 【错误记录】Flutter 构建报错 ( Because xxx requires SDK version >=2.12.0-0 <3.0.0, versio | Dart SDK 版本低 )

    文章目录 一.报错信息 二.问题分析 三.解决方案 一.报错信息 event sent after app closed: {id: 0, progressId: null, message: Run ...

  9. oracle 01405 提取的值为null,ORA-01405: 提取的列值为 NULL--报错原因及解决方案

    报错信息:ORA-01405: 提取的列值为 NULL 问题出现原因:形如 SELECT a INTO :a FROM NewXCData WHERE a = 'test'; 如果a的值为空,则会报此 ...

最新文章

  1. Python学习之路--函数
  2. html 5笔记:理解与学习
  3. wxWidgets随笔(10)-fedora环境配置
  4. MySQL视图附带例子详解(小白都能懂哦)
  5. 如何快速将Android库发布到JCenter
  6. DCGAN in Tensorflow生成动漫人物
  7. CSocketFile类
  8. Catalan数(数论)
  9. android网络测试上传速度慢,Android:如何获得互联网连接上传速度和延迟?
  10. nemesis什么车_狂野飙车9TrionNemesis介绍 S级车Trion复仇女神属性详解
  11. 用户'sa'登录失败(错误18456)解决方案图解
  12. Hyper-V 2016 系列教程29 主流品牌服务器的BIOS的虚拟化相关设定
  13. js常用正则表达式(经典)
  14. 企业软件是最难编写的软件
  15. pocketSpinix 训练自己的声学模型(一)
  16. Microsoft AjaxToolkits之15. RoundedCorners控件
  17. makefile教程_Makefile教程
  18. HTML5期末大作业:电影网站设计——电影(1页) HTML+CSS+JavaScript 学生DW网页设计作业成品 web课程设计网页规划与设计 计算机毕设网页设计源码
  19. 袋鼠过河问题(DP)
  20. Python数据处理相关小例编程

热门文章

  1. Android : Broadcast
  2. puts()的功能。
  3. C++笔记之linux下非阻塞多线程运行多个系统shell命令(popen方法)
  4. android studio 运行按钮为灰色的解决办法之一
  5. Android 第二春 无缝Harmony 开发
  6. 昆十四中2021年高考成绩查询,昆明第十四中学2021年排名
  7. 全球及中国游戏方向盘行业营销动态及销售渠道研究报告(2022-2027)
  8. 乳腺癌组织病理图像分类
  9. 新商用密码产品认证梳理——参考资料篇
  10. 2、GO语言多进程编程