docker backup failed to access the previous repositories #9875

Closed
opened 2025-11-02 08:52:02 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @GeekWorkCode on GitHub (Nov 23, 2022).

Description

I want to backup repositories
Tried 1. docker exec -u root -it -w /tmp $(docker ps -qf 'name=c31db143cc98') bash -c 'gitea dump -c /root/gitea/gitea/gitea/conf/app.ini'
2. docker exec -u root -it -w /tmp $(docker ps -qf 'name=^gitea$') bash -c 'gitea dump -c /root/gitea/gitea/gitea/conf/app.ini' This backed up without c31db143cc98 is my docker image iD, /root/gitea/ is my installation path with docker-couple.yml in it
After the backup failed I didn't go any further and later found that the service hung
I tried docker-compose pull docker-compose up -d --remove-orphans to update and restart with the following error message
server_1 | 2022/11/23 02:57:15 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 19
server_1 | 2022/11/23 02:57:15 ...s/setting/setting.go:611:loadFromConf() [E] Unable to check if /data/gitea/conf/app.ini is a file. Error: stat /data/gitea/conf/app.ini: permission denied
server_1 | 2022/11/23 02:57:15 ...s/setting/setting.go:1079:loadFromConf() [E] Unable to check if /data/gitea/robots.txt is a file. Error: stat /data/gitea/robots.txt: permission denied
server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:21:PreloadSettings() [I] AppPath: /usr/local/bin/gitea
server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:22:PreloadSettings() [I] AppWorkPath: /app/gitea
server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:23:PreloadSettings() [I] Custom path: /data/gitea
server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:24:PreloadSettings() [I] Log path: /app/gitea/log
server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:25:PreloadSettings() [I] Configuration file: /data/gitea/conf/app.ini
server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:26:PreloadSettings() [I] Prepare to run install page
server_1 | 2022/11/23 02:57:15 ...ation/translation.go:60:InitLocales() [F] Failed to list locale files: Failed to check if custom directory stat /data/gitea/options/locale: permission denied is a directory. %!v(MISSING)
server_1 | Received signal 15; terminating.

I tried replacing image: gitea/gitea:1.17.3-rootless and it started, when it was a new web and the previous repositories didn't exist anymore. But I have git, repositories, and gate/gitea.db data under my current installation /root/gitea/gitea/.
What do I need to do to start the service so that I can access the previous repositories

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

git version 2.25.1

Operating System

20.04.1-Ubuntu

How are you running Gitea?

docker-comple.yml
version: "3"

networks:
gitea:
external: false

services:
server:
image: gitea/gitea
restart: always
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"

docker-comple.yml
version: "3"

networks:
gitea:
external: false

services:
server:
image: gitea/gitea:1.17.3-rootless
restart: always
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"

Database

SQLite

Originally created by @GeekWorkCode on GitHub (Nov 23, 2022). ### Description I want to backup repositories Tried 1. docker exec -u root -it -w /tmp $(docker ps -qf 'name=c31db143cc98') bash -c 'gitea dump -c /root/gitea/gitea/gitea/conf/app.ini' 2. docker exec -u root -it -w /tmp $(docker ps -qf 'name=^gitea$') bash -c 'gitea dump -c /root/gitea/gitea/gitea/conf/app.ini' This backed up without c31db143cc98 is my docker image iD, /root/gitea/ is my installation path with docker-couple.yml in it After the backup failed I didn't go any further and later found that the service hung I tried docker-compose pull docker-compose up -d --remove-orphans to update and restart with the following error message server_1 | 2022/11/23 02:57:15 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 19 server_1 | 2022/11/23 02:57:15 ...s/setting/setting.go:611:loadFromConf() [E] Unable to check if /data/gitea/conf/app.ini is a file. Error: stat /data/gitea/conf/app.ini: permission denied server_1 | 2022/11/23 02:57:15 ...s/setting/setting.go:1079:loadFromConf() [E] Unable to check if /data/gitea/robots.txt is a file. Error: stat /data/gitea/robots.txt: permission denied server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:21:PreloadSettings() [I] AppPath: /usr/local/bin/gitea server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:22:PreloadSettings() [I] AppWorkPath: /app/gitea server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:23:PreloadSettings() [I] Custom path: /data/gitea server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:24:PreloadSettings() [I] Log path: /app/gitea/log server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:25:PreloadSettings() [I] Configuration file: /data/gitea/conf/app.ini server_1 | 2022/11/23 02:57:15 ...s/install/setting.go:26:PreloadSettings() [I] Prepare to run install page server_1 | 2022/11/23 02:57:15 ...ation/translation.go:60:InitLocales() [F] Failed to list locale files: Failed to check if custom directory stat /data/gitea/options/locale: permission denied is a directory. %!v(MISSING) server_1 | Received signal 15; terminating. I tried replacing image: gitea/gitea:1.17.3-rootless and it started, when it was a new web and the previous repositories didn't exist anymore. But I have git, repositories, and gate/gitea.db data under my current installation /root/gitea/gitea/. What do I need to do to start the service so that I can access the previous repositories ### Gitea Version 1.17.3 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version git version 2.25.1 ### Operating System 20.04.1-Ubuntu ### How are you running Gitea? docker-comple.yml version: "3" networks: gitea: external: false services: server: image: gitea/gitea restart: always volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" docker-comple.yml version: "3" networks: gitea: external: false services: server: image: gitea/gitea:1.17.3-rootless restart: always volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:52:02 -06:00
Author
Owner

@GeekWorkCode commented on GitHub (Nov 23, 2022):

Since docker exec -u root -it -w /tmp $(docker ps -qf 'name=c31db143cc98') bash -c 'gitea dump -c /root/gitea/gitea/gitea/conf/app.ini'
I've done snap install gitea, and I found that this installed gitea, a new gitea service
I tried gitea web -c ~/gitea/gitea/gitea/conf/app.ini -w ~/gitea/gitea/gitea Configuring the previous data directory

2022/11/23 03:34:51 ...s/setting/setting.go:611:loadFromConf() [E] Unable to check if /root/gitea/gitea/gitea/conf/app.ini is a file. Error: stat /root/gitea/gitea/gitea/conf/app.ini: permission denied
2022/11/23 03:34:51 .../setting/packages.go:44:newPackages() [E] Unable to create chunked upload directory: /root/gitea/gitea/gitea/data/tmp/package-upload (mkdir /root/gitea/gitea/gitea: permission denied)
A new service configuration was restarted
I configured the previous data on the page and was prompted with no permission to access
截屏2022-11-23 11 40 10

@GeekWorkCode commented on GitHub (Nov 23, 2022): Since docker exec -u root -it -w /tmp $(docker ps -qf 'name=c31db143cc98') bash -c 'gitea dump -c /root/gitea/gitea/gitea/conf/app.ini' I've done snap install gitea, and I found that this installed gitea, a new gitea service I tried gitea web -c ~/gitea/gitea/gitea/conf/app.ini -w ~/gitea/gitea/gitea Configuring the previous data directory 2022/11/23 03:34:51 ...s/setting/setting.go:611:loadFromConf() [E] Unable to check if /root/gitea/gitea/gitea/conf/app.ini is a file. Error: stat /root/gitea/gitea/gitea/conf/app.ini: permission denied 2022/11/23 03:34:51 .../setting/packages.go:44:newPackages() [E] Unable to create chunked upload directory: /root/gitea/gitea/gitea/data/tmp/package-upload (mkdir /root/gitea/gitea/gitea: permission denied) A new service configuration was restarted I configured the previous data on the page and was prompted with no permission to access <img width="992" alt="截屏2022-11-23 11 40 10" src="https://user-images.githubusercontent.com/7720942/203465036-5083de0e-7c38-4eca-be6b-13ea23088f52.png">
Author
Owner

@lunny commented on GitHub (Nov 23, 2022):

check your directories permissions.

@lunny commented on GitHub (Nov 23, 2022): check your directories permissions.
Author
Owner

@GeekWorkCode commented on GitHub (Nov 23, 2022):

check your directories permissions.
I've given all of them chmod 777 and still can't access them
截屏2022-11-23 11 55 47

@GeekWorkCode commented on GitHub (Nov 23, 2022): > check your directories permissions. I've given all of them chmod 777 and still can't access them <img width="394" alt="截屏2022-11-23 11 55 47" src="https://user-images.githubusercontent.com/7720942/203466444-f5c60953-d851-4d32-8bbc-da32e62e35ae.png">
Author
Owner

@GeekWorkCode commented on GitHub (Nov 23, 2022):

check your directories permissions.
I've checked the permission and it says it's fine
截屏2022-11-23 12 02 01

@GeekWorkCode commented on GitHub (Nov 23, 2022): > check your directories permissions. I've checked the permission and it says it's fine <img width="474" alt="截屏2022-11-23 12 02 01" src="https://user-images.githubusercontent.com/7720942/203467065-bf0fe125-95b7-41ad-8a3f-2573c2a965cd.png">
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9875