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

[Gitlab plugin] Credentials drop-down doesn't show API token credential!

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • gitlab-plugin
    • Gitlab Plugin 1.3.0. Jenkins 2.7.1 hosted on Windows 7 64-bit, Java 1.8 64-bit. Client is Chrome 51 on Windows 10

      On Manage Jenkins -> Configure System, in the Gitlab section, there's a Credentials section that had a drop-down list where I should be able to specify an API Token. The drop down says "-none" and has no other options. If I choose Add -> Jenkins, then under Kind I can select "GitLab API token" and put in the info, and click Add. But the credential I've added does not show up in the drop-down, so I can't select it, and I have the red "API Token for Gitlab access required" message.

      I expect to be able to see the API token credential I have added in the drop-down list so I can select it and connect. But it is not there.

      As a result I am unable to use the plugin at all.

        1. 123.png
          123.png
          8 kB
        2. 1234.png
          1234.png
          30 kB
        3. abc.png
          abc.png
          93 kB
        4. jenkins-gitlab-api-token-bug.png
          jenkins-gitlab-api-token-bug.png
          100 kB
        5. support_2016-08-03_03.23.23.zip
          110 kB

          [JENKINS-36863] [Gitlab plugin] Credentials drop-down doesn't show API token credential!

          Robin Müller added a comment -

          There was already an issue for this on GitHub but unfortunately I can't reproduce it. So may I ask you for installing the following plugin: Support Core Plugin in your Jenkins and generate a support bundle. This will generate a Dockerfile that can be used to generate a docker image that should contain a Jenkins with a similar setup to yours. Maybe this helps to identify the cause for this issue.

          Robin Müller added a comment - There was already an issue for this on GitHub but unfortunately I can't reproduce it. So may I ask you for installing the following plugin: Support Core Plugin in your Jenkins and generate a support bundle. This will generate a Dockerfile that can be used to generate a docker image that should contain a Jenkins with a similar setup to yours. Maybe this helps to identify the cause for this issue.

          Alex Chapman added a comment -

          I'm having the same issue. Attaching support bundle and screenshot: support_2016-08-03_03.23.23.zip

          Alex Chapman added a comment - I'm having the same issue. Attaching support bundle and screenshot: support_2016-08-03_03.23.23.zip

          I'm hitting the same issue on Jenkins v1.651.2 with the Gitlab plugin v1.3.0. I did create a Credential of type "GitLab API token" prior to creating the connection.

          Antoine Cotten added a comment - I'm hitting the same issue on Jenkins v1.651.2 with the Gitlab plugin v1.3.0. I did create a Credential of type "GitLab API token" prior to creating the connection.

          Tobias W. added a comment -

          Having the same issue on Jenkins 2.11 with version 1.3.0 of the Gitlab plugin. Credentials do not show up in the dropdown, no matter if they are created separately or on the fly during plugin configuration.

          Tobias W. added a comment - Having the same issue on Jenkins 2.11 with version 1.3.0 of the Gitlab plugin. Credentials do not show up in the dropdown, no matter if they are created separately or on the fly during plugin configuration.

          Mark Parker added a comment -

          Having the same issue as well. Jenkins 2.7 and Gitlab 1.3.0 AND Jenkins 1.651.3 and Gitlab 1.3.0.

          The token appears to get created, because when I try to create another token with the same name, it tells me "This ID already in use"

          Mark Parker added a comment - Having the same issue as well. Jenkins 2.7 and Gitlab 1.3.0 AND Jenkins 1.651.3 and Gitlab 1.3.0. The token appears to get created, because when I try to create another token with the same name, it tells me "This ID already in use"

          Drew Blessing added a comment -

          I can reproduce on a Mac, Jenkins version 1.651.2 brand new install, in Chrome, Firefox and Safari.

          Drew Blessing added a comment - I can reproduce on a Mac, Jenkins version 1.651.2 brand new install, in Chrome, Firefox and Safari.

          +1 on Jenkins 2.7 with Gitlab plugin v1.3.0. I've tried all types of credentials, and none of them save.

          Brian Vanderbusch added a comment - +1 on Jenkins 2.7 with Gitlab plugin v1.3.0. I've tried all types of credentials, and none of them save.

          So after spending some time digging around with the plugin's home page on the jenkins wiki, I went through the list of dependencies, and realized I was using credentials v1.28, instead of 2.1+. After installing credentials pluging v2.1.4 this issue resolved.

          Brian Vanderbusch added a comment - So after spending some time digging around with the plugin's home page on the jenkins wiki, I went through the list of dependencies, and realized I was using credentials v1.28, instead of 2.1+. After installing credentials pluging v2.1.4 this issue resolved.

          Robin COLLAS added a comment - - edited

          Same problem... Jenkins 2.17, Gitlab plugin 1.3.0 and Credentials Plugin 2.1.4.
          All my plugins are up to date. I tryed to reinstall the Gitlab plugin and changed the version of the Credentials plugin but nothing has changed.

          Robin COLLAS added a comment - - edited Same problem... Jenkins 2.17, Gitlab plugin 1.3.0 and Credentials Plugin 2.1.4. All my plugins are up to date. I tryed to reinstall the Gitlab plugin and changed the version of the Credentials plugin but nothing has changed.

          Tyrel Haveman added a comment -

          My plugins are up-to-date as well. Now using Jenkins 2.7.2, GitLab Plugin 1.3.0, and Credentials Plugin 2.1.4, and no API tokens show up in the drop-down.

          Tyrel Haveman added a comment - My plugins are up-to-date as well. Now using Jenkins 2.7.2, GitLab Plugin 1.3.0, and Credentials Plugin 2.1.4, and no API tokens show up in the drop-down.

          I have Credentials 2.1.4, Jenkins 2.17, Gitlab 1.3.0 and it was not working like everyone else. Then i looked at https://github.com/jenkinsci/gitlab-plugin/blob/master/pom.xml and noticed a dependency for Plain Credentials, so I installed Plain Credentials 1.2 and API token shows up in drowpdown after Jenkins restart. Hope this helps someone.

          joseph passavanti added a comment - I have Credentials 2.1.4, Jenkins 2.17, Gitlab 1.3.0 and it was not working like everyone else. Then i looked at https://github.com/jenkinsci/gitlab-plugin/blob/master/pom.xml and noticed a dependency for Plain Credentials, so I installed Plain Credentials 1.2 and API token shows up in drowpdown after Jenkins restart. Hope this helps someone.

          Robin COLLAS added a comment -

          I have installed Plain Credentiles Plugin and now it's work. Thank you for your help gottaloveit !

          Robin COLLAS added a comment - I have installed Plain Credentiles Plugin and now it's work. Thank you for your help gottaloveit !

          Tyrel Haveman added a comment -

          I, the author of this Issue, have also found that adding the Plain Credentials Plugin solves my issue.

          Jenkins Developers: I don't know if there's a way for a plugin to require another plugin to be installed as a dependency, but if so, please add Plain Credentials Plugin as a dependency of the Gitlab plugin. I would consider that a resolution to this issue. If that is not possible, I would love to hear your alternative ideas.

          Thanks to gottaloveit for figuring this out!

          Tyrel Haveman added a comment - I, the author of this Issue, have also found that adding the Plain Credentials Plugin solves my issue. Jenkins Developers: I don't know if there's a way for a plugin to require another plugin to be installed as a dependency, but if so, please add Plain Credentials Plugin as a dependency of the Gitlab plugin. I would consider that a resolution to this issue. If that is not possible, I would love to hear your alternative ideas. Thanks to gottaloveit for figuring this out!

          Robin Müller added a comment -

          Hi tyrelh,

          the plain-credentials plugin won't be installed automatically as this was marked as optional dependency with version 1.2.4. The plugin shouldn't require the plain-credentials anymore. The dependency is just there for backward compatibility. And an error within the backward compatibility code causes this bug. I fixed it by the following commit. So with the next release the plain-credentials plugin will be really an optional dependency.

          Robin Müller added a comment - Hi tyrelh , the plain-credentials plugin won't be installed automatically as this was marked as optional dependency with version 1.2.4. The plugin shouldn't require the plain-credentials anymore. The dependency is just there for backward compatibility. And an error within the backward compatibility code causes this bug. I fixed it by the following commit . So with the next release the plain-credentials plugin will be really an optional dependency.

          Robin Müller added a comment -

          Fixed in version 1.3.1.

          Robin Müller added a comment - Fixed in version 1.3.1.

          Marslo Jiao added a comment - - edited

          Well, issue reproduced again in my environment.

          • Jenkins: 2.19.3 LTS
          • GitLab Plugin: 1.4.3
          • Credentials Plugin: 1.10
          • Plain Credentials Plugin: 1.3
          • Credentials shows current, and connect is failed.
          • Click Add button, and add a new credential
          • Credentials drop-list still CANNOT show the new item, but actually, the new credential has added successfully.

          Marslo Jiao added a comment - - edited Well, issue reproduced again in my environment. Jenkins: 2.19.3 LTS GitLab Plugin: 1.4.3 Credentials Plugin: 1.10 Plain Credentials Plugin: 1.3 Credentials shows current , and connect is failed. Click Add button, and add a new credential Credentials drop-list still CANNOT show the new item, but actually, the new credential has added successfully.

          After I updated jenkins to 2.46.3, I have the same problem.

          In system configure, I will have to reload the browser several times before the dropdown box show any options. However, I did not get it to show anything in the project configure.

           

          Here are my plugins:

          CloudBees Credentials Plugin          v 3.3

          Credentials Plugin                             v 2.1.13

          Plain Credentials Plugin                    v 1.4

          SSH Credentials Plugin                     v 1.13

          sokunrotanak ssrey added a comment - After I updated jenkins to 2.46.3, I have the same problem. In system configure, I will have to reload the browser several times before the dropdown box show any options. However, I did not get it to show anything in the project configure.   Here are my plugins: -  CloudBees Credentials Plugin           v 3.3 -  Credentials Plugin                              v 2.1.13 -  Plain Credentials Plugin                     v 1.4 -  SSH Credentials Plugin                      v 1.13

          nikesh s added a comment - - edited

          It's not a bug. It was willingly excluded from the dropdown list. These credentials won't be any way used in the connection.

          You should define it in the GitLab connection dropdown.

          you can have a look at Gitlab plugin documentations

          nikesh s added a comment - - edited It's not a bug. It was willingly excluded from the dropdown list. These credentials won't be any way used in the connection. You should define it in the GitLab connection dropdown. you can have a look at Gitlab plugin documentations

          Why was this closed? I still have this issue with Jenkins 2.222.4 installed with Helm on GKE. It looks like the credentials are not stored, which is a bug I think. Another bug would be that these credentials would not be used, which I think is incorrect, because they seem to be used for fetching status ( and are different from the git credentials).
          Please reopen this 

          Vincent Gerris added a comment - Why was this closed? I still have this issue with Jenkins 2.222.4 installed with Helm on GKE. It looks like the credentials are not stored, which is a bug I think. Another bug would be that these credentials would not be used, which I think is incorrect, because they seem to be used for fetching status ( and are different from the git credentials). Please reopen this 

          George Beliy added a comment -

          I still have this issue with Jenkins 2.249.2.
          GitLab credentials are added fine under the global Jenkins settings page (/configure), but these are not available in the job configuration git credential dropdown

          Here are my plugins:

          • Credentials Plugin v 2.3.13
          • Plain Credentials Plugin v 1.7
          • SSH Credentials Plugin v 1.18.1
          • GitLab Plugin v 1.5.13

          George Beliy added a comment - I still have this issue with Jenkins 2.249.2. GitLab credentials are added fine under the global Jenkins settings page (/configure), but these are not available in the job configuration git credential dropdown Here are my plugins: Credentials Plugin v 2.3.13 Plain Credentials Plugin v 1.7 SSH Credentials Plugin v 1.18.1 GitLab Plugin v 1.5.13

          Hi, I had this issue before with an older version but it works for me now on 2.249.2 on 2 different instances.
          Make sure all plugins are updated and that the jenkins server is restarted.
          Perhaps try to see if you have the same issue with secrets.
          I use that too and maybe that flipped a bit that made it work.
          In the end I don't know exactly what resolved my issue, but it works fine now with both secrets and gitlab credentials stored in jenkins global.

          Vincent Gerris added a comment - Hi, I had this issue before with an older version but it works for me now on 2.249.2 on 2 different instances. Make sure all plugins are updated and that the jenkins server is restarted. Perhaps try to see if you have the same issue with secrets. I use that too and maybe that flipped a bit that made it work. In the end I don't know exactly what resolved my issue, but it works fine now with both secrets and gitlab credentials stored in jenkins global.

          Oliver added a comment -

          When creating the credential, ensure that the "Kind" field is set to "GitLab Personal Access Token".

          If you leave it as the default "username with password" (as shown in 1234.png above), that type of credential won't be selectable in the "API Token for accessing Gitlab" dropdown.

          Oliver added a comment - When creating the credential, ensure that the "Kind" field is set to "GitLab Personal Access Token". If you leave it as the default "username with password" (as shown in 1234.png above), that type of credential won't be selectable in the "API Token for accessing Gitlab" dropdown.

            coderhugo Robin Müller
            tyrelh Tyrel Haveman
            Votes:
            5 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: