# Intermittent failures connecting to GitHub

**URL:** https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487
**Category:** Ask a question
**Tags:** question
**Created:** [October 31, 2023, 10:35pm UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487 "2023-10-31T22:35:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ian\_W](https://avatars.discourse-cdn.com/v4/letter/i/cab0a1/32.png) [@Ian\_W](https://community.jenkins.io/u/Ian_W)
#### Post date: [October 31, 2023, 10:35pm UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487/1 "2023-10-31T22:35:09Z")

</div>

Our Jenkins (stand-alone) instance is located behind a firewall. We connect to a variety Git repository hosts, including on-prem TFS and GitHub. Our GitHub repos are internal/private to the Enterprise.

On occasion, certain freestyle jobs which have run fine in the past suddenly fail very quickly on the Git checkout step with `

` stderr: remote: Repository not found`

Rerunning the job (dispatched to the same node) with no changes usually results in subsequent success. Unfortunately the logs do not shed much light on what the error may be.

Admittedly, the occurrence is low, approximately 1% of the total, but 0.25% if you treat the repeated failures as a single interval. But when it comes up, it’s annoying!

Any suggestion on how/where to enable more detailed logging to trace the root of the problem?

```auto
[EnvInject] - Loading node environment variables.
Building remotely on LNX_A (linux) in workspace /work/MyJob/BAU
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/myorg/myrepo.git # timeout=10
Fetching upstream changes from https://github.com/myorg/myrepo.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials GitHub service account using token created with myorggithubbot account
Setting http proxy: pac.myorg.com:8080
 > git fetch --tags --progress https://github.com/myorg/myrepo.git +refs/heads/*:refs/remotes/origin/* --depth=1 # timeout=45
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/myorg/myrepo.git
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:888)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1155)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
	at hudson.scm.SCM.checkout(SCM.java:504)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
	at hudson.model.Run.execute(Run.java:1794)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/myorg/myrepo.git +refs/heads/*:refs/remotes/origin/* --depth=1" returned status code 128:
stdout: 
stderr: remote: Repository not found.
fatal: repository 'https://github.com/myorg/myrepo.git/' not found

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2002)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1721)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	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:750)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to LNX_A
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
		at sun.reflect.GeneratedMethodAccessor377.invoke(Unknown Source)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.lang.reflect.Method.invoke(Method.java:498)
		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
		at com.sun.proxy.$Proxy86.execute(Unknown Source)
		at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:886)
		at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1155)
		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
		at hudson.scm.SCM.checkout(SCM.java:504)
		at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
		at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
		at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
		at hudson.model.Run.execute(Run.java:1794)
		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
		at hudson.model.ResourceController.execute(ResourceController.java:97)
		at hudson.model.Executor.run(Executor.java:429)
ERROR: Error fetching remote repo 'origin'

```

---

<div class="post-metadata">

### Author: ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)
#### Post date: [November 1, 2023, 1:44am UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487/2 "2023-11-01T01:44:43Z")

</div>

Since the GitHub server is inside your firewall, I think that you’ll need to review logs from the GitHub server at the time of the failure. The `remote` message means that the remote server returned that message. There is probably a log file written somewhere that explains why the repository was temporarily not found.

---

<div class="post-metadata">

### Author: ![Ian\_W](https://avatars.discourse-cdn.com/v4/letter/i/cab0a1/32.png) [@Ian\_W](https://community.jenkins.io/u/Ian_W)
#### Post date: [November 1, 2023, 4:48am UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487/3 "2023-11-01T04:48:47Z")

</div>

Thanks for the response, @MarkEWaite.

To clarify though, Jenkins and TFS are on-prem behind the firewall, but GitHub is [github.com](https://github.com/), aka Enterprise Cloud, with Enterprise license, and our repos set to [Internal / Private](https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility#about-repository-visibility-changes) (ie: not Public). (GitHub also calls their on-prem variant Enterprise Server).

Connectivity works 99+% of the time, so it’s not a typical “configuration problem.” A previously working job will just fail for a bit then work again, unchanged.

The question whether there is some debugging we can enable to verbose logging of the git plugin within Jenkins or pass the `GIT_TRACE` flags to `git` so we can get some insight into what’s actually happening, what’s causing the `status code 128`

---

<div class="post-metadata">

### Author: ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)
#### Post date: [November 1, 2023, 12:33pm UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487/4 "2023-11-01T12:33:57Z")

</div>

> [@Ian\_W](#):
>
> The question whether there is some debugging we can enable to verbose logging of the git plugin within Jenkins or pass the `GIT_TRACE` flags to `git` so we can get some insight into what’s actually happening, what’s causing the `status code 128`

Since the message is coming from the remote side ([github.com](http://github.com)), I think that additional tracing on the agent side (inside Jenkins) is unlikely to provide the additional details that you hope. However, there is an article that describes how to enable git tracing for a Jenkins job.

> **[How to trace git connections?](https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-controllers/how-to-trace-git-connections)**
>
> Command line git debug output can be enabled with environment variables:

---

<div class="post-metadata">

### Author: ![0k00l](https://avatars.discourse-cdn.com/v4/letter/0/e95f7d/32.png) [@0k00l](https://community.jenkins.io/u/0k00l)
#### Post date: [April 27, 2026, 9:36am UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487/5 "2026-04-27T09:36:08Z")

</div>

Maybe simultaneous builds can cause that?  
I’ve noticed that when jenkins runs a job via Jenkinsfile that is using git checkout with credentials, second job - which is using same credentials - **cause: jenkins stderr: remote: Repository not found.**

Maybe Jenkins locks credentials when Jenkinsfile is used?

It happens on version is 2.528.3

---

<div class="post-metadata">

### Author: ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)
#### Post date: [April 27, 2026, 7:24pm UTC](https://community.jenkins.io/t/intermittent-failures-connecting-to-github/10487/6 "2026-04-27T19:24:19Z")

</div>

> [@0k00l](#):
>
> second job - which is using same credentials - **cause: jenkins stderr: remote: Repository not found.**

The “stderr: remote: repository not found” is a message from command line git. Command line git on the agent made a request to the git server. The git server replied that the repository did not exist. The git server did not reply that the credential was invalid or was not provided.

I suspect that the git server was overloaded and unable to process the request.

> [@0k00l](#):
>
> Maybe Jenkins locks credentials when Jenkinsfile is used?

Jenkins does not lock credentials when a Jenkinsfile is used as far as I know.
