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 have a workaround if you need to clone or pull and the problem lies in the size of the repository history. It may also help when you want to push later, with no guarantee.
Simply retrieve the last commits with --depth=[number of last commits].
You can do this at clone time, or, if working from a local repository to which you added a remote, at pull time. For instance, to only retrieve the last commit (of each branch):
git clone repo --depth=1
# or
git pull --depth=1
UPDATE: if the remote is getting too much ahead of you, the issue may come back later as you try to pull the last changes, but there are too many and the connection closes with curl 56. You may have to git pull --depth=[number of commits ahead on remote], which is tedious if you're working on a very active repository.
I tried all the above without success. Eventually I realised I had a weak WiFi connection and therefore slow download speed. I connected my device VIA Ethernet and that solved my problem straight away.
I have to say nothing in master conflicted with any of my changes in my new branch "xyx". Only a couple of new commits from master were merged to my "xyz" branch. This shouldn't have been a problem on normal days.
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
when trying to clone a repository from Github.
After trying most of the solutions posted here, none of which worked, it turned out to be the parental controls on our home network. Turning these parental controls off solved the problem.
I saw similar issues (particularly with depth) on some legacy projects when we were cloning that used to live on TFS. Enabling long paths resolved our issue and may be something else worth trying.
If you are are running the git server service, then rather than it be a git client issue ... perhaps it's a git server issue too !
This is what the solution was for me...
We were running a gitbucket server with a front-end nginx reverse proxy for https.
Following a major system OS version upgrade, we started getting this error across all git clients.
Turns out that nginx got replaced and the new package's default nginx.conf got installed.
The default nginx user 'www-data' was NOT what it used to be.
Somewhere underneath it all, there must have been a permissions issue, because resetting the nginx user back to it's former value, and restarting nginx got everything going again. .... go figure ! (Yes I had restarted nginx many times prior to the one singular change that solved it)