• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 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

      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.

          [JENKINS-60349] User credentials not usable by Git plugin

          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.

          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.

          Mark Waite added a comment -

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

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

          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{{}}

           

          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 {{}}  

          iostrym added a comment - - edited

          Hello,

          I have exactly the same problem.

          I'm using folder,authorize_project, credential, git plugin.

          I managed to display "user credential" in git plugin (by configuring "build authorization": run as specific user" => that is what I need).

          but these user credential can't be used in my job because I always have the same error :

          "Warning: CredentialId "XXXX" could not be found."

           

          during job configuration I know that it will fail as I have this error during the credential choice of the git plugin :

          Failed to connect to repository : org.eclipse.jgit.errors.TransportException: https://XXXXXXX.git: not authorized

           

          I have :

          jenkins 2.263.4

          authorize project 1.4.0

          credential plugin 2.6.1.1.

          credential binding 1.27.1

          folders 6.15

          git plugin 4.8.3

          whereas my credential are correct.

           

          credential are working if I configure security job with : "build authorization: run as SYSTEM" => user credential no more appears but this time I can see jenkins scopre credential or folder scope credential. And there are working great.

           

          So I don't understand why user credential can be seen but don't works when "run as specific user" is choosen.

          iostrym added a comment - - edited Hello, I have exactly the same problem. I'm using folder,authorize_project, credential, git plugin. I managed to display "user credential" in git plugin (by configuring "build authorization": run as specific user" => that is what I need). but these user credential can't be used in my job because I always have the same error : "Warning: CredentialId "XXXX" could not be found."   during job configuration I know that it will fail as I have this error during the credential choice of the git plugin : Failed to connect to repository : org.eclipse.jgit.errors.TransportException: https://XXXXXXX.git: not authorized   I have : jenkins 2.263.4 authorize project 1.4.0 credential plugin 2.6.1.1. credential binding 1.27.1 folders 6.15 git plugin 4.8.3 whereas my credential are correct.   credential are working if I configure security job with : "build authorization: run as SYSTEM" => user credential no more appears but this time I can see jenkins scopre credential or folder scope credential. And there are working great.   So I don't understand why user credential can be seen but don't works when "run as specific user" is choosen.

          iostrym added a comment -

          Also I need to add that I use jgit plugin. But it doesn't seems to be linked with this problem as it works great using folder credentials.

          I read somewhere that this should works great (user credential usage + authorize project) so I don't understand why I have this problem, and it seems that we are only two people to have it ...

          iostrym added a comment - Also I need to add that I use jgit plugin. But it doesn't seems to be linked with this problem as it works great using folder credentials. I read somewhere that this should works great (user credential usage + authorize project) so I don't understand why I have this problem, and it seems that we are only two people to have it ...

            Unassigned Unassigned
            robertschulze Robert Schulze
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: