简体   繁体   中英

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

I am trying to build maven project using Jenkins1.58 every thing looks fine but, when I build the project I am getting this error.

java.io.IOException: error=13, Permission denied

Console log

 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)

I also modified the .bash_profile under super user. I have change all the permission to 775 recursively of java folder.

but still I am getting the above issue. Can any one please guide me to address this problem.

If Jenkins is running as a non-root user, then the most likely problem is that the permissions on the java executable (or a parent directory) are incorrect.

If Jenkins is running as root (that is a bad idea!) then my guess is that this is a problem with SELinux access control.

That is clearly states it is a permission issue.

When you develop the code on windows machine and do the builds on the jenkins (which is linux or ubuntu).

Run this command on Git Bash to change the permissions

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

Here x grant the execute permissions

Then do the git push

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM