Unable to push to github, Remote end hung up unexpectedly - github

I'm trying to upload a relatively large Unreal engine 4 project through sourcecontrol on Github.
It uploads completely, and when it reaches 100% it fails giving me this error:
Writing objects: 100% (8901/8901), 11.30 GiB | 33.67 MiB/s
Writing objects: 100% (8901/8901), 11.32 GiB | 31.25 MiB/s, done.
Total 8901 (delta 632), reused 8579 (delta 403)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; curl 56 Send failure: Connection was reset
Everything up-to-date
(The error was parsed as 4: The remote disconnected. Check your Internet connection and try again.)
My connection is fine, because I tried it several times, and it always fails at 100%.
I tried it with Sourcetree and Github Desktop, and it produces the same error.

Check first if this is a client setting issue:
git config http.postBuffer 524288000
(and you can increase that setting since Git 2.13)
Also make sure to not exceed a GitHub size limit.

Had this issue recently, when I was using the HTTPs url of the repo for push, later switched to SSH and it works like expected. My Repo size was 500MB and using SSH fixed it for me.
Setting up SSH keys if you don't have one
create the SSH Key:
ssh-keygen -t rsa -b 4096 -C "github_registered_mail_id#xyz.com"
copy the key(everything) from the created public key file usually present in ".ssh/id_rsa.pub"
logon to github and add the public key under
settings->SSH_and_GPG_Keys->new_key
after adding the public SSH Key into Github, test the SSH connection using
ssh -vT git#github.com
Once you have your SSH ready.
Setup upstream(push) remote URL which will be SSH url of the repo instead of usual HTTPS url.
git remote add <remote-name> git#github.com:username/repo_name
Set your branches to use the new upstream url
git push --set-upstream <remote-name> <branch_name>
Push the large repository as usual
git push <remote-name> <branch_name>

Related

Intermittent connection to Azure-devops. Unable to push code to the repo

I use Azure repository for managing code and I have not been very lucky
with checking in code and pushing code. I would get one error or the other.
Here are some of the errors I get
fatal: unable to access 'https://dev.azure.com/mydevops/myStartup/_git/myStartup/':
OpenSSL SSL_connect: Connection was reset in connection to dev.azure.com:xxx
Failed to push the branch to the remote repository. See the Output window for more details.
Error encountered while pushing branch to the remote repository: Branch feature/445-create-unit-test does not exist.
Commit changes locally and then push.
I tried to check in a branch and it got checked in but when It was time to push, I was not able
to push. Here is what I got. I got a message to run the command below
git push --set-upstream origin feature/445-create-unit-test
Any ideas about what I am doing wrong?
I've seen this problem, in my case it was IPv6 issue.
Try this:
Open command line and do ping dev.azure.com - if the IP address is IPv6 (something like 2620:1ec:21::20), then it might be the problem.
configure Windows to prefer v4 over v6:
netsh int ipv6 set prefixpolicy ::ffff:0:0/96 51
Alternatively, you might disable IPv6 alltogether.

cloning github through SSH auth with multiple accounts freezes

I've created and set up multiple ssh keys for authenticating with multiple github accounts. After successfully tried it out by means of ssh -Tcommand, I tried to clone a repo, but this freezes unexpectedly:
MacBook-Pro-di-Matteo:.ssh matteo$ ssh -T git#github.com-bertamini.matteo
Hi bertuz-gist! You've successfully authenticated, but GitHub does not provide shell access.
MacBook-Pro-di-Matteo:.ssh matteo$ git clone git#github.com-bertamini.matteo:bertuz/bertuzFox.git tst
Cloning into 'tst'...
remote: Counting objects: 253, done.
remote: Compressing objects: 100% (12/12), done.
I can't figure out if it is my fault or a temporary github glitch. Any help?
As illustrated by "Git fetch/pull/clone hangs on receiving objects", that kind of issue is generally caused by:
the remote side having an issue (but GitHub status history doesn't show any issue)
the network (middle or client side)
the ssh config, if ssh url are used (ServerAliveInterval 60)
The OP Bertuz confirms in the comments the reason is the second one (network):
The wifi I was using used to block git connections.
Now everything works smoothly. Shall I delete the question?

Jenkins returned status code 128 with github

With GitHub command I have:
ssh -T git#github.com
Hi (MyName)! You've successfully authenticated, but GitHub does not provide shell access.
My connection with GitHub is ok (no problem), but with Jenkins I have this error:
ERROR: Error cloning remote repo 'origin' : Could not clone git#github.com:Name-MysRepo/MyRepo.git
hudson.plugins.git.GitException: Could not clone git#github.com:Name-MysRepo/MyRepo.git
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:219)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1001)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
at hudson.FilePath.act(FilePath.java:904)
at hudson.FilePath.act(FilePath.java:877)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1369)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
at hudson.model.Run.execute(Run.java:1575)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:241)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git#github.com:Name-MysRepo/MyRepo.git /root/.jenkins/jobs/TestKRGDAOV01/workspace" returned status code 128:
stdout: Cloning into '/root/.jenkins/jobs/TestKRGDAOV01/workspace'...
stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Is this problem with public key?
I use Jenkins under Tomcat 7 / Ubuntu 12.
This error:
stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly
indicates that Jenkins is trying to connect to github with the wrong ssh key.
You should:
Determine the user that jenkins runs as, eg. 'build' or 'jenkins'
Login on the jenkins host that is trying to do the clone - that is, do not login to the master if a node is actually doing the build.
Try you ssh to github - if it fails, then you need to add the proper key to <jenkins user home>/.ssh
To check are the following:
if the right public key (id_rsa.pub) is uploaded to the git-server.
if the right private key (id_rsa) is copied to /var/lib/jenkins/.ssh/
if the known_hosts file is created inside ~/.ssh folder. Try ssh -vvv git#github.com to see debug logs. If thing goes well, github.com will be added to known_hosts.
if the permission of id_rsa is set to 700 (chmod 700 id_rsa)
After all checks, try ssh -vvv git#github.com.
Also make sure you using the ssh github url and not the https
In my case I had to add the public key to my repo (at Bitbucket) AND use git clone once via ssh to answer yes to the "known host" question the first time.
i had sometime ago the same issue.
make sure that your ssh key doesn't have password and use not common user account (e.g. better to user account called jenkins or so).
check following article http://fourkitchens.com/blog/2011/09/20/trigger-jenkins-builds-pushing-github
When I got a similar status code 128 error from Jenkins:
status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/heads/jenkins
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2172)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1864)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:545)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:358)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:113)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:299)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
It was because I hadn't pushed my new branch "jenkins" that had my Jenkinsfile. So the solution was to just push my changes
I deleted my project (root folder) and created it again. It was the fastest and simplest way in my case.
Do not forget to save all you changes, before you delete you project!
I first had another credential, then when i deleted that, and created a new one, i had the same error. I had to go to every project, and select the new Credential.
I changed the permission of my .ssh/id_rsa (private key) to 604.
chmod 700 id_rsa

Gitlab was unable to access your Gitolite system

