Fix GitLab Push Failures After Repository Data Recovery: error: unpack failed: unable to create temporary object directory
Problem Description
After the GitLab server just finished a data recovery,
all old repositories failed to accept git push.
The error message was error: unpack failed: unable to create temporary object directory.
However, newly created repositories could still accept git push normally.
Problem Analysis
I searched for related issues online.
The main problem was insufficient GitLab permissions.
Because the GitLab repository files had just been restored, their owner was still root, so permission issues were expected.
Solution
Enter the GitLab Docker terminal and change the owner of all repositories to git.
cd /home/git/data/repositories
ll
chown -R git:git .