Error 500: "empty object" "loose object" on push to gitlab
Created by: james-cook
(Background The remote m/c had 1 or 2 crashes recently so this is a possible cause).
On commit/pushing to remote with eGit or tortoise I'm suddenly getting an "empty object"/"loose object" fatal error. But the file mentioned (.git/objects/98/xxxxx) is not empty. Locally, AFAICT, everything is fine.
- Clicking on the HEAD (hash number) in gitlab produces a 404 (git resource not found) message and
- clicking on the Project Name itself leads to a 500 error:"we're sorry something went wrong".
- NOTE that clicking on the previous commit hash in gitlab works fine.
For the 500 internal server error (mentioned above) in the gitlab log I'm getting ActionView:Template::Error (undefined method 'sha' for Nil:Nilclass)
I've tried a number things, but it's only making matters worse. e.g. Client> git reset --hard hash for last good commit/push e.g. XXXX - **HEAD is now at XXXX Client> git push origin :master - again getting:
- the empty/loose object message - AFAICT the filename is the hash for the "old" failed/corrupt PUSH
- "refs/remotes/origin/master does not Point to a valid object!"
- "remote: warning deleting the current branch"
- "fatal: remote end hung up unexpectedly"
Client> git push origin master - rejected with fast Forward error
My question is, in such cases, where AFAICT, the most recent PUSH on the remote side is corrupt - what's the best way to get things working again? Locally everything appears to be fine.