threads / discuss / 61734

Unable to push to git server

Subject: Unable to push to git server

## tl;dr

6 messages between Jul 4, 2024 and Jul 5, 2024.

replies: 5people: 3as markdown or json

Abraham Zsombor Nagy· Jul 4, 2024, 13:56 UTC · lore
Hello Git Team,
I hope you can help me.
I'm trying to push my code to GitHub, however I'm unable to do so:

abris@dell:~/Projects/maradandohalo/server$ git push --set-upstream origin main Username for 'https://github.com': nazsombor Password for 'https://nazsombor@github.com': fatal: protocol error: bad line length 175 send-pack: unexpected disconnect while reading sideband packet error: failed to push some refs to 'https://github.com/nazsombor/maradandohalo.git' Enumerating objects: 31, done. Counting objects: 100% (31/31), done. Delta compression using up to 16 threads Compressing objects: 100% (22/22), done.

I use Debian 12. I tried this with the git installed via apt as well with the git compiled from source code. Git version: 2.45.GIT

I also asked this question first on StackOverflow: https://stackoverflow.com/questions/78670914/git-fatal-protocol-error-bad-line-length-173

Thank you for your help.

Sincerely, Abraham

rsbecker@nexbridge.com· Jul 4, 2024, 14:33 UTC · re: Abraham Zsombor Nagy · lore

RE: Unable to push to git server

On Thursday, July 4, 2024 9:56 AM, Abraham Zsombor Nagy wrote:
Show 20 quoted lines
>I'm trying to push my code to GitHub, however I'm unable to do so:
>
>abris@dell:~/Projects/maradandohalo/server$ git push --set-upstream origin main
>Username for 'https://github.com': nazsombor Password for
>'https://nazsombor@github.com':
>fatal: protocol error: bad line length 175
>send-pack: unexpected disconnect while reading sideband packet
>error: failed to push some refs to
>'https://github.com/nazsombor/maradandohalo.git'
>Enumerating objects: 31, done.
>Counting objects: 100% (31/31), done.
>Delta compression using up to 16 threads Compressing objects: 100% (22/22),
>done.
>
>I use Debian 12. I tried this with the git installed via apt as well with the git compiled
>from source code. Git version: 2.45.GIT
>
>I also asked this question first on StackOverflow:
>https://stackoverflow.com/questions/78670914/git-fatal-protocol-error-bad-line-
>length-173

As far as I know, GitHub changed to use personal access tokens to authentication for HTTPS push rather than password. Have you tried SSH? --Randall

brian m. carlson· Jul 5, 2024, 01:50 UTC · re: Abraham Zsombor Nagy · lore

Re: Unable to push to git server

On 2024-07-04 at 13:56:15, Abraham Zsombor Nagy wrote:
Show 23 quoted lines
> Hello Git Team,
> 
> I hope you can help me.
> 
> I'm trying to push my code to GitHub, however I'm unable to do so:
> 
> abris@dell:~/Projects/maradandohalo/server$ git push --set-upstream origin main
> Username for 'https://github.com': nazsombor
> Password for 'https://nazsombor@github.com':
> fatal: protocol error: bad line length 175
> send-pack: unexpected disconnect while reading sideband packet
> error: failed to push some refs to
> 'https://github.com/nazsombor/maradandohalo.git'
> Enumerating objects: 31, done.
> Counting objects: 100% (31/31), done.
> Delta compression using up to 16 threads
> Compressing objects: 100% (22/22), done.
> 
> I use Debian 12. I tried this with the git installed via apt as well
> with the git compiled from source code. Git version: 2.45.GIT
> 
> I also asked this question first on StackOverflow:
> https://stackoverflow.com/questions/78670914/git-fatal-protocol-error-bad-line-length-173

I know you've got this working with SSH, but I'll just mention that usually this message "protocol error: bad line length" means that you have some sort of proxy (such as an antivirus or a TLS-intercepting device) that's tampering with the data. TLS, which is the protocol used for encryption on HTTPS URLs, has built-in mechanisms to detect any sort of accidental or intentional modification of the data, so if we assume that both your version of Git and GitHub sent valid protocol data, then this means that if it came out bad on the other side, it was tampered with in the middle by something that can decrypt the data (which would have to be something trusted by your machine).

That's why SSH works for you: because the types of proxies that typically know how to process HTTPS data don't know how to decrypt or intercept SSH connections, so your data doesn't get corrupted.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Abraham Zsombor Nagy· Jul 5, 2024, 09:07 UTC · re: brian m. carlson · lore

Re: Unable to push to git server

On Fri, 5 Jul 2024 at 03:50, brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 43 quoted lines
>
> On 2024-07-04 at 13:56:15, Abraham Zsombor Nagy wrote:
> > Hello Git Team,
> >
> > I hope you can help me.
> >
> > I'm trying to push my code to GitHub, however I'm unable to do so:
> >
> > abris@dell:~/Projects/maradandohalo/server$ git push --set-upstream origin main
> > Username for 'https://github.com': nazsombor
> > Password for 'https://nazsombor@github.com':
> > fatal: protocol error: bad line length 175
> > send-pack: unexpected disconnect while reading sideband packet
> > error: failed to push some refs to
> > 'https://github.com/nazsombor/maradandohalo.git'
> > Enumerating objects: 31, done.
> > Counting objects: 100% (31/31), done.
> > Delta compression using up to 16 threads
> > Compressing objects: 100% (22/22), done.
> >
> > I use Debian 12. I tried this with the git installed via apt as well
> > with the git compiled from source code. Git version: 2.45.GIT
> >
> > I also asked this question first on StackOverflow:
> > https://stackoverflow.com/questions/78670914/git-fatal-protocol-error-bad-line-length-173
>
> I know you've got this working with SSH, but I'll just mention that
> usually this message "protocol error: bad line length" means that you
> have some sort of proxy (such as an antivirus or a TLS-intercepting
> device) that's tampering with the data.  TLS, which is the protocol used
> for encryption on HTTPS URLs, has built-in mechanisms to detect any sort
> of accidental or intentional modification of the data, so if we assume
> that both your version of Git and GitHub sent valid protocol data, then
> this means that if it came out bad on the other side, it was tampered
> with in the middle by something that can decrypt the data (which would
> have to be something trusted by your machine).
>
> That's why SSH works for you: because the types of proxies that
> typically know how to process HTTPS data don't know how to decrypt or
> intercept SSH connections, so your data doesn't get corrupted.
> --
> brian m. carlson (they/them or he/him)
> Toronto, Ontario, CA
Thank you Brian,

I cannot think of anything, I'm just behind my home network, I don't have a dedicated firewall or proxy. Pushing via https works on Windows on the same laptop. So I guess it's something in my Linux env. I don't know if it matters, but cloning worked out of the box on Linux.

Sincerely, Abraham

rsbecker@nexbridge.com· Jul 4, 2024, 16:33 UTC · lore

RE: Unable to push to git server

Glad to help. (Adding the original recipients back in for archive purposes).

From: Abraham Zsombor Nagy <abrahamzsombornagy@gmail.com> 
Sent: Thursday, July 4, 2024 12:28 PM
To: rsbecker@nexbridge.com
Subject: Re: Unable to push to git server

Thank you Randall, I will contact GitHub to check the issue. Sincerely, Abraham

On Thu, Jul 4, 2024, 6:24 PM <mailto:rsbecker@nexbridge.com> wrote: On Thursday, July 4, 2024 12:05 PM, Abraham Zsombor Nagy wrote:

Show 40 quoted lines
>Indeed, I got the error with the classic PAT as well as with OAuth authentication
>within Intellij IDEA.
>
>On Thu, 4 Jul 2024 at 17:20, <mailto:rsbecker@nexbridge.com> wrote:
>>
>> On Thursday, July 4, 2024 11:14 AM, Abraham Zsombor Nagy wrote:
>> >Thank you so much, with SSH, I was able to push my code.
>> >On Thu, 4 Jul 2024 at 16:34, <mailto:rsbecker@nexbridge.com> wrote:
>> >>
>> >> On Thursday, July 4, 2024 9:56 AM, Abraham Zsombor Nagy wrote:
>> >> >I'm trying to push my code to GitHub, however I'm unable to do so:
>> >> >
>> >> >abris@dell:~/Projects/maradandohalo/server$ git push
>> >> >--set-upstream origin main Username for 'https://github.com':
>> >> >nazsombor Password for
>> >> >'https://nazsombor@github.com':
>> >> >fatal: protocol error: bad line length 175
>> >> >send-pack: unexpected disconnect while reading sideband packet
>> >> >error: failed to push some refs to
>> >> >'https://github.com/nazsombor/maradandohalo.git'
>> >> >Enumerating objects: 31, done.
>> >> >Counting objects: 100% (31/31), done.
>> >> >Delta compression using up to 16 threads Compressing objects: 100%
>> >> >(22/22), done.
>> >> >
>> >> >I use Debian 12. I tried this with the git installed via apt as
>> >> >well with the git compiled from source code. Git version: 2.45.GIT
>> >> >
>> >> >I also asked this question first on StackOverflow:
>> >> >https://stackoverflow.com/questions/78670914/git-fatal-protocol-er
>> >> >ror
>> >> >-bad-line-
>> >> >length-173
>> >>
>> >> As far as I know, GitHub changed to use personal access tokens to
>> >> authentication
>> >for HTTPS push rather than password. Have you tried SSH?
>>
>> That's good but we need to understand what is going on with HTTPS. Try to create
>a PAT and try that.
I would suggest contacting GitHub and Intellij. This may also be a possible firewall/proxy issue in your environment. I may be wrong here (someone else chime in please) but this is not looking like it is caused directly by git. Part of this may be the communication protocol you selected in Intellij or a TLS compatibility issue between your machine and GitHub. There are some articles at StackOverflow discussing this error that may be helpful.
Abraham Zsombor Nagy· Jul 4, 2024, 17:02 UTC · re: rsbecker@nexbridge.com · lore

Re: Unable to push to git server

On Thu, 4 Jul 2024 at 18:33, <rsbecker@nexbridge.com> wrote:
Show 58 quoted lines
>
> Glad to help.
> (Adding the original recipients back in for archive purposes).
>
> From: Abraham Zsombor Nagy <abrahamzsombornagy@gmail.com>
> Sent: Thursday, July 4, 2024 12:28 PM
> To: rsbecker@nexbridge.com
> Subject: Re: Unable to push to git server
>
> Thank you Randall, I will contact GitHub to check the issue.
> Sincerely,
> Abraham
>
> On Thu, Jul 4, 2024, 6:24 PM <mailto:rsbecker@nexbridge.com> wrote:
> On Thursday, July 4, 2024 12:05 PM, Abraham Zsombor Nagy wrote:
> >Indeed, I got the error with the classic PAT as well as with OAuth authentication
> >within Intellij IDEA.
> >
> >On Thu, 4 Jul 2024 at 17:20, <mailto:rsbecker@nexbridge.com> wrote:
> >>
> >> On Thursday, July 4, 2024 11:14 AM, Abraham Zsombor Nagy wrote:
> >> >Thank you so much, with SSH, I was able to push my code.
> >> >On Thu, 4 Jul 2024 at 16:34, <mailto:rsbecker@nexbridge.com> wrote:
> >> >>
> >> >> On Thursday, July 4, 2024 9:56 AM, Abraham Zsombor Nagy wrote:
> >> >> >I'm trying to push my code to GitHub, however I'm unable to do so:
> >> >> >
> >> >> >abris@dell:~/Projects/maradandohalo/server$ git push
> >> >> >--set-upstream origin main Username for 'https://github.com':
> >> >> >nazsombor Password for
> >> >> >'https://nazsombor@github.com':
> >> >> >fatal: protocol error: bad line length 175
> >> >> >send-pack: unexpected disconnect while reading sideband packet
> >> >> >error: failed to push some refs to
> >> >> >'https://github.com/nazsombor/maradandohalo.git'
> >> >> >Enumerating objects: 31, done.
> >> >> >Counting objects: 100% (31/31), done.
> >> >> >Delta compression using up to 16 threads Compressing objects: 100%
> >> >> >(22/22), done.
> >> >> >
> >> >> >I use Debian 12. I tried this with the git installed via apt as
> >> >> >well with the git compiled from source code. Git version: 2.45.GIT
> >> >> >
> >> >> >I also asked this question first on StackOverflow:
> >> >> >https://stackoverflow.com/questions/78670914/git-fatal-protocol-er
> >> >> >ror
> >> >> >-bad-line-
> >> >> >length-173
> >> >>
> >> >> As far as I know, GitHub changed to use personal access tokens to
> >> >> authentication
> >> >for HTTPS push rather than password. Have you tried SSH?
> >>
> >> That's good but we need to understand what is going on with HTTPS. Try to create
> >a PAT and try that.
>
> I would suggest contacting GitHub and Intellij. This may also be a possible firewall/proxy issue in your environment. I may be wrong here (someone else chime in please) but this is not looking like it is caused directly by git. Part of this may be the communication protocol you selected in Intellij or a TLS compatibility issue between your machine and GitHub. There are some articles at StackOverflow discussing this error that may be helpful.
>
Thank you for the heads up, I will do so.

← back to recent threads