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

Credentials dropdown empty on git scm with specific authorize project settings

      Since recently (might be through the 2.7.3 to 2.7.4 upgrade) I am unable to select any credentials with the git settings directly in the job configuration.

      Even if I add credentials, it does not show in the list.

      Any advices?

      $ java -version
      java version "1.8.0_102"
      Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
      
      $ git --version
      git version 1.9.1
      
      Ubuntu 14.04 LTS latest apt update && apt upgrade
      

      Meanwhile switched the system, but same problem:

      $ java -version
      java version "1.8.0_112"
      Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
      
      $ git --version
      git version 2.1.4
      
      Debian 8 latest apt update && apt upgrade
      

          [JENKINS-38126] Credentials dropdown empty on git scm with specific authorize project settings

          Günter Grodotzki created issue -
          Günter Grodotzki made changes -
          Description Original: Since recently (might be through the 2.7.3 to 2.7.4 upgrade) I am unable to select any credentials with the git settings directly in the job configuration.

          Even if I add credentials, it does not show in the list.

          Any advices?
          New: Since recently (might be through the 2.7.3 to 2.7.4 upgrade) I am unable to select any credentials with the git settings directly in the job configuration.

          Even if I add credentials, it does not show in the list.

          Any advices?

          {code}
          $ java -version
          java version "1.8.0_102"
          Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
          Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
          {code}

          {code}
          $ git --version
          git version 1.9.1
          {code}

          {code}
          Ubuntu 14.04 LTS latest apt update && apt upgrade
          {code}

          Mark Waite added a comment -

          It will be a great help if you can isolate the component upgrade which actually caused the change.

          The git plugin switched from using credentials 1.x to credentials 2.1 as part of the change from git plugin 2.5.3 to 2.6.0. If you're running git plugin 2.6.0 and you downgrade to an earlier version, do the credentials again appear?

          Mark Waite added a comment - It will be a great help if you can isolate the component upgrade which actually caused the change. The git plugin switched from using credentials 1.x to credentials 2.1 as part of the change from git plugin 2.5.3 to 2.6.0. If you're running git plugin 2.6.0 and you downgrade to an earlier version, do the credentials again appear?

          Günter Grodotzki added a comment - - edited

          I downgraded to the following versions, unfortunately no luck:

          • Credentials Plugin: 2.1.0
          • Git client plugin: 1.21.0
          • Git plugin: 2.6.0

          As far as I can remember though there was a major git/credentials upgrade recently? E.g. the above versions where when the problems started (which was right after I upgraded Jenkins to 2.7.4) - the git 3.0.0 / git-client 2.0.0 only came a few days afterwards which I was hoping would fix the issue.

          However, after doing a manual install of the Git plugin 2.5.3 (http://updates.jenkins-ci.org/download/plugins/git/2.5.3/git.hpi) - my creds are back!

          I am curious why I am the only one having this issue and if there is something else maybe actually going wrong?

          Update: fwiw, on another setup with Jenkins 2.11 I am not having the issue - e.g. everything works with latest git/cred plugins. However there are also only a handful of plugins installed..

          Günter Grodotzki added a comment - - edited I downgraded to the following versions, unfortunately no luck: Credentials Plugin: 2.1.0 Git client plugin: 1.21.0 Git plugin: 2.6.0 As far as I can remember though there was a major git/credentials upgrade recently? E.g. the above versions where when the problems started (which was right after I upgraded Jenkins to 2.7.4) - the git 3.0.0 / git-client 2.0.0 only came a few days afterwards which I was hoping would fix the issue. However, after doing a manual install of the Git plugin 2.5.3 ( http://updates.jenkins-ci.org/download/plugins/git/2.5.3/git.hpi ) - my creds are back! I am curious why I am the only one having this issue and if there is something else maybe actually going wrong? Update: fwiw, on another setup with Jenkins 2.11 I am not having the issue - e.g. everything works with latest git/cred plugins. However there are also only a handful of plugins installed..

          Mark Waite added a comment -

          I don't know why you're seeing that behavior. Are there any other differences you've detected between the working environment and the broken environment?

          Mark Waite added a comment - I don't know why you're seeing that behavior. Are there any other differences you've detected between the working environment and the broken environment?

          The working environment is completely different:

          • far less plugins installed
          • did not upgrade from the 1.xx, but was a fresh 2.x installation
          • far less jobs configured

          I will try to replicate it on a VBox.

          Günter Grodotzki added a comment - The working environment is completely different: far less plugins installed did not upgrade from the 1.xx, but was a fresh 2.x installation far less jobs configured I will try to replicate it on a VBox.

          arnaud lamy added a comment -

          @Gunter For info I can reproduce it with docker image: jenkins:2.7.4

          arnaud lamy added a comment - @Gunter For info I can reproduce it with docker image: jenkins:2.7.4

          Mark Waite added a comment - - edited

          arnaudlamy can you give more details of the steps you take to reproduce the problem with the docker image jenkins:2.7.4? I tried the following steps and was unable to see the issue:

          1. Run docker image jenkins:2.7.4
            docker run --rm -i --dns 8.8.8.8 --publish 9090:8080 -t jenkins:2.7.4
            

            , record the initial login password from the window,

          2. Open web browser to http://localhost:9090/
          3. Paste the initial login password into the web browser
          4. Select the "Install recommended plugins" box, wait for plugins to install
          5. Complete the "Create First Admin User" form with my login information
          6. Click the "Start using Jenkins" button
          7. Click the "Credentials" link on the left side of the screen
          8. Click the "Jenkins" credentials scope to open the Jenkins credentials scope
          9. Click the "Global credentials" link to open the global credentials folder
          10. Click "Add Credentials" to add a credential
          11. Enter my github username and personal access token and save that credential
          12. Create a new freestyle job named "bin"
          13. Use Git as the SCM with the URL https://github.com/MarkEWaite//bin and the credential I previously defined (selected from the pick list)
          14. Run the job and confirm that the username / password credential works for that job as expected

          I did not apply any limiting conditions to the visibility of those credentials. Maybe you had some additional configuration steps that are relevant?

          Mark Waite added a comment - - edited arnaudlamy can you give more details of the steps you take to reproduce the problem with the docker image jenkins:2.7.4? I tried the following steps and was unable to see the issue: Run docker image jenkins:2.7.4 docker run --rm -i --dns 8.8.8.8 --publish 9090:8080 -t jenkins:2.7.4 , record the initial login password from the window, Open web browser to http://localhost:9090/ Paste the initial login password into the web browser Select the "Install recommended plugins" box, wait for plugins to install Complete the "Create First Admin User" form with my login information Click the "Start using Jenkins" button Click the "Credentials" link on the left side of the screen Click the "Jenkins" credentials scope to open the Jenkins credentials scope Click the "Global credentials" link to open the global credentials folder Click "Add Credentials" to add a credential Enter my github username and personal access token and save that credential Create a new freestyle job named "bin" Use Git as the SCM with the URL https://github.com/MarkEWaite//bin and the credential I previously defined (selected from the pick list) Run the job and confirm that the username / password credential works for that job as expected I did not apply any limiting conditions to the visibility of those credentials. Maybe you had some additional configuration steps that are relevant?

          arnaud lamy added a comment - - edited

          Indeed I forgot one important element sorry about that. I provided to my docker an old jenkins folder (1.5.X). Here's my command:

          docker run --user=jenkins -p 8081:8080 -p 50000:50000 -d --name jenkins --restart always -v /home/jenkins/docker_var:/var/jenkins_home jenkins:${VERSION}
          

          Then I follow the procedure and installed recommanded plugin as well. Then I create a new project, select GIT and click on add to create a new credential. Impossible to list them.

          Since then, I installed gitlab auth system plugin and then restarted Jenkins and credentials are listed now !

          arnaud lamy added a comment - - edited Indeed I forgot one important element sorry about that. I provided to my docker an old jenkins folder (1.5.X). Here's my command: docker run --user=jenkins -p 8081:8080 -p 50000:50000 -d --name jenkins --restart always -v /home/jenkins/docker_var:/var/jenkins_home jenkins:${VERSION} Then I follow the procedure and installed recommanded plugin as well. Then I create a new project, select GIT and click on add to create a new credential. Impossible to list them. Since then, I installed gitlab auth system plugin and then restarted Jenkins and credentials are listed now !

          Mark Waite added a comment -

          arnaudlamy it seems that you were able to resolve the issue by updating an unrelated plugin and restarting Jenkins. I thought that lifeofguenter described that a Jenkins restart was not enough to resolve the problem when he saw it. Can you confirm that restarting Jenkins resolves it for you?

          Mark Waite added a comment - arnaudlamy it seems that you were able to resolve the issue by updating an unrelated plugin and restarting Jenkins. I thought that lifeofguenter described that a Jenkins restart was not enough to resolve the problem when he saw it. Can you confirm that restarting Jenkins resolves it for you?

            lifeofguenter Günter Grodotzki
            lifeofguenter Günter Grodotzki
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: