-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
OS: Centos 7 64-bit
JRE: OpenJDK 1.8
Container: Tomcat
Jenkins version: 1.651.3 (and 2.53 according to code)
Browser: Chrome
Steps to reproduce:
- Copy Jenkins home directory to a filesystem that does not support symlinks (AWS Storage Gateway in my case)
- Add -Dhudson.Util.noSymLink=true to java options in tomcat configuration
- Start Jenkins
- Perform a build or a promotion with the Promotions plugin
Observe:
ln builds/lastSuccessfulBuild /var/lib/jenkins/jobs/McRel Identity App/promotions/dev/lastSuccessful failed java.nio.file.FileSystemException: /var/lib/jenkins/jobs/McRel Identity App/promotions/dev/lastSuccessful: Unknown error 524 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.createSymbolicLink(UnixFileSystemProvider.java:457) at java.nio.file.Files.createSymbolicLink(Files.java:1043) 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:498) at hudson.Util.createSymlinkJava7(Util.java:1237) at hudson.Util.createSymlink(Util.java:1153) at hudson.model.Run.createSymlink(Run.java:1840) at hudson.model.Run.updateSymlinks(Run.java:1821) at hudson.model.Run.execute(Run.java:1736) at hudson.model.Run.run(Run.java:1676) at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:286) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)
The problem appears to be introduced in commit ed748d4b810ac1dd85e5da7857bc203f5773f329
Jenkins tries to create the symlink using the Java 7+ approach. If it fails, it then checks hudson.Util.noSymLink before trying other methods to create the symlink.
Recommended fix would be to test for NO_SYMLINK at the very beginning of createSymlink.
- is related to
-
JENKINS-43540 builds/lastSuccessfulBuild symlink is not created
- Open
- relates to
-
JENKINS-37862 Extract build symlink handling to a plugin
- Resolved