3

At the moment I am working in WSL2 on Ubuntu (20.04.2). I have finished up my project and I want to commit my code to the repository I have made. However, whenever I want to commit I get the following error:

error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received.
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

I do not know what is causing this error. I know my credentials are right. These are the command I excecute to commit my code:

git init
git add .
git commit -m "Finished Project"
git branch -M main
git remote add origin https://github.com/Myusername/my-repo.git
git push -u origin main

After the last command I get asked for my credentials and then I recieve the error.

I first thought it is because I am not using openSSL and that is causing the error. If that is the case, how do I solve this problem?

EDIT: The error I receive when I use SSH:

Received disconnect from 140.82.121.3 port 22:11: Bye Bye
Disconnected from 140.82.121.3 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
LeGEC
  • 46,477
  • 5
  • 57
  • 104
Parsa_237
  • 117
  • 1
  • 2
  • 12
  • Are you using an antivirus or firewall other than Windows Defender or Windows Firewall? If so, which one? Are you using a proxy or TLS MITM device? – bk2204 Mar 10 '21 at 23:22
  • I happen to use `MalwareBytes` on my Windows 10. I do not know if I am using a proxy @bk2204 – Parsa_237 Mar 11 '21 at 12:25
  • Try completely uninstalling it and restarting. Antivirus programs other than Windows Defender often break Git or WSL2 because they improperly and insecurely tamper with connections. – bk2204 Mar 11 '21 at 23:22
  • Hi, I did just that but I still recieve the same error @bk2204 – Parsa_237 Mar 12 '21 at 19:12
  • Instead of `https:`, can you try `ssh:` ? – Philippe Mar 14 '21 at 19:52
  • Is it a MTU issue? (https://stackoverflow.com/a/64837761/6309) Or a buffer one? (https://stackoverflow.com/a/66235724/6309) – VonC Mar 14 '21 at 23:49
  • I tried that. Still does not work. Look up my edited question for the error when I try SSH. @Philippe – Parsa_237 Mar 16 '21 at 20:39
  • What software (name and version) and OS (name and version) are you using on the server side? – bk2204 Mar 18 '21 at 01:01
  • Bit random, but this could be also the origin.. https://github.com/microsoft/WSL/issues/4253 – Niklas Mar 20 '21 at 14:19
  • @Niklas: thanks a lot, after many fails, your link finally helped me to sort it out – Jozef Sep 28 '22 at 11:44

0 Answers0