Permission denied on app.ini despite correct permissions #10701

Closed
opened 2025-11-02 09:15:57 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @KnightWhoSaysNeeeowWumPing on GitHub (Apr 20, 2023).

Description

Hey,

I have the following (in my eyes correct) permissions on the app.ini file:

$ ls -la /media/data/gitea/app.ini    
-rw-r--r-- 1 gitea gitea 1675 Apr 20 22:38 /media/data/gitea/app.ini

However, when trying to run gitea as the gitea user, the following error occurs:

$ sudo -u gitea /usr/bin/gitea web -c /media/data/gitea/app.ini
2023/04/20 23:19:05 cmd/web.go:105:runWeb() [I] Starting Gitea on PID: 10137
2023/04/20 23:19:05 ...s/setting/setting.go:253:newFileProviderFromConf() [E] Unable to check if /media/data/gitea/app.ini is a file. Error: stat /media/data/gitea/app.ini: permission denied
2023/04/20 23:19:05 .../setting/packages.go:66:loadPackagesFrom() [E] Unable to create chunked upload directory: /usr/bin/data/tmp/package-upload (mkdir /usr/bin/data: permission denied)

Dumping yields the same error:

$ sudo -u gitea gitea dump -c /media/data/gitea/app.ini
2023/04/20 23:09:39 ...s/setting/setting.go:253:newFileProviderFromConf() [E] Unable to check if /media/data/gitea/app.ini is a file. Error: stat /media/data/gitea/app.ini: permission denied
2023/04/20 23:09:39 ...s/setting/setting.go:260:newFileProviderFromConf() [F] Unable to find configuration file: "/media/data/gitea/app.ini".
	Ensure you are running in the correct environment or set the correct configuration file with -c.

Remark: /media/data/ is an ext4 file system.

Gitea Version

1.19.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.30.2

Operating System

Debian 11

How are you running Gitea?

I installed Gitea from the package provided at https://packaging.gitlab.io/gitea and run it from command line.

Database

SQLite

Originally created by @KnightWhoSaysNeeeowWumPing on GitHub (Apr 20, 2023). ### Description Hey, I have the following (in my eyes correct) permissions on the app.ini file: ``` $ ls -la /media/data/gitea/app.ini -rw-r--r-- 1 gitea gitea 1675 Apr 20 22:38 /media/data/gitea/app.ini ``` However, when trying to run gitea as the `gitea` user, the following error occurs: ``` $ sudo -u gitea /usr/bin/gitea web -c /media/data/gitea/app.ini 2023/04/20 23:19:05 cmd/web.go:105:runWeb() [I] Starting Gitea on PID: 10137 2023/04/20 23:19:05 ...s/setting/setting.go:253:newFileProviderFromConf() [E] Unable to check if /media/data/gitea/app.ini is a file. Error: stat /media/data/gitea/app.ini: permission denied 2023/04/20 23:19:05 .../setting/packages.go:66:loadPackagesFrom() [E] Unable to create chunked upload directory: /usr/bin/data/tmp/package-upload (mkdir /usr/bin/data: permission denied) ``` Dumping yields the same error: ``` $ sudo -u gitea gitea dump -c /media/data/gitea/app.ini 2023/04/20 23:09:39 ...s/setting/setting.go:253:newFileProviderFromConf() [E] Unable to check if /media/data/gitea/app.ini is a file. Error: stat /media/data/gitea/app.ini: permission denied 2023/04/20 23:09:39 ...s/setting/setting.go:260:newFileProviderFromConf() [F] Unable to find configuration file: "/media/data/gitea/app.ini". Ensure you are running in the correct environment or set the correct configuration file with -c. ``` Remark: `/media/data/` is an ext4 file system. ### Gitea Version 1.19.1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.30.2 ### Operating System Debian 11 ### How are you running Gitea? I installed Gitea from the package provided at `https://packaging.gitlab.io/gitea` and run it from command line. ### Database SQLite
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:15:57 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Apr 21, 2023):

Can you do this?

sudo -u gitea bash
cat /media/data/gitea/app.ini
@wxiaoguang commented on GitHub (Apr 21, 2023): Can you do this? ``` sudo -u gitea bash cat /media/data/gitea/app.ini ```
Author
Owner

@KnightWhoSaysNeeeowWumPing commented on GitHub (Apr 24, 2023):

Sorry for the delay..

That's a good point - I actually got a permission error running these commands, too.
I discovered that the permission of the /media/data directory lacked the executive flag, so a simple sudo chmod +x /media/data did the trick.

Thank you very much for pointing me there!

@KnightWhoSaysNeeeowWumPing commented on GitHub (Apr 24, 2023): Sorry for the delay.. That's a good point - I actually got a permission error running these commands, too. I discovered that the permission of the `/media/data` directory lacked the executive flag, so a simple `sudo chmod +x /media/data` did the trick. Thank you very much for pointing me there!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10701