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

Fail to update git repository with stored credential

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.553
      Mac slave
    • Similar Issues:

      Description

      After upgrade to git plugin 2.0.4, git client plugin 1.6.4
      All the jobs with https repository url and using stored credential failed, refer to following log.

      Downgrade to git:2.0.3, git-client 1.6.3, the issue has gone.

      ====================================================
      00:00:00.002 Started by user anonymous
      00:00:00.003 [EnvInject] - Loading node environment variables.
      00:00:00.004 Building on master in workspace xxx
      00:00:00.108 Fetching changes from the remote Git repository
      00:00:00.141 Fetching upstream changes from https://xxx.git
      00:00:01.667 FATAL: Failed to fetch from https://xxx.git
      00:00:01.668 hudson.plugins.git.GitException: Failed to fetch from https://xxxx.git
      00:00:01.669 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:621)
      00:00:01.669 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:853)
      00:00:01.669 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:878)
      00:00:01.669 at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
      00:00:01.669 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:671)
      00:00:01.669 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      00:00:01.669 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
      00:00:01.669 at hudson.model.Run.execute(Run.java:1676)
      00:00:01.669 at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
      00:00:01.669 at hudson.model.ResourceController.execute(ResourceController.java:88)
      00:00:01.669 at hudson.model.Executor.run(Executor.java:231)
      00:00:01.669 at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
      00:00:01.669 Caused by: hudson.plugins.git.GitException: Failed to connect to https://xxxx.git using credentials xxxx (status = 401)
      00:00:01.669 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:1725)
      00:00:01.669 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1030)
      00:00:01.669 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:88)
      00:00:01.669 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:219)
      00:00:01.669 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:619)
      00:00:01.669 ... 11 more

        Attachments

          Issue Links

            Activity

            Hide
            imichka Michka Popoff added a comment -

            I just found this bug report as my credentials stopped working with my private bitbucket repo. Removing the @username from the url fixed it.

            This is quite confusing as this was working before and the behavior of the credentials changed between 1.6.3 and 1.6.4
            If the @username can not be stripped, you could perhaps add a hint in the error message telling the user to try without the @username ?

            Show
            imichka Michka Popoff added a comment - I just found this bug report as my credentials stopped working with my private bitbucket repo. Removing the @username from the url fixed it. This is quite confusing as this was working before and the behavior of the credentials changed between 1.6.3 and 1.6.4 If the @username can not be stripped, you could perhaps add a hint in the error message telling the user to try without the @username ?
            Hide
            javalnanda Javal Nanda added a comment -

            I am facing the same issue not able to connect to repository.
            Git client plugin version is 1.10.2 and git plugin 2.2.5

            I had restored jenkins using thin backup plugin after formatting the mac. Previously everything was working fine but not its not able to connect.

            Show
            javalnanda Javal Nanda added a comment - I am facing the same issue not able to connect to repository. Git client plugin version is 1.10.2 and git plugin 2.2.5 I had restored jenkins using thin backup plugin after formatting the mac. Previously everything was working fine but not its not able to connect.
            Hide
            markewaite Mark Waite added a comment -

            The call to checkCredentials() has been removed in git-client-plugin from 1.13.1 and beyond. Would you be willing to test a pre-release of git-client-plugin 1.13.1 for this case?

            Show
            markewaite Mark Waite added a comment - The call to checkCredentials() has been removed in git-client-plugin from 1.13.1 and beyond. Would you be willing to test a pre-release of git-client-plugin 1.13.1 for this case?
            Hide
            markewaite Mark Waite added a comment -

            The git-client-plugin 1.14.0 release allows me to fetch and push from a private bitbucket repository using command line git.

            Show
            markewaite Mark Waite added a comment - The git-client-plugin 1.14.0 release allows me to fetch and push from a private bitbucket repository using command line git.
            Hide
            markewaite Mark Waite added a comment -

            I thought I had a problem with GitHub private repository access through https until I read the GitHub documentation which states that https access to a private repository must use a personal access token. Once I generated and used a personal access token in the credential, it worked as expected.

            Show
            markewaite Mark Waite added a comment - I thought I had a problem with GitHub private repository access through https until I read the GitHub documentation which states that https access to a private repository must use a personal access token. Once I generated and used a personal access token in the credential, it worked as expected.

              People

              • Assignee:
                ndeloof Nicolas De Loof
                Reporter:
                sushi_k Su Shi
              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: