jenkinsci / jenkinsci/git-plugin

[JENKINS-68432] Misleading git plugin message when an unsupported credential type is used

Open
#3,723 7 comments 0 reactions 0 assignees View on GitHub
component:git-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

The first stage of the pipeline needs to checkout the source code from a local GitLab.

I created credentials of type "Secret Text" and scope "Global" in Jenkins, with id "gitlab_access_token". Unfortunately, the git plugin does not support "secret text" credentials. It only supports username / password credentials for https repository access and ssh private key credentials for ssh repository access.

The error message that is displayed does not help the user understand that restriction. Either the git plugin should extend its support also allow "secret text" credentials for https repository access or it should provide a better error message that indicates the credential is not supported by the git plugin.

When executing the pipeline I get the following error:

Warning: CredentialId "gitlab_access_token" could not be found.

 

If I change the credentials to "User and Password", the credentials Id does work.

 

The pipeline is defined as follows:

stages {

 stage("Code Checkout from GitLab") {

  steps {

   git branch: 'main',

    credentialsId: 'gitlab_access_token',

 

It is not a blocker as I am still able to use some soft of authentication, but the purpose is to use Personal Access Tokens and not User Credentials, which is impossible due to this error.

I have checked the Internet and other issues, but it does not seem to be the same problem as the ones that I found (sometimes similar, but not equal).

 

I have also tried to use double quotes instead of single quotes for the id.

Also left the input field empty so that the system assigned the id, and still it does not work.

 

As a matter of fact, the credentials-plugin cannot be updated: 


---
Originally reported by danifgx, imported from: Misleading git plugin message when an unsupported credential type is used


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

The first stage of the pipeline needs to checkout the source code from a local GitLab.

I created credentials of type "Secret Text" and scope "Global" in Jenkins, with id "gitlab_access_token". Unfortunately, the git plugin does not support "secret text" credentials. It only supports username / password credentials for https repository access and ssh private key credentials for ssh repository access.

The error message that is displayed does not help the user understand that restriction. Either the git plugin should extend its support also allow "secret text" credentials for https repository access or it should provide a better error message that indicates the credential is not supported by the git plugin.

When executing the pipeline I get the following error:

Warning: CredentialId "gitlab_access_token" could not be found.

 

If I change the credentials to "User and Password", the credentials Id does work.

 

The pipeline is defined as follows:

stages {
 stage("Code Checkout from GitLab") {
  steps {
   git branch: 'main',
    credentialsId: 'gitlab_access_token',

 

It is not a blocker as I am still able to use some soft of authentication, but the purpose is to use Personal Access Tokens and not User Credentials, which is impossible due to this error.

I have checked the Internet and other issues, but it does not seem to be the same problem as the ones that I found (sometimes similar, but not equal).

 

I have also tried to use double quotes instead of single quotes for the id.

Also left the input field empty so that the system assigned the id, and still it does not work.

 

As a matter of fact, the credentials-plugin cannot be updated: 



environment

```
Jenkins Docker Image: jenkins/jenkins:lts-jdk11

Jenkins 2.332.3
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.