Search code examples
gitgit-lfstfvcgit-tfsgit-lfs-migrate

git lfs push is throwing "RPC failed" error


I am trying to migrate the repository from TFVC to Git with History of 4 months which is a huge data. I am using git tfs to clone it from a branch of a repo from TFVC to my local and trying to push it to a empty Git repository by enabling git lfs to track the large files and upload.

Steps: I cloned a TFVC repo branch files with history of 4 months using git tfs clone to my local. then, git remote add origin 'URL of the empty git repo' -- empty repo refers to my new git repo created.

Enabled LFS

Tracked the Large files

Made a commit

Migrated the LFS files using git lfs migrate import --include="*.*" --include-ref=refs/heads/master

The above successfully converts pre-existing git objects to lfs objects. However, the regular objects still persist in the .git directory. These will be cleaned up eventually by git, but to clean them up right away, run:

 git reflog expire --expire-unreachable=now --all
         git gc --prune=now

& Trying to push it using git push origin -u -all

But facing below error:

error: RPC failed; HTTP 503 curl 22 The requested URL returned error: 503
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
##[error]PowerShell exited with code '1'.
Finishing: Migrate whole source code to git (git push)```

Solution

  • This message doesn't come from Git LFS, but from Git itself. The message "RPC failed; HTTP 503" means that the server side sent a 503 Service Unavailable and Git wasn't able to complete its operation. Like all 5xx codes, this means that the server encountered an error, and generally the reason and the way to fix it would only be known to the server operator, in this case Azure DevOps.

    So in order to fix this, you'd have to ask Azure DevOps what's going wrong and ask them to fix the server so you can push your data. There's nothing that you can change here or do differently to make this work, since it's a server-side error.