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

Running a job with a custom workspace set to eg. 'F:\' causes NullPointerException

    Details

    • Similar Issues:
    • Released As:
      2.223

      Description

      After upgrading fom ver 2.211 to ver 2.221 jobs with a drive as custom workspace throw a NullPointerException immediately:

       Running as SYSTEM
       [EnvInject] - Loading node environment variables.
       Baue auf Master in Arbeitsbereich F:\
       FATAL: null
       java.lang.NullPointerException
      	at hudson.FilePath.sibling(FilePath.java:1327)
      	at hudson.slaves.WorkspaceList.tempDir(WorkspaceList.java:306)
      	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:868)
      	at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:852)
      	at hudson.scm.SCM.checkout(SCM.java:505)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      	at hudson.model.Run.execute(Run.java:1856)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:428)
       ERROR: Build step failed with exception
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -
            Show
            oleg_nenashev Oleg Nenashev added a comment - There is no recent changes in the codebase:  https://github.com/jenkinsci/jenkins/blame/master/core/src/main/java/hudson/FilePath.java#L1327  
            Show
            fsg Frank Schlottmann-Gödde added a comment - It is probably this: https://github.com/jenkinsci/jenkins/commit/84f66e3c4ee32b96585c580c325288d20aef104f
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Looks very plausible. AFAICT there is a bug in the code I may be able to fix quickly

            Show
            oleg_nenashev Oleg Nenashev added a comment - Looks very plausible. AFAICT there is a bug in the code I may be able to fix quickly
            Hide
            jglick Jesse Glick added a comment -

            FilePath.sibling is broken for root directories. Should probably just read something like

            FilePath parent = getParent();
            return parent != null ? parent.child(rel) : child(rel);
            

            Note that this setup probably caused errors in some circumstances even before JENKINS-60634, for example if you tried to use the Credentials Binding plugin with a secret file, but the recent change would have made it happen consistently.

            Show
            jglick Jesse Glick added a comment - FilePath.sibling is broken for root directories. Should probably just read something like FilePath parent = getParent(); return parent != null ? parent.child(rel) : child(rel); Note that this setup probably caused errors in some circumstances even before JENKINS-60634 , for example if you tried to use the Credentials Binding plugin with a secret file, but the recent change would have made it happen consistently.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            https://github.com/jenkinsci/jenkins/pull/4526 - my draft. It is a bit different from what Jesse suggested

            Show
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/jenkins/pull/4526  - my draft. It is a bit different from what Jesse suggested
            Hide
            jglick Jesse Glick added a comment -

            I filed a variant patch, plus a plugin one.

            Show
            jglick Jesse Glick added a comment - I filed a variant patch, plus a plugin one.
            Hide
            olivergondza Oliver Gondža added a comment -

            Contrary to what the labels have indicated, this was not fixed in 2.222.1 nor in any other release of that LTS line.

            Show
            olivergondza Oliver Gondža added a comment - Contrary to what the labels have indicated, this was not fixed in 2.222.1 nor in any other release of that LTS line.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                fsg Frank Schlottmann-Gödde
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: