gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

No API token can be selected

Open Urban123 opened this issue 10 years ago • 30 comments

Gitlab plugin version: 1.2.5 Gitlab version: 8.8.1 Jenkins version: 1.648

I also setup loggin to more detail, but nothing relevant is logged. I followed the documentation, created a user in gitlab, added its API key to a credentials storage as Gitlab API token. But when I want to select it in Global settings and paths, I can't select anything. Dropdown menu shows only none.

image

Urban123 avatar Jul 01 '16 10:07 Urban123

When you set up the credential, what type did you specify? It should be "GitLab API Token."

omehegan avatar Jul 01 '16 16:07 omehegan

There was the same Problem This was resolved successfully upgrade Jenkins 1.648 to Jenkins 2.x

kranian avatar Jul 03 '16 07:07 kranian

The credential was specified as GitLab API Token. image

@kranian OK, thanks for the info. I have upgraded to the latest LTS version 1.651.3, but still the credentials isn't show. Does this work only on Jenkins 2.x?

Urban123 avatar Jul 03 '16 19:07 Urban123

No , I did the same with the lastest 1.651.3 , I seem to be not supported lastest 1.651.3 so I tried to upgrade to LTS Jenkis2.11 image

kranian avatar Jul 04 '16 23:07 kranian

Same issue here on 1.649, Any chance this can be made to work on 1.x for now ?

major version upgrades require a lot of testing ...

jeantil avatar Jul 05 '16 10:07 jeantil

I was worried Manager version upgrade. but After checking in at the official website as Jekins 2.x support backwards compatibility plugin.

kranian avatar Jul 05 '16 10:07 kranian

I just updated the Jenkins war to the latest 2.11 version, but it still doesn't work, so I guess the problem is elsewhere. Because I have also a docker version of Jenkins 2.3 which is works OK. Does anyone have any idea, what could it be?

Urban123 avatar Jul 05 '16 11:07 Urban123

Oh, I see, I think you need another solution

kranian avatar Jul 05 '16 11:07 kranian

The issue can be closed. The plugin is working on 2.x release, I uninstalled the plugin, restarted the system and again installed the plugin and it started working.

Urban123 avatar Jul 06 '16 07:07 Urban123

@coder-hugo can you clarify the compatibility target for gitlab-plugin ? using

  • plugin 1.2.5
  • jenkins 1.649
  • GitLab Community Edition 8.9.0 0d457d8

I can't select gitlab token credentials and therefore can't connect my jenkins to gitlab. I have the token with gitlab token type capture d ecran 2016-07-07 a 09 00 38 but I can't select them capture d ecran 2016-07-07 a 09 01 59

Since i don't administer the jenkins instance myself, I'd like to know what to request :

  • upgrade to 1.651.3 (might be considered by the admins)
  • upgrade to 2. x (which means I'm out of luck)

Thanks

jeantil avatar Jul 07 '16 07:07 jeantil

@jeantil during the development the gitlab-plugin runs in a Jenkins 1.609.3 and I can select a API token. So I'd assume there is an issue with the installed version of the credentials-plugin not with the version of the Jenkins itself.

coder-hugo avatar Jul 07 '16 15:07 coder-hugo

@coder-hugo do we need to update the plugin's pom.xml to require a certain version of the credentials-plugin?

omehegan avatar Jul 07 '16 17:07 omehegan

@coder-hugo thanks for your answer. Which version of the credentials plugin should we be using ? The one installed at the moment is 2.1.4 and as far as I can tell it's the latest one.

jeantil avatar Jul 08 '16 12:07 jeantil

@jeantil I just tested the plugin with a clean installation of Jenkins 1.649 and the credentials plugin 2.1.4 and I have no issues selecting the credentials. So the issue seems to be related to your Jenkins installation/configuration.

coder-hugo avatar Jul 09 '16 12:07 coder-hugo

we're seeing the same issue, unable to select any credentials from the dropdown (even after a clean reinstall of the plugin). jenkins 2.13 plugin 1.3.0

paulatbipsync avatar Jul 12 '16 10:07 paulatbipsync

@jeantil @paulatbipsync could you please check if the issue still exists with the current master? Either by building it with mvn clean package or by downloading it from the cloudbees Jenkins: gitlab-plugin-1.3.1-SNAPSHOT.hpi. I did a minor change (8da0bf2945d816778481c30ffd91a372b45fbb21) in the code that retrieve the available credentials but I'm not sure if this solves your issue as I can't reproduce it.

coder-hugo avatar Jul 12 '16 19:07 coder-hugo

@coder-hugo Just tested the snapshot release you mentioned, but no luck. I'm experiencing this issue on jenkins 2.7.1 with plugin 1.3.0 + 1.3.1snapshot

ghost avatar Jul 13 '16 09:07 ghost

I have the same issue with Jenkins 1.651, GitLab plugin 1.3.0, Credentials plugin 2.1.4.

The problem is that the URL

http://jenkins/descriptorByName/com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig/fillApiTokenIdItems

returns this:

{"values":[{"name":"- none -","selected":false,"value":""}]}

And nothing in the logs.

I was able to work around this with this trick:

  • Go to Credentials, create your GitLab API Token, and set the specific ID (e.g., "jenkins-to-gitlab").
  • On the Configure page, enable browser devtools (Cmd+Opt+I in Chrome), locate the <select> tag for this token field, expand it, find the <option> tag for "-none-" pseudo-token (the only <opton> tag there).
  • Replace its value & its text with "jenkins-to-gitlab" (the token id from the 1st step).
  • Save/apply the configuration.
  • Click the Test Connection button — it works (see "Success" message).

When you will be changing the configuration again, leave it as "-current-".

nolar avatar Jul 13 '16 10:07 nolar

I have also the issue with GitLab Plugin : 1.3.0
Credentials Plugin : 2.1.4 Jenkins : 1.651.3

TangiNokia avatar Jul 13 '16 12:07 TangiNokia

I have the same issue with

Jenkins 2.7.1 GitLab Plugin 1.3.0 Credentials Plugin: 2.1.4

lucibranc avatar Jul 26 '16 07:07 lucibranc