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

PowerShell Script Runs Fail (nullPointerException)

    • Jenkins 2.249

      I have for some time had my builds all run the following PowerShell command:

      if (!(Invoke-Command -computername serverName {rename-item -path C:\fileToBeRenamed -newname C:\renamedFile -ErrorAction Stop; Return $? })) { $LASTEXITCODE = 1 }

      In versions prior to 2.248, the script executes successfully, and after a reversion to 2.245, the script still executes successfully.

      Here is the error when it attempted to run the PowerShell script in 2.248. The script did not execute (as in, it did not perform the rename as intended.)

      C:\Program Files (x86)\Jenkins\workspace\app>exit 0
      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at java.util.ArrayList.<init>(Unknown Source)
      at hudson.tasks.CommandInterpreter.buildEnvVarsFilterRules(CommandInterpreter.java:79)
      at hudson.Launcher.prepareFilterRules(Launcher.java:123)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:133)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:90)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
      at hudson.model.Build$BuildExecution.build(Build.java:206)
      at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1880)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:428)
      Build step 'PowerShell' marked build as failure
      Finished: FAILURE

      This requires a downgrade to 2.245.

          [JENKINS-63168] PowerShell Script Runs Fail (nullPointerException)

          Daniel Beck added a comment -

          I actually tried saving the job configuration without changes

          Weird, it worked for me. Saving the job with the Powershell build step again through the UI will create an empty element <configuredLocalRules/> in the XML representation of the build step configuration.

          This should be enough; I doubt a reload of the job configuration would be needed (at /job/whatever/reload).

          Daniel Beck added a comment - I actually tried saving the job configuration without changes Weird, it worked for me. Saving the job with the Powershell build step again through the UI will create an empty element <configuredLocalRules/> in the XML representation of the build step configuration. This should be enough; I doubt a reload of the job configuration would be needed (at /job/whatever/reload ).

          Not a big deal danielbeck... thank you for addressing this issue so quickly!

          Kasey Krehbiel added a comment - Not a big deal danielbeck ... thank you for addressing this issue so quickly!

          Oleg Nenashev added a comment -

          We started the merge countdown for the fix. Depending on feedback from users and core maintainers, we *might* cut an out-of-order release with the fix. We will review it tomorrow once we have more user feedback about the release (e.g whether there are other regressions missed by reviews/tests)

          Oleg Nenashev added a comment - We started the merge countdown for the fix. Depending on feedback from users and core maintainers, we * might * cut an out-of-order release with the fix. We will review it tomorrow once we have more user feedback about the release (e.g whether there are other regressions missed by reviews/tests)

          Daniel Beck added a comment -

          Someone's having fun with the changelog feedback, but didn't bother watching this issue, so difficult to say whether that's real.

          Daniel Beck added a comment - Someone's having fun with the changelog feedback, but didn't bother watching this issue, so difficult to say whether that's real.

          The '3456' thing was me trying to figure out how to work with your system - I apologize for that! I could not find a way to get rid of it!

          Kasey Krehbiel added a comment - The '3456' thing was me trying to figure out how to work with your system - I apologize for that! I could not find a way to get rid of it!

          Daniel Beck added a comment -

          No worries, 3456 is obvious noise. We've learned to live this that

          But 12 votes for this issue in short period of time indicates 1 person who really doesn't like this issue more than it does 12 people. As this is a very basic script nobody's bothered to add spam protection.

          Tentatively I'd say an out of order release is not yet needed.

          Daniel Beck added a comment - No worries, 3456 is obvious noise. We've learned to live this that But 12 votes for this issue in short period of time indicates 1 person who really doesn't like this issue more than it does 12 people. As this is a very basic script nobody's bothered to add spam protection. Tentatively I'd say an out of order release is not yet needed.

          It might help to at least put a note on the current release notes for those who, like me, would look at the changelog before upgrading. They could at least get the heads up to wait for the next release so they don't experience an outage.

          Kasey Krehbiel added a comment - It might help to at least put a note on the current release notes for those who, like me, would look at the changelog before upgrading. They could at least get the heads up to wait for the next release so they don't experience an outage.

          Daniel Beck added a comment -

          To a certain extent, that's what the changelog weather is for. While we can do banners, I'm skeptical of their long-term use for redundantly highlighting problems indicated by the weather icons, as we've had fluctuations in contributor activity in the past, so if nobody's around to maintain banners, people will think everything is fine because there's no banner.

          Daniel Beck added a comment - To a certain extent, that's what the changelog weather is for. While we can do banners, I'm skeptical of their long-term use for redundantly highlighting problems indicated by the weather icons, as we've had fluctuations in contributor activity in the past, so if nobody's around to maintain banners, people will think everything is fine because there's no banner.

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - https://www.jenkins.io/changelog/#v2.249  was released

          I updated to 2.249 and can confirm this issue is resolved by that revision. Thanks again guys - that was amazingly fast!!!

          Kasey Krehbiel added a comment - I updated to 2.249 and can confirm this issue is resolved by that revision. Thanks again guys - that was amazingly fast!!!

            danielbeck Daniel Beck
            kaseykrehbiel Kasey Krehbiel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: