簡體   English   中英

詹金斯錯誤:java.io.IOException:錯誤=13,權限被拒絕

[英]Jenkins Error :java.io.IOException: error=13, Permission denied

我正在嘗試使用Jenkins1.58構建maven項目,一切看起來都很好,但是,當我構建項目時,出現此錯誤。

java.io.IOException: error=13, 權限被拒絕

控制台日志

 Started by user anonymous Building in workspace /var/lib/jenkins/jobs/SpringHelloWorld3/workspace > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > /usr/local/git/bin/git config remote.origin.url git@bitbucket.org:DrunkenCooder/spring3helloworld.git # timeout=10 Fetching upstream changes from git@bitbucket.org:DrunkenCooder/spring3helloworld.git > /usr/local/git/bin/git --version # timeout=10 > /usr/local/git/bin/git -c core.askpass=true fetch --tags --progress git@bitbucket.org:DrunkenCooder/spring3helloworld.git +refs/heads/*:refs/remotes/origin/* > /usr/local/git/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > /usr/local/git/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision b148eb99dead9a288afb0c9e6f6e87ae7aa133fe (refs/remotes/origin/master) > /usr/local/git/bin/git config core.sparsecheckout # timeout=10 > /usr/local/git/bin/git checkout -f b148eb99dead9a288afb0c9e6f6e87ae7aa133fe > /usr/local/git/bin/git rev-list b148eb99dead9a288afb0c9e6f6e87ae7aa133fe # timeout=10 Parsing POMs [workspace] $ /home/qaserver3/app/jdk1.6.0_45/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/conf/logging jenkins.maven3.agent.Maven31Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.47.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 50233 ERROR: Failed to parse POMs java.io.IOException: Cannot run program "/home/qaserver3/app/jdk1.6.0_45/bin/java" (in directory "/var/lib/jenkins/jobs/SpringHelloWorld3/workspace"): error=13, Permission denied at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:803) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:266) at hudson.maven.ProcessCache.get(ProcessCache.java:236) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:755) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1759) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: java.io.IOException: error=13, Permission denied at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021) ... 12 more Finished: FAILURE

I am using `Java 1.6_45` and I installed java using `.bash_profile`
and when I run `java -version` I get 
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

我還修改了超級用戶下的.bash_profile 我已將java文件夾的所有權限遞歸更改為775。

但我仍然遇到上述問題。 任何人都可以指導我解決這個問題。

如果Jenkins以非root用戶身份運行,則最可能的問題是java可執行文件(或父目錄)的權限不正確。

如果Jenkins以root用戶身份運行(這是一個壞主意!),那么我的猜測是SELinux訪問控制存在問題。

這清楚地表明這是一個許可問題。

當您在 Windows 機器上開發代碼並在 jenkins(即 linux 或 ubuntu)上進行構建時。

在 Git Bash 上運行此命令以更改權限

git update-index --chmod=+x some_shell_script.sh

這里 x 授予執行權限

然后執行git push

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM