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

User credentials not usable by Git plugin

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
    • Environment:
      org.jenkins-ci.main:jenkins-war:2.190.3
      org.jenkins-ci.plugins:git:4.0.0
      org.jenkins-ci.plugins:git-client:3.0.0
      org.jenkins-ci.plugins:credentials:2.3.0
    • Similar Issues:

      Description

      While I can select user-level credentials in a job (configured to run as the specified user), I obtain an error "Warning: CredentialId "xyz" could not be found." when trying to run the job.

      Can you tell me which additional information you need?

      I believe the problem should be with com.cloudbees.plugins.credentials.CredentialsMatchers as used in hudson.plugins.git.gitSCM.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Can you provide guidance on how to confirm that the credential can be used after I attached it to my Jenkins user account from my user name drop down like this:

          That dropdown allowed me to add a new GitHub personal access token to my Jenkins server, but then I am unable to see it in other contexts.

          Show
          markewaite Mark Waite added a comment - Can you provide guidance on how to confirm that the credential can be used after I attached it to my Jenkins user account from my user name drop down like this: That dropdown allowed me to add a new GitHub personal access token to my Jenkins server, but then I am unable to see it in other contexts.
          Hide
          markewaite Mark Waite added a comment -

          Robert Schulze I can't do anything further on this without your answers to my questions.

          Show
          markewaite Mark Waite added a comment - Robert Schulze I can't do anything further on this without your answers to my questions.
          Hide
          robertschulze Robert Schulze added a comment -

          Sorry for the delay. Here are the details:

          When I configure the job without build authentication

          I can select global credentials and also successfully build with them:

           

          However, when I configure the job to run as my own user

          and I want to use the credential from my user 

           

          I am able to select it in the configuration screen but already an error appears (the password is absolutely correct, double-checked multiple times)

          and when I try to run the job, it runs on error since the credentials cannot be retrieved 

          Full console log:

          {{ Console Output}}Started by user Robert Schulze (User)Running as Robert Schulze (User)[EnvInject] - Loading node environment variables.Building on master in workspace c:\Portable\Jenkins\workspace\robTest2Warning: CredentialId "t879702_Gitea_Login" could not be found.> C:\Portable\PortableGit\bin\git.exe rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository> C:\Portable\PortableGit\bin\git.exe config remote.origin.url [+http://g13p020y:3000/backend/autoBackup.git+] # timeout=10Fetching upstream changes from [+http://g13p020y:3000/backend/autoBackup.git+]> C:\Portable\PortableGit\bin\git.exe --version # timeout=10> C:\Portable\PortableGit\bin\git.exe fetch --tags --force --progress – [+http://g13p020y:3000/backend/autoBackup.git+] +refs/heads/:refs/remotes/origin/ # timeout=10ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException: Failed to fetch from [+http://g13p020y:3000/backend/autoBackup.git+]        at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:899)        at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1114)        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1145)        at hudson.scm.SCM.checkout(SCM.java:504)        at hudson.model.AbstractProject.checkout(AbstractProject.java:1209)        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)        at hudson.model.Run.execute(Run.java:1816)        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)        at hudson.model.ResourceController.execute(ResourceController.java:97)        at hudson.model.Executor.run(Executor.java:429)Caused by: hudson.plugins.git.GitException: Command "C:\Portable\PortableGit\bin\git.exe fetch --tags --force --progress – [+http://g13p020y:3000/backend/autoBackup.git+] +refs/heads/:refs/remotes/origin/" returned status code 128:stdout:stderr: remote: invalid credentialsfatal: Authentication failed for '[+http://g13p020y:3000/backend/autoBackup.git/+]'         at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1985)        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:563)        at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:897)        ... 11 moreERROR: Error fetching remote repo 'origin'Finished: FAILURE{{}}

           

          Show
          robertschulze Robert Schulze added a comment - Sorry for the delay. Here are the details: When I configure the job without build authentication I can select global credentials and also successfully build with them:   However, when I configure the job to run as my own user and I want to use the credential from my user    I am able to select it in the configuration screen but already an error appears (the password is absolutely correct, double-checked multiple times) and when I try to run the job, it runs on error since the credentials cannot be retrieved  Full console log: {{ Console Output }} Started by user Robert Schulze (User) Running as Robert Schulze (User) [EnvInject] - Loading node environment variables. Building on master in workspace c:\Portable\Jenkins\workspace\robTest2 Warning: CredentialId "t879702_Gitea_Login" could not be found. > C:\Portable\PortableGit\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > C:\Portable\PortableGit\bin\git.exe config remote.origin.url [+http://g13p020y:3000/backend/autoBackup.git+] # timeout=10 Fetching upstream changes from [+http://g13p020y:3000/backend/autoBackup.git+] > C:\Portable\PortableGit\bin\git.exe --version # timeout=10 > C:\Portable\PortableGit\bin\git.exe fetch --tags --force --progress – [+http://g13p020y:3000/backend/autoBackup.git+] +refs/heads/ :refs/remotes/origin/ # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from [+http://g13p020y:3000/backend/autoBackup.git+]         at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:899)         at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1114)         at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1145)         at hudson.scm.SCM.checkout(SCM.java:504)         at hudson.model.AbstractProject.checkout(AbstractProject.java:1209)         at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)         at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)         at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)         at hudson.model.Run.execute(Run.java:1816)         at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)         at hudson.model.ResourceController.execute(ResourceController.java:97)         at hudson.model.Executor.run(Executor.java:429) Caused by: hudson.plugins.git.GitException: Command "C:\Portable\PortableGit\bin\git.exe fetch --tags --force --progress – [+http://g13p020y:3000/backend/autoBackup.git+] +refs/heads/ :refs/remotes/origin/ " returned status code 128: stdout: stderr: remote: invalid credentials fatal: Authentication failed for ' [+http://g13p020y:3000/backend/autoBackup.git/+] '           at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)         at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1985)         at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)         at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:563)         at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:897)         ... 11 more ERROR: Error fetching remote repo 'origin' Finished: FAILURE {{}}  

            People

            • Assignee:
              Unassigned
              Reporter:
              robertschulze Robert Schulze
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: