Gitea push fails with "unable to create temporary object directory" — repo objects/ dirs are mode 750 but Gitea user can only read #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discovery (2026-05-26): during the armer DiskPressure incident (oleks/armer#2) we discovered that
git pushto git.oleks.space repos underoleks/*fails with:We initially attributed this to armer DiskPressure starving Gitea of temp space. After k3s was stopped on armer (freeing CPU and I/O), the push still failed identically. Root cause turned out to be filesystem permissions, not disk.
Setup on armer:
User=git Group=serviseer(uid 992, gid 1000)gituser's groups:serviseer,gitea-data/var/lib/gitea/repositories/oleks/armer.git/objects) are ownedserviseer:serviseerwith mode 750Why it fails:
rwx, groupr-x, others nonegituser is in groupserviseerso it gets the group permissions =r-x— no writegit-receive-packtries to createobjects/incoming-NNNNNtemp dir during push →EACCES→ "unable to create temporary object directory"sudo -u git -g serviseer touch /var/lib/gitea/repositories/oleks/armer.git/objects/X→ Permission deniedserviseeruser succeedsWorkaround applied 2026-05-26:
sudo chmod -R g+w /var/lib/gitea/repositories/oleks/on armer → perms now770. Pushes work again. This is non-declarative and likely to drift back if NixOS rebuilds armer's gitea module.Open questions:
770(group write) on creationgit:gitowns objects dirs (group becomesgit)serviseergroup entirelyRepoRootPathgroup perms can't be written by the running uid?Cross-references:
Closed 2026-05-26 — root cause and fix in armer#9 / armer#10.
Not an upstream Gitea bug. Root cause was the NixOS
services.giteamodule settingUMask=0027on the systemd unit, making all runtime-created dirs0750. WithUser=git Group=serviseer, groupr-xblocked the gitea process from writing its own data dirs.Durable fix landed in oleks/armer#10:
UMask = lib.mkForce "0007"override. Verified live (Umask: 0007on the running process).No changes needed in this repo (the gitea fork).