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

EnvInjector plugin generates error when env variable already exists

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • envinject-plugin
    • None

      In the virtual machine OS environment, there is a variable with the name EXAMPLE_VARIALBE. The variable has a default value which is needed by local tools. In Jenkins jobs, I am using the EnvInject plugin to inject new environment variables but also to overwrite EXAMPLE_VARIALBE with a new value. This is standard action, however, after upgrading the Environment Injector plugin from 2.4.0 to the newest one, it started to generate an error:

      ERROR: Not all environment variables could be successfully injected. Check for similarly-named environment variables.

      Catching such behavior was introduced due to a ticket: https://issues.jenkins.io/browse/JENKINS-60559

      https://github.com/jenkinsci/envinject-plugin/commit/25669f16a5b0bb20dc97cc29e8c237bec77ab2db

      And for unknown reasons, the warning message was changed to error one, which in my opinion is completely incorrect and misleading:

      https://github.com/jenkinsci/envinject-plugin/commit/1bd30955b37acce2e81ccc871c7642ebf4344e03

      First, the message should be clearer and inform the user of what is really happening. It could be a warning or just information, but not an error.

      Second, the case from https://issues.jenkins.io/browse/JENKINS-60559 should also be caught separately, as the first message concerns a different case.

            Unassigned Unassigned
            p_jaskowiec Piotr
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: