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

using http git url returned status code 128:stderr:remote:unauthorized

    Details

    • Type: Task
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: gerrit-trigger-plugin
    • Labels:
      None
    • Environment:
      windows 10.0.17134 N/A Build 17134
      Jenkins 2.204.3
      git version 2.24.1.windows.2
      Gerrit 3.1.2
    • Similar Issues:

      Description

      I installed git and gerrit and jenkins on the same PC and both gerrit and git works fine.

      Environment:

      windows 10.0.17134 N/A Build 17134
      Jenkins 2.204.3
      git version 2.24.1.windows.2
      Gerrit 3.1.2

      I signed up a new user account which named "jenkins" on gerrit server and added it into non-interactive group . but when I started a new project on jenkins I enconunterred an iusses like below:

      when I try to use http url of git repository ,it always shows like below.I'm sure of using the correct http credential generated for gerrit user and test it for many times .

       

      I use the same http credential on gerrit trigger ,it works fine.

      and when I use these commands to test it manually it works fine too.

       

      Started by user admin
      Running as SYSTEM
      Building in workspace C:\Program Files (x86)\Jenkins\workspace\test
      using credential d408a5f8-d8c6-4d5f-a07b-e378bee5e5bf
      > git.exe rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > git.exe config remote.origin.url http://jenkins@10.120.51.200:10002/a/test # timeout=10
      Fetching upstream changes from http://jenkins@10.120.51.200:10002/a/test
      > git.exe --version # timeout=10
      using GIT_ASKPASS to set credentials 3.22.13:10
      > git.exe fetch --tags --force --progress – http://jenkins@10.120.51.200:10002/a/test +refs/heads/:refs/remotes/origin/ # timeout=10
      ERROR: Error fetching remote repo 'origin'
      hudson.plugins.git.GitException: Failed to fetch from http://jenkins@10.120.51.200:10002/a/test
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:909)
      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1131)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1167)
      at hudson.scm.SCM.checkout(SCM.java:505)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1205)
      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:1853)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:427)
      Caused by: hudson.plugins.git.GitException: Command "git.exe fetch --tags --force --progress – http://jenkins@10.120.51.200:10002/a/test +refs/heads/:refs/remotes/origin/" returned status code 128:
      stdout:
      stderr: remote: Unauthorized
      fatal: Authentication failed for 'http://10.120.51.200:10002/a/test/'

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569)
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:907)
      ... 11 more
      ERROR: Error fetching remote repo 'origin'
      Finished: FAILURE

       

      packets captured through wireshark :

       

      when I use ssh ,it shows like below.I generated ssh key for this user and filled the public key on gerrit server and the private key on the jenkins credential for ssh.

       

      Thanks for your help!

      Best Regards

       

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              sunflower david sun
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: