Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32443

java.nio.file.AccessDeniedException on Windows master

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • CJE 1.609.15.1
      Windows Server 2012 R2
      Oracle JDK 1.8.0_66

      Running a build from windows will end successfully, however it will throw the following AccessDeniedException.

      Started by user user@host.com
      ln \\domain\public\projects\eng\test\project\master\task\lastSuccessfulBuild C:\jenkins\data\jobs\eng\jobs\test\jobs\project\jobs\master\jobs\task\lastSuccessful failed
      java.nio.file.AccessDeniedException: C:\jenkins\data\jobs\eng\jobs\test\jobs\project\jobs\master\jobs\task\lastSuccessful
              at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
              at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
              at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
              at sun.nio.fs.WindowsFileSystemProvider.createSymbolicLink(Unknown Source)
              at java.nio.file.Files.createSymbolicLink(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor357.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at hudson.Util.createSymlinkJava7(Util.java:1226)
              at hudson.Util.createSymlink(Util.java:1142)
              at hudson.model.Run.createSymlink(Run.java:1842)
              at hudson.model.Run.updateSymlinks(Run.java:1823)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:176)
              at hudson.model.ResourceController.execute(ResourceController.java:98)
              at hudson.model.Executor.run(Executor.java:381)
      ln \\domain\public\projects\eng\test\project\master\task\lastStableBuild C:\jenkins\data\jobs\eng\jobs\test\jobs\project\jobs\master\jobs\task\lastStable failed
      java.nio.file.AccessDeniedException: C:\jenkins\data\jobs\eng\jobs\test\jobs\project\jobs\master\jobs\task\lastStable
              at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
              at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
              at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
              at sun.nio.fs.WindowsFileSystemProvider.createSymbolicLink(Unknown Source)
              at java.nio.file.Files.createSymbolicLink(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor357.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at hudson.Util.createSymlinkJava7(Util.java:1226)
              at hudson.Util.createSymlink(Util.java:1142)
              at hudson.model.Run.createSymlink(Run.java:1842)
              at hudson.model.Run.updateSymlinks(Run.java:1824)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:176)
              at hudson.model.ResourceController.execute(ResourceController.java:98)
              at hudson.model.Executor.run(Executor.java:381)
      Running: Allocate node : Start
      Running on slave-3 in C:\jk\workspace\eng\test\project\master\task
      Running: Allocate node : Body : Start
      Running: Print Message
      test message
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: End of Workflow
      Finished: SUCCESS
      

          [JENKINS-32443] java.nio.file.AccessDeniedException on Windows master

          Jesse Glick added a comment -

          This line needs to be broadened to include AccessDeniedException, a subclass.

          More generally, Jenkins now requires Java 7 as a baseline, so the complex code in Util to support Java 6 is obsolete and could be stripped out—one side effect of which would be to make plain old

          } catch (FileSystemException x) {
              warnWindowsSymlink();
              return true;
          }
          

          work, bypassing this bug.

          Jesse Glick added a comment - This line needs to be broadened to include AccessDeniedException , a subclass. More generally, Jenkins now requires Java 7 as a baseline, so the complex code in Util to support Java 6 is obsolete and could be stripped out—one side effect of which would be to make plain old } catch (FileSystemException x) { warnWindowsSymlink(); return true ; } work, bypassing this bug.

          I got the same error message AccessDeniedException.
          Einviroment:
          Windows 7
          java version 1.7.0_40

          Mengesteab Ghebreyesus added a comment - I got the same error message AccessDeniedException. Einviroment: Windows 7 java version 1.7.0_40

          sorry:
          Jenkins ver. 1.594

          Mengesteab Ghebreyesus added a comment - sorry: Jenkins ver. 1.594

          Oleh Olkhovskyy added a comment - - edited

          I have same error.
          Jenkins ver. 1.644

          I have it on the job that runs several instances in parallel, so it looks like synchronization issue

          Oleh Olkhovskyy added a comment - - edited I have same error. Jenkins ver. 1.644 I have it on the job that runs several instances in parallel, so it looks like synchronization issue

          here again with additional information,
          I got the error message 'AccessDeniedException' after i moved the jobs directory to network directory, which a created with 'mklink'.

          Mengesteab Ghebreyesus added a comment - here again with additional information, I got the error message 'AccessDeniedException' after i moved the jobs directory to network directory, which a created with 'mklink'.

            Unassigned Unassigned
            ganthore Mark Austin
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: