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

NVM_NODEJS_ORG_MIRROR=null causes `nvm install` to always fail

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • nvm-wrapper-plugin
    • nvm-wrapper-plugin v0.1.2
      Jenkins 2.46.3

      This was probably introduced in JENKINS-40268

      Now if no `NVM_NODEJS_ORG_MIRROR` is set (none should be set or needed by default) the value `null` causes all installs and builds to fail, even if the correct version is already installed.

       

      Relevant console output log:

       

      [etx8-web] $ bash -c "export > before.env"
      [etx8-web] $ bash -c "source /home/jenkins/.nvm/nvm.sh && NVM_NODEJS_ORG_MIRROR=null nvm install 6.9.1 && nvm use 6.9.1 && export > nvm.env"
      Version '6.9.1' not found - try `nvm ls-remote` to browse available versions.
      $ ssh-agent -k
      unset SSH_AUTH_SOCK;
      unset SSH_AGENT_PID;
      echo Agent pid 19849 killed;
      [ssh-agent] Stopped.
      ERROR: Failed to fork bash 
      Archiving artifacts
      Finished: FAILURE

       

       

      To avoid the problem I think I will have to manually set the environment variable in all of my builds that use the NVM wrapper.

          [JENKINS-45079] NVM_NODEJS_ORG_MIRROR=null causes `nvm install` to always fail

          Tomas Salazar added a comment -

          Hi, I'm having problems to replicate this issue, I suppose that this is only happening with projects that were using the previous version.

           

          Tomas Salazar added a comment - Hi, I'm having problems to replicate this issue, I suppose that this is only happening with projects that were using the previous version.  

          Thom Nichols added a comment -

          Is v0.1.2 not the latest version?

           

          Noticed that if I manually set NVM_NODEJS_ORG_VERSION=http://nodejs.org/dist it then works correctly but all the fields were blank. 

          Of course I just looked at two of my projects again and now all 3 of the fields are non-blank even though I did not set them.  Perhaps a plugin upgrade quirk for projects that were using the nvm plugin prior to upgrade?

          Thom Nichols added a comment - Is v0.1.2 not the latest version?   Noticed that if I manually set NVM_NODEJS_ORG_VERSION= http://nodejs.org/dis t it then works correctly but all the fields were blank.  Of course I just looked at two of my projects again and now all 3 of the fields are non-blank even though I did not set them.  Perhaps a plugin upgrade quirk for projects that were using the nvm plugin prior to upgrade?

          Tomas Salazar added a comment -

          The plugin falls to default settings if you don't fill that fields, but the problem is because the default setter is only triggered when the object is saved, so if somebody has projects configurated with the old version it will fail. I going to send the fix at the weekend.

          If you open and save the project it must fix the problem.

          Tomas Salazar added a comment - The plugin falls to default settings if you don't fill that fields, but the problem is because the default setter is only triggered when the object is saved, so if somebody has projects configurated with the old version it will fail. I going to send the fix at the weekend. If you open and save the project it must fix the problem.

          Thom Nichols added a comment -

          Yup after I saved the build configuration the values showed up and everything returned to normal.  Thanks for the quick response!

          Thom Nichols added a comment - Yup after I saved the build configuration the values showed up and everything returned to normal.  Thanks for the quick response!

          Tomas Salazar added a comment -

          Tomas Salazar added a comment - https://github.com/jenkinsci/nvm-wrapper-plugin/pull/6

          Code changed in jenkins
          User: Tomas Salazar
          Path:
          src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java
          http://jenkins-ci.org/commit/nvm-wrapper-plugin/dcf30736d17b7e8accbbf35e4020443571e99255
          Log:
          Merge pull request #6 from atomsfat/bug/JENKINS-45079-NVM_NODEJS_ORG_MIRROR-null

          Solve NPE on upgraded installations

          Compare: https://github.com/jenkinsci/nvm-wrapper-plugin/compare/741145d2af70...dcf30736d17b

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomas Salazar Path: src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java http://jenkins-ci.org/commit/nvm-wrapper-plugin/dcf30736d17b7e8accbbf35e4020443571e99255 Log: Merge pull request #6 from atomsfat/bug/ JENKINS-45079 -NVM_NODEJS_ORG_MIRROR-null Solve NPE on upgraded installations Compare: https://github.com/jenkinsci/nvm-wrapper-plugin/compare/741145d2af70...dcf30736d17b

          Tomas Salazar added a comment -

          Solved in 0.1.3

          Tomas Salazar added a comment - Solved in 0.1.3

            atoms Tomas Salazar
            thom_nic Thom Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: