gitgitlabpushwindows-subsystem-for-linuxgnutls

Git push getting errors in both SSH and HTTPS


So I have a laptop and a desktop. I have a git remote of a project that was originally on my laptop, I can successfully push and pull on my laptop on both Operating systems(I am dual booting linux and windows), however on my Desktop when I try to pull or push I get this error:

Connection closed by (SOME IP) port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Anyways I accepted the defeat and created a new project on my desktop. I created a folder and then I created the git project on GitLab, then i did the usual:

git remote add origin https link

I then added the files in the folder and commited them. When I tried to push I got the same error as before. So I set the origin url to SSH (I'm pretty sure I correctly generated and linked the key so I dont think this is the issue) and tried pushing again this time I get this error

Enumerating objects: 46, done.
Counting objects: 100% (46/46), done.
Delta compression using up to 6 threads
Compressing objects: 100% (45/45), done.
Writing objects: 100% (46/46), 79.68 KiB | 703.00 KiB/s, done.
Total 46 (delta 2), reused 0 (delta 0), pack-reused 0
error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received.
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date

I searched around online for a good hour and I wasn't able to fix it.

I tried increasing the postbuffer size and that didn't fix it.

I'm using git on the WSL terminal on windows.

Any possible fixes or is there a way to completely remove git then reinstall it to potentially fix this?

EDIT: Still wasn't able to fix it. As an alternative work around is there a way I can transfer a git repository with all the commits and all the ignores by usb?


Solution

  • As per comments, this turns out to be a WSL 2 issue discussed in comments on error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received. Ubuntu. What's probably happening is that driver and/or hardware bugs are corrupting data as it goes over the network. Due to the extensive encryption-and-checking involved in TLS, the userspace code in GnuTLS is catching the hardware / driver error and reporting it as a TLS error.