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

Jenkins doesn't handle system wide environment variables which exist in different cases

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Environment:
      Ubuntu 12.04 x86
    • Similar Issues:

      Description

      If system-wide environment variables have been set via /etc/environment those are not accessible if they exist in lower-case and capital case letters. Jenkins combines both variables into a single one, and updates the first detected variable with the value of the second one. Here some examples:

      Example 1:

      /etc/environment
      http_proxy=http://proxy.dmz.example.org:8080
      HTTP_PROXY=http://proxy.dmz.example.org:8080

      -> Jenkins:
      HTTP_PROXY=http://proxy.dmz.example.org:8080

      Example 2:

      Shell:
      export test=1
      export TEST=2

      -> Jenkins
      TEST=1

      Jenkins should not modify set environment variables because it will cause problems with tools which rely on the right capitalization. One example is mercurial which needs the lower case version of the proxy configuration. It will no longer work when both variables are set.

        Attachments

          Issue Links

            Activity

            Hide
            ikedam ikedam added a comment -

            My pull request must be resent after https://github.com/jenkinsci/jenkins/pull/986 , JENKINS-20280 is accepted.

            Show
            ikedam ikedam added a comment - My pull request must be resent after https://github.com/jenkinsci/jenkins/pull/986 , JENKINS-20280 is accepted.
            Hide
            ikedam ikedam added a comment -
            Show
            ikedam ikedam added a comment - I sent a new pull request. https://github.com/jenkinsci/jenkins/pull/988
            Hide
            rhetzler Rob Hetzler added a comment -

            Re-raising. this is a problem in jenkins 2.0 as well

            Show
            rhetzler Rob Hetzler added a comment - Re-raising. this is a problem in jenkins 2.0 as well
            Hide
            johey Johan Smolinski added a comment - - edited

            I believe I am affected by this issue. My problem is that the $http_proxy is removed, and only $HTTP_PROXY is kept. I am using a pipeline with this stage:

            stage('curly') {
                sh 'http_proxy=$HTTP_PROXY curl http://example.com/'
            }
            

            This works fine, as I have applied my workaround http_proxy=$HTTP_PROXY, but otherwise the $http_proxy is removed. Using jenkins 2.46.1 on GNU/Linux, openjdk 1.8.

            Show
            johey Johan Smolinski added a comment - - edited I believe I am affected by this issue. My problem is that the $http_proxy is removed, and only $HTTP_PROXY is kept. I am using a pipeline with this stage: stage( 'curly' ) { sh 'http_proxy=$HTTP_PROXY curl http: //example.com/' } This works fine, as I have applied my workaround http_proxy=$HTTP_PROXY, but otherwise the $http_proxy is removed. Using jenkins 2.46.1 on GNU/Linux, openjdk 1.8.
            Hide
            godfath3r Panagiotis Galatsanos added a comment - - edited

            and a simple test reproducing this issue: https://gist.github.com/godfath3r/d16e1a0e5beebd912344d55fb9ae9709

            Show
            godfath3r Panagiotis Galatsanos added a comment - - edited and a simple test reproducing this issue: https://gist.github.com/godfath3r/d16e1a0e5beebd912344d55fb9ae9709

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              whimboo Henrik Skupin
              Votes:
              13 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated: