jenkins和gitlab结合的时候出错

Started by user zhaoliang
Building in workspace /var/lib/jenkins/workspace/ZuoYeah_Static_Production
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@gitlab.com:tiplus_cn/zuoyeah_static.git # timeout=10
Fetching upstream changes from git@gitlab.com:tiplus_cn/zuoyeah_static.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@gitlab.com:tiplus_cn/zuoyeah_static.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@gitlab.com:tiplus_cn/zuoyeah_static.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@gitlab.com:tiplus_cn/
zuoyeah_static.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: remote: Counting objects: 18, done.[K
remote: Compressing objects: 5% (1/18) [K
remote: Compressing objects: 11% (2/18) [K
remote: Compressing objects: 16% (3/18) [K
remote: Compressing objects: 22% (4/18) [K
remote: Compressing objects: 27% (5/18) [K
remote: Compressing objects: 33% (6/18) [K
remote: Compressing objects: 38% (7/18) [K
remote: Compressing objects: 44% (8/18) [K
remote: Compressing objects: 50% (9/18) [K
remote: Compressing objects: 55% (10/18) [K
remote: Compressing objects: 61% (11/18) [K
remote: Compressing objects: 66% (12/18) [K
remote: Compressing objects: 72% (13/18) [K
remote: Compressing objects: 77% (14/18) [K
remote: Compressing objects: 83% (15/18) [K
remote: Compressing objects: 88% (16/18) [K
remote: Compressing objects: 94% (17/18) [K
remote: Compressing objects: 100% (18/18) [K
remote: Compressing objects: 100% (18/18), done.[K
remote: Total 18 (delta 12), reused 0 (delta 0)[K
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
... 11 more
ERROR: null
Finished: FAILURE

原因是我在服务器进行了操作,然后在/var/lib/jenkins/workspace/ZuoYeah_Static_Production/.git/objects目录中 无意中增加了root账号权限的文件夹,原来是jenkins账号的文件权限是jenkins,所以需要将objects目录下的文件夹权限组修改为jenkins

上一篇:使用js获取数组中最大、最小的数字


下一篇:JavaScript 正则匹配中文,中文符号,空格,全数字,以https:// 开头的url,用于各种场景的输入校验