[solved] Error during git push


#1

I am getting the following error while making a git push to my gitea server

git push -v
Pushing to http://intranet/gitea/rand/repo-data.git
Enumerating objects: 28, done.
Counting objects: 100% (28/28), done.
Delta compression using up to 4 threads
Compressing objects: 100% (20/20), done.
Writing objects: 100% (20/20), 17.30 KiB | 1.73 MiB/s, done.
Total 20 (delta 7), reused 0 (delta 0)
POST git-receive-pack (17866 bytes)
error: remote unpack failed: unable to create temporary object directory
To http://intranet/gitea/rand/repo-data.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'http://intranet/gitea/rand/repo-data.git'

On the server side I can see the following:

Nov 27 22:50:17 randl-desk gitea[6094]: [Macaron] 2018-11-27 22:50:17: Started GET /rand/repo-data.git/info/refs?service=git-receive-pack for 172.16.1.11
Nov 27 22:50:17 randl-desk gitea[6094]: [Macaron] 2018-11-27 22:50:17: Completed GET /rand/repo-data.git/info/refs?service=git-receive-pack 401 Unauthorized in 17.929406ms
Nov 27 22:50:17 randl-desk gitea[6094]: [Macaron] 2018-11-27 22:50:17: Started GET /rand/repo-data.git/info/refs?service=git-receive-pack for 172.16.1.11
Nov 27 22:50:18 randl-desk gitea[6094]: [Macaron] 2018-11-27 22:50:18: Completed GET /rand/repo-data.git/info/refs?service=git-receive-pack 200 OK in 144.38621ms
Nov 27 22:50:18 randl-desk gitea[6094]: [Macaron] 2018-11-27 22:50:18: Started POST /rand/repo-data.git/git-receive-pack for 172.16.1.11
Nov 27 22:50:18 randl-desk gitea[6094]: [Macaron] 2018-11-27 22:50:18: Completed POST /rand/repo-data.git/git-receive-pack 200 OK in 73.76579ms

I have checked the permission in repo directory. Any idea what is the problem?


#2

Ok this was not gitea issue. I use Arch Linux and this suddenly started happening since system update. It turned out that the issue was that I have custom repository (ROOT) location, and in the systemd service file the following setting:

ProtectSystem=strict

was making the custom location read only. Created /etc/systemd/system/gitea.service.d/override.conf file with the following content:

[Service]
ReadWritePaths=<custom-path>/gitea/repos

to resolve the issue. The above ReadWritePaths is same as ROOT in gitea’s app.ini.
This will allow gitea to write to custom location. Though there is no indication from gitea about any write failure (even in debug mode) - which is kind of strange.