0

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?

Motcho
  • 3
  • 2
  • Does this answer your question? [git: fatal: Could not read from remote repository](https://stackoverflow.com/questions/13509293/git-fatal-could-not-read-from-remote-repository) – djuarezg Oct 26 '22 at 17:36
  • @djuarezg no unfortunately doesn't fix it – Motcho Oct 26 '22 at 19:34
  • The TLS error suggests that something (faulty firewall software or box, most likely) is f... er, *messing* with your data. Stop it from doing that and the problem should go away. You could also just be missing some certificates; see, e.g., [this Ask Ubuntu question](https://askubuntu.com/q/1115761). – torek Oct 27 '22 at 00:49
  • [Related](https://stackoverflow.com/q/66572205/1256452): see [this WSL2 issue](https://github.com/microsoft/WSL/issues/4253). Note that some of these are driver issues, which falls into the "faulty software/box" category. (This is why networking protocols have end-to-end checksums, and why networking hardware the circumvents these checksums, as is the case here, is not necessarily a good idea!) – torek Oct 27 '22 at 00:54
  • @torek thanks a bunch! the it was indeed a WSL2 issue for now I just reverted to WSL1 and it fixed it. I will try later on to go back to WSL2 and update the wifi drivers as was mentioned on the thread. How can I make a comment an answer? – Motcho Oct 27 '22 at 09:35
  • You can't (make a comment an answer), someone has to write it as an answer (me, you, whoever...). – torek Oct 27 '22 at 09:52

1 Answers1

0

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.

torek
  • 448,244
  • 59
  • 642
  • 775