# Connection issue with github.com when downloading Jenkinsfile

**URL:** <https://community.jenkins.io/t/connection-issue-with-github-com-when-downloading-jenkinsfile/7483>\
**Category:** Using Jenkins\
**Tags:** git\
**Created:** [May 19, 2023, 10:20am UTC](https://community.jenkins.io/t/connection-issue-with-github-com-when-downloading-jenkinsfile/7483 "2023-05-19T10:20:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracorp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/dracorp/32/1802_2.png) [@dracorp](https://community.jenkins.io/u/dracorp)\
**Post date:** [May 19, 2023, 10:20am UTC](https://community.jenkins.io/t/connection-issue-with-github-com-when-downloading-jenkinsfile/7483/1 "2023-05-19T10:20:24Z")

</div>

Hi  
Our company, partially migrate to the [Github.com](http://Github.com). Jenkinsfiles are stored in the Github. On the Github side, there are configured github app with private keys. I don’t know how, because I don’t have access.  
On the Jenkins side, I have them added to the credentials as Github App. Test connection from credentials successfully: Success, Remaining rate limit: 14856  
Sometimes Jenkins has a problem with connection to the github to download a Jenkinsfile:

```auto
hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune origin +refs/heads/master:refs/remotes/origin/master" returned status code 128:
 stdout: 
 stderr: ssh_exchange_identification: Connection closed by remote host
 fatal: Could not read from remote repository.
 
 Please make sure you have the correct access rights
 and the repository exists.
 
 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)
 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)
 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:87)
 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)
 	at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:406)
 	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)
 	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:191)
 	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
 	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:118)
 	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
 	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
 	at hudson.model.ResourceController.execute(ResourceController.java:101)
 	at hudson.model.Executor.run(Executor.java:442)
 Finished: FAILURE

```

I cannot find anything about in logs, in the system /var/log/jenkins/jenkins.log or https://jenkins\_url/log/  
The problem occurs with https and ssh connection.  
Nothing alarming in the company’s firewall logs.

How can I inform Jenkins to be more verbose when getting jenkinsfile from github? Or how else can I trace where the problem is occurring. From the Jenkins or system side.

BR, Piotr

---

<div class="post-metadata">

**Author:** ![dracorp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/dracorp/32/1802_2.png) [@dracorp](https://community.jenkins.io/u/dracorp)\
**Post date:** [May 19, 2023, 10:25am UTC](https://community.jenkins.io/t/connection-issue-with-github-com-when-downloading-jenkinsfile/7483/2 "2023-05-19T10:25:33Z")

</div>

There is also another error:

```auto
13:15:26 hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune origin +refs/heads/master:refs/remotes/origin/master" returned status code 128:
13:15:26 stdout: 
13:15:26 stderr: fatal: repository 'https://github.com/our-org/project.git/' not found
13:15:26  
13:15:26 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)
13:15:26 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)
13:15:26 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:87)
13:15:26 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)
13:15:26 at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:406)
13:15:26 at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)
13:15:26 at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:191)
13:15:26 at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
13:15:26 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:118)
13:15:26 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
13:15:26 at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
13:15:26 at hudson.model.ResourceController.execute(ResourceController.java:101)
13:15:26 at hudson.model.Executor.run(Executor.java:442)
13:15:26 Finished: FAILURE

```

The worst thing is that this does not always occur, but has appeared for some time.
