我有 VSP,上面安装了 Ubuntu 20.04 和 Jenkins。还有一个 Java Maven 测试项目,它应该作为 Jenkins 作业运行。几个小时前,一切正常。然后我向 Maven 项目添加了一个新功能,并更改了 chmod 权限以允许组写入 Maven 存储结果的目录。然后它崩溃了。所以我尝试将所有权限设置为 777,但这并没有解决问题。我不明白为什么如果所有权限都是 777,它仍然会抛出错误“权限被拒绝,目录不存在”。这是控制台日志:
##/home/vlado/selenium-tests/test-1 - is the Maven project directory with chmod 777
Started by user Vladi Camo
Running as SYSTEM
Building in workspace /home/vlado/selenium-tests/test-1
java.nio.file.AccessDeniedException: /home/vlado/selenium-tests/test-1
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.createDirectory(UnixFileSystemProvider.java:384)
at java.nio.file.Files.createDirectory(Files.java:674)
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
at java.nio.file.Files.createDirectories(Files.java:767)
at hudson.FilePath.mkdirs(FilePath.java:3523)
at hudson.FilePath.access$1400(FilePath.java:213)
at hudson.FilePath$Mkdirs.invoke(FilePath.java:1339)
at hudson.FilePath$Mkdirs.invoke(FilePath.java:1335)
at hudson.FilePath.act(FilePath.java:1163)
at hudson.FilePath.act(FilePath.java:1146)
at hudson.FilePath.mkdirs(FilePath.java:1331)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1200)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
at hudson.model.Run.execute(Run.java:1907)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Archiving artifacts
ERROR: Build step failed with exception
/home/vlado/selenium-tests/test-1 does not exist.
我不明白其中的两行:
java.nio.file.AccessDeniedException: /home/vlado/selenium-tests/test-1
and
/home/vlado/selenium-tests/test-1 does not exist
有人能告诉我那里发生了什么吗?非常感谢。
答案1
因此问题不在于项目目录的权限,而在于父目录的权限,它缺少其他目录的 x 权限。我不明白这是怎么发生的。