当前位置:网站首页>Jenkins持续集成报错stderr: fatal: unsafe repository (‘/home/water/water‘ is owned by someone else)
Jenkins持续集成报错stderr: fatal: unsafe repository (‘/home/water/water‘ is owned by someone else)
2022-07-23 05:55:00 【Honyelchak】
项目场景:
为了方便后期对项目进行修改,采用Jenkins持续集成工具自动build运行Maven项目。
问题描述
初次构建时报错:
Started by user water
Running as SYSTEM
Building in workspace /home/water/water
The recommended git tool is: NONE
using credential Honyelchak
Cloning the remote Git repository
Cloning repository https://xxxxxxxxx.git
> git init /home/water/water # timeout=10
Fetching upstream changes from https://xxxxxxxxx.git
> git --version # timeout=10
> git --version # 'git version 2.25.1'
using GIT_ASKPASS to set credentials gitee
> git fetch --tags --force --progress -- https://xxxxxxxxx.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- https://xxxxxxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: unsafe repository ('/home/water/water' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /home/water/water
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:847)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1216)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1294)
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)
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE
原因分析:
原因是jenkins:jenkins对文件夹/home/water/water没有权限!
解决方案:
给jenkins所属的用户赋予权限
chown -R jenkins:jenkins /home/water/water
- 用户一般不修改的话是
jenkins:jenkins /home/water/water为所指的文件夹
边栏推荐
猜你喜欢
随机推荐
OpenCV图像处理(下) 边缘检测+模板匹配+霍夫变换
动态RIP配置
Summary of basic SQL operations
RHCSA--文件內容瀏覽、cut、uniq、sort、.tr命令使用
OpenCV 视频操作
Quick solution: xshell can't drag into folders or software packages
zabbix监控详细安装到部署
【离线语音专题④】安信可VC离线语音开发板二次开发语音控制LED灯
0 shortest path problem leetcode743. Network delay time
Secret key remote login server to realize secret free login
问题解决:Script file ‘Scripts\pip-script.py‘ is not present.
录入数学公式至mark down文档的方法
C语言-大端存储和小端存储
Leetcode problem solution summary
ACL访问控制实验
OpenVPN deployment
HCIA----07 ACL-Net
Numpy:基本操作快速入门
将集合使用流进行分页
TI单芯片毫米波雷达代码走读(二十五)—— 角度维(3D)处理流程









