Failed to dump database: pq: relation "o_auth2_application" does not exist #3041

Closed
opened 2025-11-02 04:58:35 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @pavelxdd on GitHub (Mar 12, 2019).

  • Gitea version: master (b2e9894988)
  • Git version: 2.17.1
  • Operating system: Ubuntu Bionic
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log:
$ ./gitea dump
2019/03/12 07:52:27 Creating tmp work dir: /tmp/gitea-dump-808312899
2019/03/12 07:52:27 Packing dump files...
2019/03/12 07:52:27 Dumping local repositories.../home/git/gitea-repositories
2019/03/12 07:55:21 Dumping database...
2019/03/12 07:55:25 Failed to dump database: pq: relation "o_auth2_application" does not exist

Description

This problem started occurring starting with commit e777c6bdc6

Originally created by @pavelxdd on GitHub (Mar 12, 2019). - Gitea version: master (b2e9894988a8cb486f8838f4bf532401124802c4) - Git version: 2.17.1 - Operating system: Ubuntu Bionic - Database: - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log: ```` $ ./gitea dump 2019/03/12 07:52:27 Creating tmp work dir: /tmp/gitea-dump-808312899 2019/03/12 07:52:27 Packing dump files... 2019/03/12 07:52:27 Dumping local repositories.../home/git/gitea-repositories 2019/03/12 07:55:21 Dumping database... 2019/03/12 07:55:25 Failed to dump database: pq: relation "o_auth2_application" does not exist ```` ## Description This problem started occurring starting with commit e777c6bdc6f12f9152335f8bfd66b956aedc9957
GiteaMirror added the type/bug label 2025-11-02 04:58:35 -06:00
Author
Owner

@vitobotta commented on GitHub (Mar 14, 2019):

Hi, I am having the exact same problem with Gitea installed with Docker but using MariaDB instead.

I'm running the backup with the following commands:

/usr/bin/docker exec root_gitea_1 chown -R git:git /backup
/usr/bin/docker exec -w /backup --user git  root_gitea_1 sh -c '/app/gitea/gitea dump -c /data/gitea/conf/app.ini'

The first is to fix a permissions issue with the backup directory/volume not being writable by the use git, and the user git is required to run the dump.

Any idea of how to fix? Thanks!

2019/03/14 10:28:49 Creating tmp work dir: /tmp/gitea-dump-945144888
2019/03/14 10:28:49 Packing dump files...
2019/03/14 10:28:49 Dumping local repositories.../data/git/repositories
2019/03/14 10:28:49 Dumping database...
2019/03/14 10:28:49 Failed to dump database: Error 1146: Table 'gitea.o_auth2_application' doesn't exist
@vitobotta commented on GitHub (Mar 14, 2019): Hi, I am having the exact same problem with Gitea installed with Docker but using MariaDB instead. I'm running the backup with the following commands: ``` /usr/bin/docker exec root_gitea_1 chown -R git:git /backup /usr/bin/docker exec -w /backup --user git root_gitea_1 sh -c '/app/gitea/gitea dump -c /data/gitea/conf/app.ini' ``` The first is to fix a permissions issue with the backup directory/volume not being writable by the use git, and the user git is required to run the dump. Any idea of how to fix? Thanks! ``` 2019/03/14 10:28:49 Creating tmp work dir: /tmp/gitea-dump-945144888 2019/03/14 10:28:49 Packing dump files... 2019/03/14 10:28:49 Dumping local repositories.../data/git/repositories 2019/03/14 10:28:49 Dumping database... 2019/03/14 10:28:49 Failed to dump database: Error 1146: Table 'gitea.o_auth2_application' doesn't exist ```
Author
Owner

@vitobotta commented on GitHub (Mar 14, 2019):

So, because it seems that the Gitea dump command doesn't do anything special, I just created two scripts for backing up and restoring a backup without using that command. They are quite simple since they just archive all the files + dump the database, and seem to work. I have tried several times backing up and restoring after making some changes to both the repos and the database and it seems to work well.

For reference, in case someone would like to use them, the backup script is in this gist and the restore script in this one.

@vitobotta commented on GitHub (Mar 14, 2019): So, because it seems that the Gitea dump command doesn't do anything special, I just created two scripts for backing up and restoring a backup without using that command. They are quite simple since they just archive all the files + dump the database, and seem to work. I have tried several times backing up and restoring after making some changes to both the repos and the database and it seems to work well. For reference, in case someone would like to use them, the backup script is in [this gist](https://gist.github.com/vitobotta/7141c84e89470393b57cd7bacd406b5f) and the restore script in [this one](https://gist.github.com/vitobotta/7088bfb563de015f8de9f616d689685a).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3041