gitea dump -c failed to connect to database and can't create a backup file #3084

Closed
opened 2025-11-02 05:00:19 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @alsmnn on GitHub (Mar 20, 2019).

  • Gitea version (or commit ref): 1.6.1
  • Git version: 2.19.2-0120
  • Operating system: DSM (Synology)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I installed gitea via gitea-spk on a Synology and am running it with MariaDB 10. Everything works fine. Now I wanted to update to the latest gitea version. While performing a backup, I ran into the following issue.
Running ./gitea dump -c ./custom/conf/app.ini in the /var/packages/Gitea/target/gitea dir (this is the home folder of gitea on a Synology), gives the following error:

$ ./gitea dump -c ./custom/conf/app.ini
2019/03/20 11:44:27 [I] Log Mode: Console(Info)
2019/03/20 11:44:27 [I] XORM Log Mode: Console(Info)
2019/03/20 11:44:27 [I] Cache Service Enabled
2019/03/20 11:44:27 [I] Session Service Enabled
2019/03/20 11:44:27 [I] Gitea v1.6.1 built with: bindata, sqlite
Failed to connect to database: Unknown database type:

I am a total noob regarding Databases like MariaDB/MySQL/PostgreSQl and so on, so please bear with me. Is it safe to manually backup all files & repos, perform an installation of the new gitea version and copy back the config, etc?
Which files do I have to backup?

Thank and best regards,
@AljoLe

Originally created by @alsmnn on GitHub (Mar 20, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.6.1 - Git version: 2.19.2-0120 - Operating system: DSM (Synology) - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I installed gitea via [gitea-spk](https://github.com/flipswitchingmonkey/gitea-spk) on a Synology and am running it with MariaDB 10. Everything works fine. Now I wanted to update to the latest gitea version. While performing a backup, I ran into the following issue. Running `./gitea dump -c ./custom/conf/app.ini` in the `/var/packages/Gitea/target/gitea` dir (this is the home folder of gitea on a Synology), gives the following error: ```bash $ ./gitea dump -c ./custom/conf/app.ini 2019/03/20 11:44:27 [I] Log Mode: Console(Info) 2019/03/20 11:44:27 [I] XORM Log Mode: Console(Info) 2019/03/20 11:44:27 [I] Cache Service Enabled 2019/03/20 11:44:27 [I] Session Service Enabled 2019/03/20 11:44:27 [I] Gitea v1.6.1 built with: bindata, sqlite Failed to connect to database: Unknown database type: ``` I am a total noob regarding Databases like MariaDB/MySQL/PostgreSQl and so on, so please bear with me. Is it safe to manually backup all files & repos, perform an installation of the new gitea version and copy back the config, etc? Which files do I have to backup? Thank and best regards, @AljoLe
Author
Owner

@lunny commented on GitHub (Mar 20, 2019):

manually backup all files, repos and database also safe. see https://docs.gitea.io/en-us/backup-and-restore/

@lunny commented on GitHub (Mar 20, 2019): manually backup all files, repos and database also safe. see https://docs.gitea.io/en-us/backup-and-restore/
Author
Owner

@alsmnn commented on GitHub (Mar 21, 2019):

Thanks, update worked fine.
Can be closed now

@alsmnn commented on GitHub (Mar 21, 2019): Thanks, update worked fine. Can be closed now
Author
Owner

@thomas-mc-work commented on GitHub (Jul 7, 2020):

I'm encountering the same issue. Manual backup is possible, but the feature itself seems to be broken. Shouldn't we either reopen this ticket or remove that feature?

@thomas-mc-work commented on GitHub (Jul 7, 2020): I'm encountering the same issue. Manual backup is possible, but the feature itself seems to be broken. Shouldn't we either reopen this ticket or remove that feature?
Author
Owner

@crobarcro commented on GitHub (Aug 12, 2020):

I'm encountering the same issue with gitea 1.12.3

Gitea version 1.12.3 built with GNU Make 4.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify

when I try to backup using the comand documented on the web page linked above I get the following:

$ su git
git@ed-mh-pi01:/root$ gitea dump -R -c /etc/gitea/app.ini -f /home/git/gitea-dump.zip
2020/08/12 10:38:52 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.20.1, Wire Protocol Version 2 Enabled
2020/08/12 10:38:52 ...dules/setting/log.go:233:newLogService() [I] Gitea v1.12.3 built with GNU Make 4.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify
2020/08/12 10:38:52 ...dules/setting/log.go:279:newLogService() [I] Gitea Log Mode: Console(Console:info)
2020/08/12 10:38:53 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2020/08/12 10:38:53 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2020/08/12 10:38:53 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2020/08/12 10:38:53 main.go:111:main() [F] Failed to run app with [gitea dump -R -c /etc/gitea/app.ini -f /home/git/gitea-dump.zip]: Failed to connect to database: Unknown database type: 

I'm using a mariadb database. I recently migrated to a new server, the command worked fine on the old server. I think the issue should be reopened as it is not resolved.

@crobarcro commented on GitHub (Aug 12, 2020): I'm encountering the same issue with gitea 1.12.3 `Gitea version 1.12.3 built with GNU Make 4.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify` when I try to backup using the comand documented on the web page linked above I get the following: ``` $ su git git@ed-mh-pi01:/root$ gitea dump -R -c /etc/gitea/app.ini -f /home/git/gitea-dump.zip 2020/08/12 10:38:52 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.20.1, Wire Protocol Version 2 Enabled 2020/08/12 10:38:52 ...dules/setting/log.go:233:newLogService() [I] Gitea v1.12.3 built with GNU Make 4.1, go1.14.6 : bindata, sqlite, sqlite_unlock_notify 2020/08/12 10:38:52 ...dules/setting/log.go:279:newLogService() [I] Gitea Log Mode: Console(Console:info) 2020/08/12 10:38:53 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled 2020/08/12 10:38:53 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled 2020/08/12 10:38:53 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled 2020/08/12 10:38:53 main.go:111:main() [F] Failed to run app with [gitea dump -R -c /etc/gitea/app.ini -f /home/git/gitea-dump.zip]: Failed to connect to database: Unknown database type: ``` I'm using a mariadb database. I recently migrated to a new server, the command worked fine on the old server. I think the issue should be reopened as it is not resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3084