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://[email protected]: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://[email protected]: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: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 RunnableAdapter.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.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 CallSiteStackTrace: 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. 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: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 RunnableAdapter.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)的概念,构建时的缓存会保存到这里,如果这里的空间满了,就造成了上面那个问题,解决办法是,去清理掉工作空间的缓存就好了。