这是最奇怪的事情。我成功运行了一个构建。然后我再次运行它,没有更改配置中的任何内容,从SVN中提取文件后它失败了。
FATAL: command execution failed
java.nio.file.AccessDeniedException: /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-4.2.6/.npmPackages
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at hudson.Util.deleteFile(Util.java:255)
at hudson.FilePath$19.invoke(FilePath.java:1425)
at hudson.FilePath$19.invoke(FilePath.java:1422)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.FilePath.delete(FilePath.java:1422)
at jenkins.plugins.nodejs.tools.NodeJSInstaller.performInstallation(NodeJSInstaller.java:149)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at jenkins.plugins.nodejs.tools.NodeJSInstallation.forNode(NodeJSInstallation.java:60)
at jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper$2.launch(NpmPackagesBuildWrapper.java:68)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:919)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:671)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Execute shell' marked build as failure
Finished: FAILURE
它已经使用该版本的节点构建,并且它引用的文件夹对与我一起运行作业的用户具有rwx权限。它发生在我执行"svn更新"的步骤和运行自定义shell脚本的步骤之间。我禁用了shell脚本,看看这是否是问题所在,但我仍然收到同样的错误。所以我认为这是詹金斯的问题,不知道原因是什么。
从4.2.6降级到节点4.2.0解决了问题。我仍然不知道为什么它之前用4.2.6成功构建,但突然失败了。