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!

          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: