Closed
Description
Context
- Gitlab plugin version: 1.3.0
- Gitlab version: 8.10.4
- Jenkins version: 2.7.2
Problem description
When I attempt to add a "GitLab API Token" as a credential under the "Git" section of Source Code Management when configuring a job, after the "Jenkins Credentials Provider: Jenkins" modal closes, I do not see the credential added to the credential dropdown box. Other credential types work fine in terms of populating this dropdown box.
GitLab credentials are added fine under the global Jenkins settings page (/configure), but these are not available in the job configuration git credential dropdown (this could work as a workaround for the first problem if they did).
Activity
krisgraham commentedon Aug 9, 2016
After writing this issue, I was able to resolve the issue by selecting "- none -" for "Credentials" under Git in Source Code Management (even though this causes an immediate "Failed to connect to repository" validation error). This might still qualify as an issue or at least for an update to the README as it was a bit confusing to figure out.
krisgraham commentedon Aug 10, 2016
OK, I think I understand the issue now. We're using two sets of credentials: "GitLab API token" for access to GitLab Webhooks and a separate one for cloning the git repo during builds. Leaving this issue open in case the maintainers want to provide further clarification in case this is not self-evident to other dumbdumbs like me :)
dblessing commentedon Aug 11, 2016
@coder-hugo @omehegan This definitely feels like a bug. What do you think?
dblessing commentedon Aug 11, 2016
Whoops - duplicate of https://issues.jenkins-ci.org/browse/JENKINS-36863
krisgraham commentedon Aug 11, 2016
Yep, that describes the issue I'm having. Thanks for getting back! Closing this issue because it is a duplicate.
samskiter commentedon Aug 31, 2016
Looks like I'm getting this issue still on 1.3.1 - any workarounds?
coder-hugo commentedon Aug 31, 2016
@samskiter Do you have installed the plain-credentials plugin in your Jenkins if not could you please install it and try it again although the absence of this plugin shouldn't cause any trouble with the latest version of the plugin.
samskiter commentedon Aug 31, 2016
@coder-hugo That seemed to fix it yes, thanks!
0xC4N1 commentedon Sep 5, 2016
Actually JENKINS-36863 refers to the credentials dropdown for the global gitlab configuration in jenkins settings which is working fine.
This ticket refers to the credentials dropdown for the git settings in job configuration and it doesn't seem to be fixed even after updating every single component or settings up a new Jenkins. GitLab API Token credentials don't appear there.
coder-hugo commentedon Sep 5, 2016
@4311021x You can't use the GitLab API token for cloning the repository. For this you have to use either a SSH key or a Username/Password combination. Furthermore this dropdown is part of the git-plugin not the gitlab-plugin. So the gitlab-plugin can't tell which credentials are available as credentials for this dropdown.
LongLiveCHIEF commentedon Sep 8, 2016
This should be called out I think in the docs. Right now it's assumed by most that this is what that is for.
krisgraham commentedon Sep 8, 2016
Per comment by @4311021x I'm going to re-open this for resolution or documentation. You're right, I re-read that issue and it refers to the system config, which seems to be working.
johnpbloch commentedon Feb 14, 2017
If you want to use an api token to clone the repository, here's how:
api
scopehttps
address, notssh
csbuild-c7ks7s commentedon Mar 23, 2017
https://issues.jenkins-ci.org/browse/JENKINS-36863 This issue is closed but I am able to reproduce it in 2.19.4 Jenkins w/ Plain Credentials plugin installed trying to setup an ssh key in the github global configuration. Any idea when this might be addressed ?
omehegan commentedon Mar 23, 2017
@csbuild-c7ks7s github? This is the GitLab plugin...
pianyao commentedon Jun 16, 2017
@johnpbloch I found using the password of your gitlab account instead of the token as password with https address actually works.
omehegan commentedon Jan 23, 2018
Clarified in 438e6cc
5452 commentedon Apr 23, 2019
I don't think this is duplicated with the referred. That is in the system configuration, but this is in the job configuration, which is still there.
VGerris commentedon Jun 3, 2020
I wonder why this issue was closed? I still have this issue in a helm deploy of 2.222.4 in GKE. The credentials are not saved in the first place. when added manually under credentials and selected, it seems to not pick up the entry because after saving and reopening the same error shows up:
API Token for Gitlab access required