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

Git plugin does not use saved Personal Access Token

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • git-plugin
    • None

      While running a pipeline with project hosted in Github, the jenkins fetches the project 3 times. The first two times, git fetch works by setting token correctly. 

       

      The token is not used while fetching the same project third time. 

       
      23:22:15.941084 http.c:725              == Info: Connection #0 to host github.com left intact
      remote: Support for password authentication was removed on August 13, 2021.
      remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
      fatal: Authentication failed for 'https://github.com/TijoT/FlaskCI/'
      23:22:15.944214 trace.c:411             performance: 0.543623770 s: git command: /usr/lib/git-core/git remote-https https://github.com/TijoT/FlaskCI https://github.com/TijoT/FlaskCI
      23:22:15.944799 trace.c:411             performance: 0.552564867 s: git command: git fetch --tags --force --progress – https://github.com/TijoT/FlaskCI '+refs/heads/:refs/remotes/origin/'
       
      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2846)
      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)
      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
      at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:995)
      ... 12 more

          [JENKINS-73862] Git plugin does not use saved Personal Access Token

          Mark Waite added a comment -

          Thanks for reporting the issue. I can't duplicate the problem as described. You'll need to provide more details so that others can duplicate the problem. Please provide the details as recommended in "How to report an issue".

          What is the job configuration when authentication is not used?

          What is the Pipeline definition when authentication is not used?

          Is the job from an organization folder, from a multibranch Pipeline, from a single Pipeline, or from some other definition?

          If the job is from an organization folder or multibranch Pipeline, which branch source plugin is being used?

          Mark Waite added a comment - Thanks for reporting the issue. I can't duplicate the problem as described. You'll need to provide more details so that others can duplicate the problem. Please provide the details as recommended in "How to report an issue" . What is the job configuration when authentication is not used? What is the Pipeline definition when authentication is not used? Is the job from an organization folder, from a multibranch Pipeline, from a single Pipeline, or from some other definition? If the job is from an organization folder or multibranch Pipeline, which branch source plugin is being used?

          Tijo added a comment -

          The problem occurred due to missing `credentialsId` in JenkinsFile, although the credential (i.e Personal Access Token) was defined in the Pipeline in Jenkins server. 

          Below thread helped me in finding solution

          https://stackoverflow.com/questions/69162212/no-credentials-specified-fetching-changes-from-the-remote-git

           

          Tijo added a comment - The problem occurred due to missing `credentialsId` in JenkinsFile, although the credential (i.e Personal Access Token) was defined in the Pipeline in Jenkins server.  Below thread helped me in finding solution https://stackoverflow.com/questions/69162212/no-credentials-specified-fetching-changes-from-the-remote-git  

            Unassigned Unassigned
            tijo_t Tijo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: