Gitea Stop working

Good Morning,

Gitea 1.18.3 was working pretty well for over a year, last friday I had error 500 when trying to access my REPO. So this morning I stop and restart Gitea and it simply don’t start I can’t access the start page. I check the log folder nothing in it so I started it from the command line from my NAS Qnap.
Error is
2023/11/06 06:02:27 routers/init.go:68:mustInitCtx() [F] Gitea - Code failed: unable to load git version: exit status 128 - fatal: could not open ‘/dev/null’ for reading and writing: Permission denied
- fatal: could not open ‘/dev/null’ for reading and writing: Permission denied

I open putty and do a git --version from the current directory of Gitea
answer is git version 2.39.1

What can I do to find what is the error and fixed it. If you need any other information don’t hesitate to ask !!

Best Regards,

Good afternoon,

I’m wondering if my problem can be that my data directory are under a SAMBA share folder, I’m searching why it was working perfectly before, but now it don’t and our programmer need their REPO :slight_smile: .
The gitea user is exported when starting the application with ID as 500 and group as 500. So when Gitea his stopped I can’t see the username associated with the UID 500. I remember that I added the gitea user and group on my QNAP before installing Gitea, I did my share folder and gave permission to the user and group. But when I read the start script, I see this
export USER=$USER

if ! grep -q “$USER” /etc/passwd; then
echo “$USER:x:500:500:$USER:/tmp:/bin/false” >> /etc/passwd

if ! grep -q "$USER" /etc/group; then
echo "$USER:x:500:$USER" >> /etc/group

I’m pretty sure that the user I created from the QNAP isn’t UID 500 neither the GID of the group, it start at 1000 for user created on the QNAP. So I suspect that git can’t access the repo on my SAMBA share !?

What I did few minutes ago is:
1- execute the script with stop option it removes the exported values
2- I verified the User and group in my QNAP and now there is no gitea user and no gitea group.
3- I go to my share folder and remove gitea user and gitea group from the share folder permission (yes I was seeing it)
4- I restart Gitea with the script
5- I go the the share folder permission and add gitea user and group R/W access to the share folder
6- I check the etc/group and etc/passwd for gitea value at 500 and it’s ok
7- I check my samba.conf for my gitea share folder, the UID and GID don’t seem to affect it, because the only reference is by name. but Now I’m sure it’s the right account.

I execute the script to restart Gitea, same error from git :frowning:

I’ll restart the QNAP tonight to see if it makes a diffference, if someone can shed a light on my problem it will be really appreciated !

Best Regards,


Good Morning,

After rebooting the Qnap, Gitea UI is working perfectly again but I still have error 500 when trying to access my Repositories on my Samba share :frowning:
I check git --version and it still working.

So for test purpose I stop Gitea and start it again from the command line, and I still have the same error which is
2023/11/08 06:20:07 routers/init.go:68:mustInitCtx() [F] Gitea - Code failed: unable to load git version: exit status 128 - fatal: could not open ‘/dev/null’ for reading and writing: Permission denied

So Gitea UI will work perfectly on a fresh restart of the QNAP with error 500 when trying to access REPO, but will not start if I restart it manually ??

I’ll need a Gitea guru here (or QNAP guru ?).

any information that will shed a light about the error: routers/init.go:68:mustInitCtx() [F] Gitea - Code above will be really appreciated

Thank you for your precious time,


Can you post full log of startup? Also, can you verify that your Samba share is online and connected? From what you’ve described, it sounds like Samba share is not working and Gitea cannot access the repository files as a result.

Good Morning Jake,

I finally decided to move my GITEA 1.20.5 installation to a Windows computer. Just installed it and running it but on first start it says that it can’t open Sqlite database file, which is normal it isn’t created ?

Will have to read how to setup Gitea correctly on Windows. Normally when correct access right are given, we just run gitea and it supposes to create everything am I right ?

Best Regards,


Good Morning,

Installation of Gitea working perfectly and REPO initially in Linux with SAMBA transferred on the new installation keeping REPO LFS and and secret key.

Working perfectly under Windows !. Need a little bit of reading for creating initial sub directory and app.ini default value setup !