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

SCM polling is failing with Authentication error with Scripted Pipeline

XMLWordPrintable

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

      I've set up a pipeline project that is configured with "Pipeline script from SCM".
      The Poll SCM scheduled is set to each minute. 

      The repo that contains the Jenkinsfile is different than the repo that contains the code. 

      In this case, the SCM polling failing with Authentication error.

       

      Below are the details from Poll Log

       

      ERROR: polling failed in /var/lib/jenkins/workspace/<jenkins_job_name>@script on 
      hudson.plugins.git.GitException: Command "git ls-remote -h <my_jenkinsfile_repo_url>" returned status code 128:
      stdout: 
      stderr: remote: HTTP Basic: Access denied
      fatal: Authentication failed for '<my_jenkinsfile_repo_url>'
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2038)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1757)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1662)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1653)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2820)
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:698)
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:657)
      Caused: java.io.IOException
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:659)
      	at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:629)
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:603)
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:649)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Using strategy: Default
      [poll] Last Built Revision: Revision <revision> (<branchname>
       > git --version # timeout=10
       > git ls-remote -h <my_code_repo_url> # timeout=10
      ERROR: polling failed in /data/jenkins/workspace/workspace/<jenkins_job_name> on <my_jenkins_agent>
      hudson.plugins.git.GitException: Command "git ls-remote -h <my_code_repo_url> " returned status code 128:
      stdout: 
      stderr: remote: HTTP Basic: Access denied
      fatal: Authentication failed for '<my_code_repo_url> 
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2038)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1757)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1662)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1653)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2820)
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:698)
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:657)
      Caused: java.io.IOException
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:659)
      	at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:629)
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:603)
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:649)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Using strategy: Default
      

       

            markewaite Mark Waite
            rajeshhereforyou Raj G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: