shiftkey / desktop

Fork of GitHub Desktop to support various Linux distributions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suddenly Cannot Push Origin

amarraff opened this issue · comments

The problem

When I commit my changes and try to push to origin, the app gives me this error: "The remote disconnected. Check your internet connection and try again."

My computer is connected to the internet and I can watch YouTube, play online games, etc.

Release version

Version 3.3.6-linux3 (x64)

Operating system

Linux Mint 21.3 x86_64

Steps to reproduce the behavior

No response

Log files

No response

Screenshots

Screenshot from 2024-04-13 17-33-05

Additional context

No response

From what I can tell the Git error is related to network connectivity with the remote:

https://github.com/desktop/dugite/blob/69157855063b0fcb6e9fa67861cfb020c4330595/lib/errors.ts#L77

fatal: the remote end hung up unexpectedly

There might be more details in the logs about why it disconnected unexpected. Please check the logs created at ~/.config/GitHub\ Desktop/logs/ from around the time of the issue to see if there's any helpful messages that might explain the underlying behaviour.

@shiftkey Here's what the end of the log says right as it happens:

Writing objects: 100% (79/79)
Writing objects: 100% (79/79), 2.95 MiB | 8.35 MiB/s, done.
Total 79 (delta 52), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

(The error was parsed as 4: The remote disconnected. Check your Internet connection and try again.)

I pushed the first commit today without any issues and when I tried to push the second one, I received the error as well.

konstantinos@opensuse-tumbleweed:~> github-desktop
error: [ui] `git -c credential.helper= push origin master:master --progress` exited with an unexpected code: 1.
stderr:
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 12 threads
Compressing objects: 100% (6/6), done.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (6/6), 7.49 MiB | 5.79 MiB/s, done.
Total 6 (delta 3), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

(The error was parsed as 5: The remote disconnected. Check your Internet connection and try again.)

In ~/.config/GitHub Desktop/logs/2024-04-17.desktop..log

2024-04-17T16:51:35.940Z - info: [ui] Executing push: git -c credential.helper= push origin master:master --progress (took 2.262s)
2024-04-17T16:51:35.941Z - error: [ui] `git -c credential.helper= push origin master:master --progress` exited with an unexpected code: 1.
stderr:
Enumerating objects: 11, done.
Counting objects:   9% (1/11)
Counting objects:  18% (2/11)
Counting objects:  27% (3/11)
Counting objects:  36% (4/11)
Counting objects:  45% (5/11)
Counting objects:  54% (6/11)
Counting objects:  63% (7/11)
Counting objects:  72% (8/11)
Counting objects:  81% (9/11)
Counting objects:  90% (10/11)
Counting objects: 100% (11/11)
Counting objects: 100% (11/11), done.
Delta compression using up to 12 threads
Compressing objects:  16% (1/6)
Compressing objects:  33% (2/6)
Compressing objects:  50% (3/6)
Compressing objects:  66% (4/6)
Compressing objects:  83% (5/6)
Compressing objects: 100% (6/6)
Compressing objects: 100% (6/6), done.
Writing objects:  16% (1/6)
Writing objects:  33% (2/6)
Writing objects:  50% (3/6)
Writing objects:  66% (4/6)
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
send-pack: unexpected disconnect while reading sideband packet
Writing objects:  83% (5/6)
Writing objects:  83% (5/6), 4.42 MiB | 5.56 MiB/s
Writing objects: 100% (6/6), 4.42 MiB | 5.56 MiB/s
Writing objects: 100% (6/6), 7.49 MiB | 5.95 MiB/s, done.
Total 6 (delta 3), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

(The error was parsed as 5: The remote disconnected. Check your Internet connection and try again.)

I tried to push the commit from the terminal without using GitHub Desktop at all and I received the same error so it is related to git itself. After looking up the error, increasing the http buffer solved it and I finally managed to push the commit.

git config http.postBuffer 524288000

@Konstantinos-Sk I saw people in other forums on the net mentioning that increasing the post buffer could fix it, but is this possible to do in the GitHub desktop app? I’ve never used the Git command line, although I’m willing to learn.

@Konstantinos-Sk I saw people in other forums on the net mentioning that increasing the post buffer could fix it, but is this possible to do in the GitHub desktop app? I’ve never used the Git command line, although I’m willing to learn.

I can't seem to find any option to set it through GitHub desktop application, but you can execute it once in the terminal (konsole, gnome terminal, etc. whatever your system uses) and then use the application and push commits normally.

@Konstantinos-Sk I saw people in other forums on the net mentioning that increasing the post buffer could fix it, but is this possible to do in the GitHub desktop app? I’ve never used the Git command line, although I’m willing to learn.

I can't seem to find any option to set it through GitHub desktop application, but you can execute it once in the terminal (konsole, gnome terminal, etc. whatever your system uses) and then use the application and push commits normally.

I'm a total n00b with git and I can't figure out how to do this in the terminal for GitHub desktop, any advice would be appreciated xD Typing in the command
git config http.postBuffer 524288000
returns
fatal: not in a git directory
Do I need to be in the project folder directory, or the installation directory for the GitHub desktop flatpak?

Enter the directory of your local repository, the one you add the changes into cd /path/to/repo

Enter the directory of your local repository, the one you add the changes into cd /path/to/repo

That fixed it for me, thank you @Konstantinos-Sk ! :)

this also fixed it for me! thank you very much @Konstantinos-Sk

this should be fixed tho.. very weird that this happens out of nowhere... i even did a test push to my other repos and no issue.

Thanks @Konstantinos-Sk for the assist here.

This is the actual interesting error that seems to be relevant to this thread:

Writing objects:  66% (4/6)
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
send-pack: unexpected disconnect while reading sideband packet
Writing objects:  83% (5/6)

this should be fixed tho.. very weird that this happens out of nowhere... i even did a test push to my other repos and no issue.

The core of this issue is something like this:

  • commit a very large file to a given branch
  • push the branch to the remote
  • git works out the blobs and other metadata it needs to send to the remote
  • based on the http.postBuffer setting value, Git will use chunked requests to try and send the file
  • something in between rejects the request
  • git gives up because it couldn't synchronize the remote changes with the local repository

So it's not likely to be seen in other repositories, and once you've been able to push the commit to the remote you don't need to push it again.

Closing this out as resolved.