简体   繁体   English

詹金斯错误:java.io.IOException:错误=13,权限被拒绝

[英]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.我正在尝试使用Jenkins1.58构建maven项目,一切看起来都很好,但是,当我构建项目时,出现此错误。

java.io.IOException: error=13, Permission denied java.io.IOException: error=13, 权限被拒绝

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.我还修改了超级用户下的.bash_profile I have change all the permission to 775 recursively of java folder.我已将java文件夹的所有权限递归更改为775。

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. 如果Jenkins以非root用户身份运行,则最可能的问题是java可执行文件(或父目录)的权限不正确。

If Jenkins is running as root (that is a bad idea!) then my guess is that this is a problem with SELinux access control. 如果Jenkins以root用户身份运行(这是一个坏主意!),那么我的猜测是SELinux访问控制存在问题。

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).当您在 Windows 机器上开发代码并在 jenkins(即 linux 或 ubuntu)上进行构建时。

Run this command on Git Bash to change the permissions在 Git Bash 上运行此命令以更改权限

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

Here x grant the execute permissions这里 x 授予执行权限

Then do the git push然后执行git push

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.io.IOException: error=13, Permission denied while execution an.exe library - java.io.IOException: error=13, Permission denied while executing an .exe library JavaFX java.io.IOException &quot;uptime&quot;: error=13, permission denied - 以普通用户身份运行程序 - JavaFX java.io.IOException "uptime": error=13, permission denied - Running program as regular user W/System.err:java.io.IOException:无法运行程序“python”:错误=13,权限被拒绝 - W/System.err: java.io.IOException: Cannot run program "python": error=13, Permission denied 通过java程序在IBM云中运行shell命令,将抛出java.io.IOException错误:无法运行program = 13,权限被拒绝 - Running a shell command in IBM cloud through java programme throwing error as java.io.IOException: Cannot run program =13, Permission denied java.io.IOException:关闭XSSFWorkbook时,jenkins中的权限被拒绝 - java.io.IOException: Permission denied in jenkins While Closing XSSFWorkbook java.io.IOException:Java中的权限被拒绝 - java.io.IOException: Permission denied in Java java.io.IOException:createNewFile() 的权限被拒绝 - java.io.IOException: Permission denied for createNewFile() 错误原因:java.io.IOException:{“错误”:{“代码”:403,“消息”:“权限被拒绝。无法执行此操作”}} - error Caused by: java.io.IOException: { "error": { "code": 403, "message": "Permission denied. Could not perform this operation" }} java.io.IOException: Permission denied 写入可移动 SD 卡时出错 - java.io.IOException: Permission denied Error when writing to removable SD card 即使在询问权限后,java.io.IOException 权限也被拒绝 - java.io.IOException Permission denied even after asking the permision
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM