- Notifications
You must be signed in to change notification settings - Fork5.1k
Description
Gogs version
0.14.0+dev
Git version
- Server: 2.47.2
- Client: (server error)
Operating system
Linux git 6.1.0-40-amd64#1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64 Linux (Debian 12.12)
Database
psql (PostgreSQL) 15.14 (Debian 15.14-0+deb12u1)
Describe the bug
When trying to create a repository from the UI (regardless of the user) a Internal Server Error (500) is reported.
Withingogs.log it reads:
2025/10/15 22:38:01 [TRACE] Template: repo/create2025/10/15 22:38:04 [TRACE] Session ID: f3d9a844b47299562025/10/15 22:38:04 [TRACE] CSRF Token: _GUXS3HruKoGYdm6tn1NVftBvh46MTc2MDU2Nzg3OTAzOTA1MDQwNw2025/10/15 22:38:04 [ERROR] [...gogs/internal/route/repo/repo.go:100 handleCreateError()] CreatePost: initRepository: set default branch: exit status 128 - fatal: detected dubious ownership in repository at '/data/git/gogs-repositories/tomes/test.git'To add an exception for this directory, call: git config --global --add safe.directory /data/git/gogs-repositories/tomes/test.git2025/10/15 22:38:04 [TRACE] Template: status/500The same ERROR is shown in the web UI at the 500-page.
To reproduce
I run gogs with via:
ExecStart=/usr/bin/podman run \ --cidfile=%t/%n.ctr-id \ --cgroups=no-conmon \ --rm \ --sdnotify=conmon \ -d \ --replace \ --name=gogs \ -p 10022:22 \ -p 3000:3000 \ -v /srv/git/:/data gogs:latestNotable requirement: /srv/git is a NFSv3 share; Here my directory listing:
deploy@git:/srv$ ls -la git/total 20drwxrwxrwx+ 5 root root 4096 Oct 15 18:07 .drwxr-xr-x 4 501 deploy 4096 Jul 21 20:52 ..drwxr-xr-x+ 4 501 deploy 4096 Oct 15 22:37 gitdrwxr-xr-x+ 5 501 deploy 4096 Oct 15 18:30 gogsdrwx------+ 2 501 deploy 4096 Oct 15 18:07 sshExpected behavior
I could globally configure git within my container such that all repositories created are accepted as safe.
Or better: I can simply create bare repositories via the web interface.
Additional context
Today I updated my gogs image - With the image between 27.07.2025 - 31.07.2025 taggedlatest fromdocker.io I was able to create repositories from the UI.
Mostlikely this has something to do with my NFSv3 share. But I am unable to replace the device in the next years and can not change the file system since the device is locked down.
I removed permissions for others for user tomes; But he still can't create repositories (nor can the admingogs):
deploy@git:/srv$ ls -la git/git/gogs-repositories/total 16drwxrwxrwx+ 4 501 deploy 4096 Oct 15 22:25 .drwxr-xr-x+ 4 501 deploy 4096 Oct 15 22:37 ..drwxrwxrwx+ 2 501 deploy 4096 Oct 15 22:25 gogsdrwxrwx---+ 2 501 deploy 4096 Oct 15 22:37 tomesStarting gogs shows many, many warnings like this:Oct 15 22:37:48 git gogs[148681]: chown: /data/ssh/ssh_host_rsa_key.pub: Operation not permitted
Code of Conduct
- I agree to follow this project's Code of Conduct