Git推送报错:remote rejected无法迁移对象至永久存储,求排查方法
Hey there, that error you're hitting when pushing to your Stash repo is almost always tied to server-side storage issues or repository integrity problems. Let's walk through practical steps to diagnose and fix this:
First, loop in your Stash server admin (if you aren't the one managing it)
This error means Stash can't write Git objects to its permanent storage directory. The most common root causes here are:- The disk hosting Stash's repositories or home directory is full
- The system user running Stash lacks write permissions to the Git repository storage path
- A temporary glitch in the Stash service blocking file operations
If you have server access, check disk space right away
SSH into the Stash server and run this command to view available disk space:df -hLook for the mount point where your Stash repos are stored — if it’s showing 100% used, you’ll need to free up space (delete old files, expand the disk, etc.) before pushes will succeed.
Verify repository integrity on the server
Navigate to the directory of the problematic repository on the Stash server, then run:git fsck --fullThis scans for corrupted Git objects. If you see errors like missing objects or corrupted packs, you may need to restore the repo from a backup (note: Git repair tools are risky, so always back up first before using them).
Check Stash's server logs for precise details
Look at the Stash application logs (usually located at$STASH_HOME/logs/atlassian-stash.log) — they’ll include specific error messages that pinpoint the exact issue, like IO errors, permission denials, or problems with the underlying storage system.Try restarting the Stash service
Sometimes a temporary hang in the Stash process causes this error. Restarting the service might resolve the issue if it’s just a transient glitch.Quickly verify your local repo (just to rule out edge cases)
While this is a remote rejection error, it doesn’t hurt to confirm your local branch is intact. Run:git fsckon your local machine to check for corrupted objects. You can also try fetching the latest remote state and rebasing/merging before pushing again, though this is a long shot for this specific error.
Your error log for reference:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v origin feature/xxx:feature/xxx POST git-receive-pack (3470 bytes) Pushing to http://xxx@stash/xxx.git To http://stash/xxx.git ! [remote rejected] feature/xxx -> feature/xxx (unable to migrate objects to permanent storage) error: failed to push some refs to 'http://xxx@stash/xxx.git' Completed with errors, see above.
内容的提问来源于stack exchange,提问作者Conor

