SyncRepositoryHook permission denied

Hello together,

I updated Gitea 1.16.8 to 1.18.3 (suse linux 15.3.).
After the update, gitea no longer starts, the following error occurs:

Gitea - Code.SyncRepositoryHooks(ctx) failed: SyncRepositoryHook: unable to pre-remove old hook file ‘/opt/gitea/repositories/giteaadmin/ordirob.git/hooks/pre-receive’ prior to rewriting: remove /opt/gitea/repositories/giteaadmin/ordirob.git/hooks/pre-receive: permission denied

Before the update everything was working fine.
Does anyone have an idea what’s going wrong?

remove /opt/gitea/repositories/giteaadmin/ordirob.git/hooks/pre-receive: permission denied

This error is saying Gitea is not able to modify the files at that location. Make sure that Gitea is running as the right user/group and that those directories are accessible by that user/group.

You may also be running into an issue with MAC like AppArmor or SELinux, you can check their audit logs to see if they’re the reason behind it.