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

Github polls fails when the Branches to build is different from empty for private repositories

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • github-plugin

      No sure if this is as github-plugin issue or if this plugin is relying on some other git API.

      But for private repositories, when I configure the Branches to build - Branch Specifier to anything that is no empty or ** (ie. refs/heads/) , GitHub Hook Log shows the following error and the jobs does not get triggered:

      Started on 16/10/2015 2:11:40 PM
      Using strategy: Default
      [poll] Last Built Revision: Revision 9d1d66939474b01048ec2cdc8c5cd60b7438606d (origin/develop)
      using .gitcredentials to set credentials
       > git --version # timeout=10
       > git init /var/tmp/hudson979795132853035389tmp # timeout=10
       > git config --local credential.username buildboy2 # timeout=10
       > git config --local credential.helper store --file=/var/tmp/git1493121951203369777.credentials # timeout=10
       > git -c core.askpass=true ls-remote -h http://github.mycompamy.com/myorg/myrepo # timeout=10
       > git config --local --remove-section credential # timeout=10
      FATAL: hudson.plugins.git.GitException: Command "git -c core.askpass=true ls-remote -h http://github.mycompamy.com/myorg/myrepo" returned status code 128:
      stdout: 
      stderr: remote: Repository not found.
      fatal: repository 'http://github.mycompamy.com/myorg/myrepo/' not found
      
      hudson.util.IOException2: hudson.plugins.git.GitException: Command "git -c core.askpass=true ls-remote -h http://github.mycompamy.com/myorg/myrepo" returned status code 128:
      stdout: 
      stderr: remote: Repository not found.
      fatal: repository 'http://github.mycompamy.com/myorg/myrepo/' not found
      
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:529)
      	at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
      	at hudson.scm.SCM.poll(SCM.java:398)
      	at hudson.model.AbstractProject._poll(AbstractProject.java:1454)
      	at hudson.model.AbstractProject.poll(AbstractProject.java:1357)
      	at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:73)
      	at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:99)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	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:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true ls-remote -h http://github.mycompamy.com/myorg/myrepo" returned status code 128:
      stdout: 
      stderr: remote: Repository not found.
      fatal: repository 'http://github.mycompamy.com/myorg/myrepo/' not found
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1282)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1273)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2376)
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:583)
      	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:527)
      	... 13 more
      Done. Took 0.17 sec
      No changes
      

      Note1:
      I have tried all the combination described in the help of Branches to build - Branch Specifier

      refs/heads/*
      refs/heads/master
      origin/master
      origin/*
      master
      

      They all come with the same issues.
      If I leave that empty or I set it to ** this starts to work as expected.

      Note2:
      If I leave the branch speccifier set to refs/head/master and I convert my private repo into a public in github this works fine, no error found and the job is triggered correctly

      Please let me know if you need more information

            integer Kanstantsin Shautsou
            fnaum Federico Naum
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: