2014-10-07 57 views
5

我已經成功地建立一個詹金斯實例上樹莓派,並儘可能安裝插件的NodeJS已經得到之前,我終於打這個絆腳石:詹金斯和插件的NodeJS - 權限被拒絕的錯誤

Started by an SCM change 
Building in workspace /var/lib/jenkins/jobs/Test Project/workspace 
> git rev-parse --is-inside-work-tree # timeout=10 
Fetching changes from the remote Git repository 
> git config remote.origin.url localhost:/GITREPO/test # timeout=10 
Fetching upstream changes from localhost:/GITREPO/test 
> git --version # timeout=10 
> git fetch --tags --progress localhost:/GITREPO/test +refs/heads/*:refs/remotes/origin/* 
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10 
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 
Checking out Revision 8e6edee9fdc1e8bf754dc1a27f46c1dea3531144 (refs/remotes/origin/master) 
> git config core.sparsecheckout # timeout=10 
> git checkout -f 8e6edee9fdc1e8bf754dc1a27f46c1dea3531144 
> git rev-list 8eaf1bc6a0be837100e476b33bec559b33e9997f # timeout=10 
[workspace] $ /bin/sh -xe /tmp/hudson5445359267004163031.sh 
+ echo /usr/local/bin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 
/usr/local/bin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 
+ node --version 
v0.10.32 
+ grunt --version 
grunt-cli v0.1.13 
+ java -version 
java version "1.8.0" 
Java(TM) SE Runtime Environment (build 1.8.0-b132) 
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode) 
[workspace] $ /tmp/hudson1009495610900642950.js 
FATAL: command execution failed 
java.io.IOException: Cannot run program "/tmp/hudson1009495610900642950.js" (in directory "/var/lib/jenkins/jobs/Test Project/workspace"): error=13, Permission denied 
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042) 
    at hudson.Proc$LocalProc.<init>(Proc.java:244) 
    at hudson.Proc$LocalProc.<init>(Proc.java:216) 
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:802) 
    at jenkins.plugins.nodejs.tools.DecoratedLauncher.launch(DecoratedLauncher.java:49) 
    at jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper$2.launch(NpmPackagesBuildWrapper.java:88) 
    at hudson.Launcher$ProcStarter.start(Launcher.java:380) 
    at hudson.Launcher$ProcStarter.join(Launcher.java:387) 
    at jenkins.plugins.nodejs.NodeJsCommandInterpreter.perform(NodeJsCommandInterpreter.java:84) 
    at jenkins.plugins.nodejs.NodeJsCommandInterpreter.perform(NodeJsCommandInterpreter.java:42) 
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) 
    at hudson.model.Build$BuildExecution.build(Build.java:199) 
    at hudson.model.Build$BuildExecution.doRun(Build.java:160) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) 
    at hudson.model.Run.execute(Run.java:1745) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
    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:187) 
    at java.lang.ProcessImpl.start(ProcessImpl.java:134) 
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023) 
    ... 18 more 
Build step 'Execute NodeJS script' marked build as failure 
Finished: FAILURE 

我沒有做什麼特別特殊的,這是一個最初的測試,以確保插件的NodeJS作品:

var sys = require('sys'); 
sys.puts('NodeJS Test'); 
sys.puts('***********'); 
sys.puts('Hello World'); 

,如果我的身份登錄的詹金斯用戶,並運行它自己的作品

我拖網了,似乎無法找到任何具體的東西;很確定它沒有特別的文件權限(工作區目錄可以完全訪問所有用戶)

+0

儘量在第一的是腳本'#線的添加在/ usr/bin中/ node'(CH eck如果該路徑正確使用'哪個節點') – Salem 2014-10-07 15:33:06

+0

@Salem,他沒有使用「Execute Shell」構建步驟,所以這個建議是非常無效的 – Slav 2014-10-07 17:31:40

回答

5

我有同樣的問題。對我來說,它是jenkins中「全局配置」下的nodejs插件配置。我的「節點」應用程序(符號鏈接)位於/usr/local/bin/node。我的「安裝目錄」被設置爲/usr/local/bin/。我改變了這個/usr/local/,它開始工作! :)

注意,這是當你不是使用「自動安裝」的插件的NodeJS的 - 功能。

2

我幾乎同樣的問題,詹金斯權限,

的問題是,詹金斯不可能的,因爲它沒有權限的文件夾寫的,所以我安裝了中的NodeJS /var/lib/jenkins/tools/

自動插件

我在這裏更詳細的描述:

Jenkins And NodeJS Plugin - Permission Denied Error=13

+0

謝謝 - 編輯了答案。 – riverfall 2016-05-13 07:57:26

+0

感謝您的編輯 – 2016-05-13 09:22:06