Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 7 tasks
pavelxdd opened this issue Mar 12, 2019 · 2 comments · Fixed by #6394
Closed
2 of 7 tasks

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

pavelxdd opened this issue Mar 12, 2019 · 2 comments · Fixed by #6394
Labels
Milestone

Comments

@pavelxdd
Copy link

  • Gitea version: master (b2e9894)
  • 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 e777c6b

@vitobotta
Copy link

vitobotta commented 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

@lunny lunny added the type/bug label Mar 14, 2019
@vitobotta
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants