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

Misleading git plugin message when an unsupported credential type is used

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • Jenkins Docker Image: jenkins/jenkins:lts-jdk11
      Jenkins 2.332.3

      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: 

            Unassigned Unassigned
            danifgx Daniel Fernández Guerrero
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: