Docker rootless: gitea dump error: Unable to find configuration file: "/var/lib/gitea/custom/conf/app.ini" (doesn't respect GITEA_APP_INI) #8992

Closed
opened 2025-11-02 08:25:02 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @jjakob on GitHub (May 23, 2022).

Description

To back up gitea, I run this command:
docker-compose exec -T -u git gitea /bin/sh -c "umask 0027; /app/gitea/gitea dump --file=/backup/gitea-dump-backup.zip"
This worked fine in the standard image, but after converting to rootless, I'm getting this error:

...s/setting/setting.go:586:loadFromConf() ] Unable to find configuration file: "/var/lib/gitea/custom/conf/app.ini".
	Ensure you are running in the correct environment or set the correct configuration file with -c.

If I exec into the container and run env I see that GITEA_APP_INI is correct:

GITEA_APP_INI=/etc/gitea/app.ini
GITEA_WORK_DIR=/var/lib/gitea
HOME=/var/lib/gitea/git
TMPDIR=/tmp/gitea
GITEA_TEMP=/tmp/gitea
GITEA_CUSTOM=/var/lib/gitea/custom

I have modified APP_DATA_PATH in app.ini, but I don't think that's the cause of this issue:

[repository]
ROOT = /var/lib/gitea/git/gitea-repositories

[server]
APP_DATA_PATH= /var/lib/gitea/data

[log]
ROOT_PATH = /var/lib/gitea/log

These are just the paths, the whole app.ini is much longer but I don't think it has any relevant info. All other paths are at their defaults.

If I modify the command to add -c /etc/gitea/app.ini it works fine.

Gitea Version

v1.16.7 (docker rootless image)

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Docker

How are you running Gitea?

Via my own docker-compose config with the official images.

Database

PostgreSQL

Originally created by @jjakob on GitHub (May 23, 2022). ### Description To back up gitea, I run this command: `docker-compose exec -T -u git gitea /bin/sh -c "umask 0027; /app/gitea/gitea dump --file=/backup/gitea-dump-backup.zip"` This worked fine in the standard image, but after converting to rootless, I'm getting this error: ``` ...s/setting/setting.go:586:loadFromConf() ] Unable to find configuration file: "/var/lib/gitea/custom/conf/app.ini". Ensure you are running in the correct environment or set the correct configuration file with -c. ``` If I exec into the container and run `env` I see that GITEA_APP_INI is correct: ``` GITEA_APP_INI=/etc/gitea/app.ini GITEA_WORK_DIR=/var/lib/gitea HOME=/var/lib/gitea/git TMPDIR=/tmp/gitea GITEA_TEMP=/tmp/gitea GITEA_CUSTOM=/var/lib/gitea/custom ``` I have modified APP_DATA_PATH in app.ini, but I don't think that's the cause of this issue: ``` [repository] ROOT = /var/lib/gitea/git/gitea-repositories [server] APP_DATA_PATH= /var/lib/gitea/data [log] ROOT_PATH = /var/lib/gitea/log ``` These are just the paths, the whole app.ini is much longer but I don't think it has any relevant info. All other paths are at their defaults. If I modify the command to add `-c /etc/gitea/app.ini` it works fine. ### Gitea Version v1.16.7 (docker rootless image) ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Docker ### How are you running Gitea? Via my own docker-compose config with the official images. ### Database PostgreSQL
GiteaMirror added the topic/distributiontype/bug labels 2025-11-02 08:25:02 -06:00
Author
Owner

@wxiaoguang commented on GitHub (May 24, 2022):

Use /usr/local/bin/gitea instead.


Background:

PR:

@wxiaoguang commented on GitHub (May 24, 2022): Use `/usr/local/bin/gitea` instead. ---- Background: * #17846 PR: * #19794
Author
Owner

@jjakob commented on GitHub (May 25, 2022):

Thanks, I did not know that script existed.

@jjakob commented on GitHub (May 25, 2022): Thanks, I did not know that script existed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8992