jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-72132] GitHub Branch Source w/ GitHub App Authentication fails to auth periodically

Open
#1,428 5 comments 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

 

Periodically, a job will fail with this below issue. 

My approximate timing is that it fails once per hour. And then succeeds after that.


 > git --version # 'git version 2.42.0.windows.2'

using GIT_ASKPASS to set credentials ORG Automation Github App. Should give access to pull repos

 > git.exe fetch --no-tags --force --progress – https://github.com/org/repo.git +refs/pull/17/head:refs/remotes/origin/PR-17 # timeout=10

ERROR: Error cloning remote repo 'origin'

hudson.plugins.git.GitException: Command "git.exe fetch --no-tags --force --progress – https://github.com/org/repo.git +refs/pull/17/head:refs/remotes/origin/PR-17" returned status code 128:

stdout: 

stderr: remote: Invalid username or password.

fatal: Authentication failed for 'https://github.com/org/repo.git/'

 

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:871)

at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1222)

at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)

at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)

at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)

at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)

at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

at java.base/java.lang.Thread.run(Thread.java:833)


The setup for the job is as follows: * Multibranch Pipeline job



  • Github branch source

  • Github App credential

  • Scans repo every 5 minutes.

 

The jobs don't get re-run automatically if they fail due to this. We are in a migration process and are attempting to limit the number of issues and hurdles to ease the transition of a team away from a CVS repo.

---
Originally reported by levi_gutkaes, imported from: GitHub Branch Source w/ GitHub App Authentication fails to auth periodically


  • status: Open
  • priority: Major
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 4
  • watchers: 8
  • imported: 2025-12-02

Raw content of original issue

 
Periodically, a job will fail with this below issue. 
My approximate timing is that it fails once per hour. And then succeeds after that.


 > git --version # 'git version 2.42.0.windows.2'
using GIT_ASKPASS to set credentials ORG Automation Github App. Should give access to pull repos
 > git.exe fetch --no-tags --force --progress – https://github.com/org/repo.git +refs/pull/17/head:refs/remotes/origin/PR-17 # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git.exe fetch --no-tags --force --progress – https://github.com/org/repo.git +refs/pull/17/head:refs/remotes/origin/PR-17" returned status code 128:
stdout: 
stderr: remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/org/repo.git/'
 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:871)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1222)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)


The setup for the job is as follows: * Multibranch Pipeline job



  • Github branch source

  • Github App credential

  • Scans repo every 5 minutes.

 

The jobs don't get re-run automatically if they fail due to this. We are in a migration process and are attempting to limit the number of issues and hurdles to ease the transition of a team away from a CVS repo.

environment

```
Jenkins Verison: 2.414.1

Github Branch Source Plugin: 1741.va_3028eb_9fd21

Pipeline: Multibranch: 756.v891d88f2cd46
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.