I installed GitLab on Ubuntu server 12.
I followed this steps: http://blog.compunet.co.za/gitlab-installation-on-ubuntu-server-12-04/
Everything seems to be right... but when I try to create a new project, I get the error message:
Gitlab was unable to access your Gitolite system.
I ran the diagnostic tool ("bundle exec rake gitlab:app:status RAILS_ENV=production")
(in /home/gitlab/gitlab) Starting diagnostic
config/database.yml.............exists
config/gitlab.yml.............exists
/home/git/repositories/...........exists
/home/git/repositories/ is writable?........YES
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (8/8), done.
Receiving objects: 100% (12/12), 1.12KiB, done.
Resolving deltas: 100% (1/1), done.
remote:Total 12 (delta 1), reused 0 (delta 0)
Can clone gitolite-admin?..............YES
UMASK for .gitolite.rc is 0007?............YES
/home/git/share/gitolite/hooks/common/post-receive exists?............YES
Finished
The log on admin area only shows:
ERROR -> /home/gitlab/gitlab/tmp/gitlabhq-gitolite-1348050652/gitolite
The config/gitlab.yml file is ok.
The permissions on repositories are just like the tutorial (section 3 - permissions).
I even tried to remove the lock...
What would you advise to troubleshoot this?
If it helps, I had a very similar situation happen, except in my gitlab log I had the following error:
ERROR -> Pull error -> unable to clone gitolite-admin repo
I had compared the commit of the gitolite fork metioned, and found that the changes there were already in place in my version of gitlab.
I ended up stopping the gitlab related services, deleting the contents of the gitlab tmp directory, then restarted the gitlab related services.
Afterwards, everything appeared to be working fine.
If the issue comes from permission regex fixed in this commit of this gitolite fork, you can have a look at "GitHub Tip: download commits as patches":
Your commit can be downloaded by adding a .patch at the end of its url: patch.
That way, you can apply it to your current gitolite source (without even using git itself, just by using the patch command)
I was able to resolve this issue on my server by following the installation instructions section titled "Disable StrictHostKeyChecking for localhost and your domain" and adding a new section for my gitolite host, which was set to the IP address of the server rather than localhost. Open:
/etc/ssh/ssh_config
And add the lines:
Host [gitolite hostname/IP here]
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
(replace the bracketed part with the appropriate hostname/IP)
It's already in the setup steps, but I had skipped it earlier because I didn't understand what it was suggesting. Otherwise, the SSH client tries to show the yes/no prompt to accept a new hostname and the Ruby backend interprets that as a failure to connect to gitolite.

GitHub -> 'The remote end hung up unexpectedly'

I am trying to push a project (Calico) to GitHub, and am running into an error. I've successfully logged in via a ssh connection, and received the usual response:
Ryan#RYANLAPTOP-PC /C/inetpub/wwwroot/Calico (master)
$ ssh git#github.com
Enter passphrase for key '/c/Users/Ryan/.ssh/id_rsa':
Hi rossryan! You've successfully authenticated, but GitHub does not provide shel
l access.
Connection to github.com closed.
However, I am still receiving an error when I attempt to push the code:
Ryan#RYANLAPTOP-PC /C/inetpub/wwwroot/Calico (master)
$ git push -u github master
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
Connection abandoned.
fatal: The remote end hung up unexpectedly
I believe I've followed the instructions rather faithfully from the website, substituting 'GitHub' for 'origin' in the right areas (origin is apparently already defined, so I used a different name). I've emailed GitHub about this problem, but have received no response.
Does anyone have any other ideas?
EDIT:
Output from git remote -v:
Ryan#RYANLAPTOP-PC /C/inetpub/wwwroot/Calico (master)
$ git remote -v
github git#github.com:rossryan/Calico.git (fetch)
github git#github.com:rossryan/Calico.git (push)
origin C:/inetpub/wwwroot/Calico/ (fetch)
origin C:/inetpub/wwwroot/Calico/ (push)
git push origin master fails was about that error when using putty (instead of the packaged openssh included with msysgit). I don't think that is your case.
git - Server host key not cached is about that same error, and proposes to establish an ssh connection, which you did (and it didn't propose to add github to your $HOME/ssh/known_hosts file, so this isn't the issue either.
What you need to check is:
why are you pushing to github instead of the default name 'origin' (did you really add a remote (upstream) repo named 'github'?)
What exact address is behind the remote name 'github'. A right address for pushing would be (from GitHub man page on remote):
an ssh URL git#github.com:user/repo.git
or an https URL such like https://user#github.com/user/repo.git