Jenkins 配置部署web项目时报错记录

使用jenkins Pipelines 部署项目时, 首次构建成功,再次构建时报错如下:
using credential jenkins-generated-ssh-key

> git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

> git config remote.origin.url ssh://git@220.167.101.49:18389/fchstore/wx-store.git # timeout=10

Cleaning workspace

> git rev-parse --verify HEAD # timeout=10

Resetting working tree

> git reset --hard # timeout=10

> git clean -fdx # timeout=10

ERROR: Error fetching remote repo ‘origin’

hudson.plugins.git.GitException: Failed to fetch from ssh://git@220.167.101.49:18389/fchstore/wx-store.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep S t e p E x e c u t i o n I m p l . r u n ( S C M S t e p . j a v a : 85 ) a t o r g . j e n k i n s c i . p l u g i n s . w o r k f l o w . s t e p s . s c m . S C M S t e p StepExecutionImpl.run(SCMStep.java:85) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep StepExecutionImpl.run(SCMStep.java:85)atorg.jenkinsci.plugins.workflow.steps.scm.SCMStepStepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution 1. r u n ( A b s t r a c t S y n c h r o n o u s N o n B l o c k i n g S t e p E x e c u t i o n . j a v a : 44 ) a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s 1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors 1.run(AbstractSynchronousNonBlockingStepExecution.java:44)atjava.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: hudson.plugins.git.GitException: Command “git clean -fdx” returned status code 128:

stdout:

stderr: fatal: Not a git repository: node_modules/art/lib/ast-js/…/…/.git/modules/lib/ast-js
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2002)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1970)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1966)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clean(CliGitAPIImpl.java:787)
at hudson.plugins.git.GitAPI.clean(GitAPI.java:311)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.remoting.RemoteInvocationHandler R P C R e q u e s t . p e r f o r m ( R e m o t e I n v o c a t i o n H a n d l e r . j a v a : 929 ) a t h u d s o n . r e m o t i n g . R e m o t e I n v o c a t i o n H a n d l e r RPCRequest.perform(RemoteInvocationHandler.java:929) at hudson.remoting.RemoteInvocationHandler RPCRequest.perform(RemoteInvocationHandler.java:929)athudson.remoting.RemoteInvocationHandlerRPCRequest.call(RemoteInvocationHandler.java:903)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:855)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService 1. c a l l ( I n t e r c e p t i n g E x e c u t o r S e r v i c e . j a v a : 72 ) . . . 4 m o r e S u p p r e s s e d : h u d s o n . r e m o t i n g . C h a n n e l 1.call(InterceptingExecutorService.java:72) ... 4 more Suppressed: hudson.remoting.Channel 1.call(InterceptingExecutorService.java:72)...4moreSuppressed:hudson.remoting.ChannelCallSiteStackTrace: Remote call to node251
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest E x c e p t i o n R e s p o n s e . r e t r i e v e ( U s e r R e q u e s t . j a v a : 357 ) a t h u d s o n . r e m o t i n g . C h a n n e l . c a l l ( C h a n n e l . j a v a : 955 ) a t h u d s o n . r e m o t i n g . R e m o t e I n v o c a t i o n H a n d l e r . i n v o k e ( R e m o t e I n v o c a t i o n H a n d l e r . j a v a : 283 ) a t c o m . s u n . p r o x y . ExceptionResponse.retrieve(UserRequest.java:357) at hudson.remoting.Channel.call(Channel.java:955) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283) at com.sun.proxy. ExceptionResponse.retrieve(UserRequest.java:357)athudson.remoting.Channel.call(Channel.java:955)athudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)atcom.sun.proxy.Proxy81.clean(Unknown Source)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl.clean(RemoteGitImpl.java:450)
at hudson.plugins.git.extensions.impl.CleanBeforeCheckout.decorateFetchCommand(CleanBeforeCheckout.java:30)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:890)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep S t e p E x e c u t i o n I m p l . r u n ( S C M S t e p . j a v a : 85 ) a t o r g . j e n k i n s c i . p l u g i n s . w o r k f l o w . s t e p s . s c m . S C M S t e p StepExecutionImpl.run(SCMStep.java:85) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep StepExecutionImpl.run(SCMStep.java:85)atorg.jenkinsci.plugins.workflow.steps.scm.SCMStepStepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution 1. r u n ( A b s t r a c t S y n c h r o n o u s N o n B l o c k i n g S t e p E x e c u t i o n . j a v a : 44 ) a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s 1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors 1.run(AbstractSynchronousNonBlockingStepExecution.java:44)atjava.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511)
… 4 more
Error fetching remote repo ‘origin’

在这里插入图片描述
查阅资料时,已下面两个错误信息为重点查阅:

Caused by: hudson.plugins.git.GitException: Command “git clean -fdx” returned status code 128:
stderr: fatal: Not a git repository: node_modules/art/lib/ast-js/…/…/.git/modules/lib/ast-js

以为是git的权限问题,疯狂的去配置调试git中的密钥,还是没有解决问题,又以为是Jenkins插件没有更新的问题,花了大半天时间把所有插件更新升级,也没有解决问题,最后发现是Jenkins这边出现了问题,Jenkins有个工作空间( workspace)的概念,构建时的缓存会保存到这里,如果这里的空间满了,就造成了上面那个问题,解决办法是,去清理掉工作空间的缓存就好了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是配置Jenkins部署Web项目的步骤: 1. 确保Jenkins服务器已经安装了JDK、Git和Maven等工具,并且配置了JAVA_HOME环境变量。 2. 在Jenkins服务器上安装插件:在Jenkins的管理界面中,点击"插件管理",选择"可选插件",搜索并安装"Git plugin"、"Maven Integration plugin"和"SSH plugin"等插件。 3. 创建一个新的Jenkins任务:在Jenkins的主界面中,点击"新建任务",输入任务名称并选择"自由风格的软件项目",然后点击"确定"。 4. 配置源码管理:在任务配置界面的"源码管理"部分,选择"Git",填写你的代码仓库URL和认证信息(如果需要),然后点击"保存"。 5. 配置构建触发器:在任务配置界面的"构建触发器"部分,选择适合你的构建触发方式,例如定构建或者代码提交触发构建。 6. 配置构建步骤:在任务配置界面的"构建"部分,点击"增加构建步骤",选择"Maven构建",填写Maven项目的POM文件路径和构建参数(如果有),然后点击"保存"。 7. 配置构建后操作:在任务配置界面的"构建后操作"部分,点击"增加构建后操作",选择"Send files or execute commands over SSH",填写SSH服务器的连接信息和执行的命令(例如部署到Tomcat服务器),然后点击"保存"。 8. 保存并立即构建:在任务配置界面的右上角,点击"保存"并返回任务列表,然后点击任务名称进入任务详情页面,点击"立即构建"开始构建项目。 9. 查看构建结果:在任务详情页面的"构建历史"部分,点击最新的构建编号,可以查看构建日志和构建结果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

caperxi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值