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

Hudson 1.334 build fails with custom workspace on windows drive with no subdir

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: Windows XP

      Upgraded to 1.334 and encountered a problem with using a custom workspace:
      FATAL: Failed to mkdirs: D:\devtools\Hudson\N:\
      java.io.IOException: Failed to mkdirs: D:\devtools\Hudson\N:\
      at hudson.FilePath.mkdirs(FilePath.java:744)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1004)
      at
      hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:431)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:378)
      at hudson.model.Run.run(Run.java:1176)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:123)

      I have the custom workspace set to N:\ which is a substed drive on a Windows XP
      machine. Not sure if the substing is relevant, but figured I'd mention it (I'm
      guessing not). Rolling back to 1.333 fixed the issue for me.

          [JENKINS-4894] Hudson 1.334 build fails with custom workspace on windows drive with no subdir

          Alan Harder added a comment -

          This is caused by:
          https://hudson.dev.java.net/source/browse/hudson?view=rev&rev=23656

          It does check for absolute path, so it shouldn't append your N:\ onto the root
          dir of the node... however, the check for absolute is "[A-Za-z]:
          .+" which
          means it assumes there is at least one character after the backslash.. in your
          case there is none. I'll change it to .* so your path here will be recognized
          as absolute.

          Alan Harder added a comment - This is caused by: https://hudson.dev.java.net/source/browse/hudson?view=rev&rev=23656 It does check for absolute path, so it shouldn't append your N:\ onto the root dir of the node... however, the check for absolute is " [A-Za-z] : .+" which means it assumes there is at least one character after the backslash.. in your case there is none. I'll change it to .* so your path here will be recognized as absolute.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/FilePath.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=23832
          Log:
          [FIXED JENKINS-4894] update DRIVE_PATTERN so a path like C:\ is recognized as absolute

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/FilePath.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=23832 Log: [FIXED JENKINS-4894] update DRIVE_PATTERN so a path like C:\ is recognized as absolute

          torbent added a comment -

          I just ran into the same issue when upgrading to 1.334. However, our paths are
          not X:\, but more like X:/hudson/etc, with forward slashes. Yes, that works for
          Windows (at least for Hudson on Windows), and I'd like to request that it keeps
          working.
          So "[A-Za-z]:
          ." should maybe be "[A-Za-z]:\\/."?
          Another question is whether a bare "X:" would be considered an absolute dir? The
          regex doesn't.

          torbent added a comment - I just ran into the same issue when upgrading to 1.334. However, our paths are not X:\, but more like X:/hudson/etc, with forward slashes. Yes, that works for Windows (at least for Hudson on Windows), and I'd like to request that it keeps working. So " [A-Za-z] : . " should maybe be " [A-Za-z] : \\/ . "? Another question is whether a bare "X:" would be considered an absolute dir? The regex doesn't.

          torbent added a comment -

          (forgot to CC myself)

          torbent added a comment - (forgot to CC myself)

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/FilePath.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=23889
          Log:
          [FIXED JENKINS-4894] match windows absolute path like C:/path as requested by torbent.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/FilePath.java http://fisheye4.cenqua.com/changelog/hudson/?cs=23889 Log: [FIXED JENKINS-4894] match windows absolute path like C:/path as requested by torbent.

          Alan Harder added a comment -

          I added the / but did not allow no \ or /. When I do "dir C:" it seems
          relative, as it shows the cwd on C: and not the root dir of C:.

          Alan Harder added a comment - I added the / but did not allow no \ or /. When I do "dir C:" it seems relative, as it shows the cwd on C: and not the root dir of C:.

          Code changed in hudson
          User: : mindless
          Path:
          branches/rc/core/src/main/java/hudson/FilePath.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=23890
          Log:
          JENKINS-4894 merge r23889 to rc branch for 1.335

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: branches/rc/core/src/main/java/hudson/FilePath.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=23890 Log: JENKINS-4894 merge r23889 to rc branch for 1.335

          torbent added a comment -

          Verified as working in 1.335

          torbent added a comment - Verified as working in 1.335

            mindless Alan Harder
            mrobinet mrobinet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: