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

"Try any of" stops at first installer instead of moving to the next one

      I tried the following configuration

      Given the retries, I expected that, when the local path is missing at SharedDirectory, the plugin will use the URL to download the tool.
      Instead I see a FATAL: Couldn't find any executable in "D:\Tools\NodeJS\12.x".

      I tried also to use the Stub installer but it made no difference.

      Same error

      [NodeJS LTS] - Checking local tools directory for NodeJS v12
      FATAL: Couldn't find any executable in "D:\Tools\NodeJS\12.x"

       

          [JENKINS-63739] "Try any of" stops at first installer instead of moving to the next one

          pjdarton added a comment -

          You misunderstand; "Use tool from the specified directory" does not fail if the directory doesn't exist. It simply tells Jenkins that the tool is there - it's up to the user (that's you!) to ensure that the tool is there.

          So, what's happening here is that the "Try any of ..." installer is trying the first one (the "Use tool from the specified directory"), it succeeds and hence the "Try any of ..." installer thinks that it's complete, and stops.

          Now... if you want it to work the way you expect, you'll have to enhance that installation method to provide an option to "fail if the folder does not exist", but it doesn't do that (at present) and isn't intended to do that (at present).

          pjdarton added a comment - You misunderstand; "Use tool from the specified directory" does not fail if the directory doesn't exist. It simply tells Jenkins that the tool is there - it's up to the user (that's you!) to ensure that the tool is there. So, what's happening here is that the "Try any of ..." installer is trying the first one (the "Use tool from the specified directory"), it succeeds and hence the "Try any of ..." installer thinks that it's complete, and stops. Now... if you want it to work the way you expect, you'll have to enhance that installation method to provide an option to "fail if the folder does not exist", but it doesn't do that (at present) and isn't intended to do that (at present).

          Giulio Vian added a comment -

          So, it is a documentation bug on one side and a feature request on the other.

          The behaviour you describe is not that clear in the README, and there should be a feature like the one I described above. I would love to submit a PR except that I am not a Java developer and do not have a whole day to spend in setting up a dev/test environment for this scenario.

          Giulio Vian added a comment - So, it is a documentation bug on one side and a feature request on the other. The behaviour you describe is not that clear in the README, and there should be a feature like the one I described above. I would love to submit a PR except that I am not a Java developer and do not have a whole day to spend in setting up a dev/test environment for this scenario.

          pjdarton added a comment -

          While I'm sure that the documentation could be improved, I don't agree that it's a "bug" that it doesn't specifiy that it doesn't do what you assumed; it says what it does do.

          The existing (built-in help) text says:

          For use on nodes where the tool is already installed and no further action is required. Performs no installation actions; simply reports the location of the (existing) tool to the build process.

          The example in the README.md file in github (https://github.com/jenkinsci/extra-tool-installers-plugin/blob/master/README.md) just says it'll

          put ${PATH_TO_THE_TOOL} on the $PATH and $LD_LIBRARY_PATH before they continue on with the build.

          i.e. There's nothing in either suggesting it will (or should) fail if the location does not exist.

          If you want to get involved, and either provide improvements to the documentation or functionality, I'd welcome a PR. If not, you'll have to workaround the existing behaviour and figure out another way of achieving your goals (labels, for example - put a "tool-foo-installed" label on everything that has it and include that in the label expression).

          This is all free open-source software that's the sum of the donated contributions so when it comes to enhancements "you get what you pay for" - the only reason my name is on this plugin is because "I touched it last" (I wanted it to do something it didn't, so I made a PR that enhanced it), so you're now in the situation that I was in...

          pjdarton added a comment - While I'm sure that the documentation could be improved, I don't agree that it's a "bug" that it doesn't specifiy that it doesn't do what you assumed; it says what it does do. The existing (built-in help) text says: For use on nodes where the tool is already installed and no further action is required. Performs no installation actions; simply reports the location of the (existing) tool to the build process. The example in the README.md file in github ( https://github.com/jenkinsci/extra-tool-installers-plugin/blob/master/README.md ) just says it'll put ${PATH_TO_THE_TOOL} on the $PATH and $LD_LIBRARY_PATH before they continue on with the build. i.e. There's nothing in either suggesting it will (or should) fail if the location does not exist. If you want to get involved, and either provide improvements to the documentation or functionality, I'd welcome a PR. If not, you'll have to workaround the existing behaviour and figure out another way of achieving your goals (labels, for example - put a "tool-foo-installed" label on everything that has it and include that in the label expression). This is all free open-source software that's the sum of the donated contributions so when it comes to enhancements "you get what you pay for" - the only reason my name is on this plugin is because "I touched it last" (I wanted it to do something it didn't, so I made a PR that enhanced it), so you're now in the situation that I was in...

          Valentin Delaye added a comment - Closing. Issue were moved to GitHub : https://github.com/jenkinsci/extra-tool-installers-plugin/issues

            pjdarton pjdarton
            giuliov Giulio Vian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: