Restore on multisite fails for anything but the primary database


(Sander Datema) #1

Case:

  • Restore a backup from a Discourse installation that is not the primary instance of a multisite
  • Error in log is permission denied for database <database_name>

(Neil Lalonde) #2

This sounds similar (but different) to a problem I encountered today and someone else reported last week. From one multisite environment to another, the restore results in a brand new DIscourse site with none of the backup data. I don’t see a permission error and the restore says “[SUCCESS]” at the end.

In your case, did the restore succeed or fail?


Multiple docker containers for multiple Discourse forums?
(Sander Datema) #3

It failed. Apart from the primary instance all the others could not be restored. In the end I just copied over all the files in the shared directory. Fortunately PostgreSQL accepted that. But it’s not what it should be.

I also noticed the discourse command line script only caters for a single site install. Could it be causing this? I mean, when trying to import a multisite database, will it clash with the default selected primary database?


#4

Reproduced error.

First instance Restore is success, second and third failing

[2016-02-04 04:58:15] Marking restore as running...
[2016-02-04 04:58:15] Making sure /var/www/discourse/tmp/restores/discourse_instance3/2016-02-04-045815 exists...
[2016-02-04 04:58:15] Copying archive to tmp directory...
[2016-02-04 04:58:15] Unzipping archive...
[2016-02-04 04:58:15] Extracting metadata file...
[2016-02-04 04:58:15] Validating metadata...
[2016-02-04 04:58:15]   Current version: 20160201181320
[2016-02-04 04:58:15]   Restored version: 20160201181320
[2016-02-04 04:58:15] Extracting dump file...
[2016-02-04 04:58:15] Restoring dump file... (can be quite long)
[2016-02-04 04:58:15] SET
[2016-02-04 04:58:15] SET
[2016-02-04 04:58:15] SET
[2016-02-04 04:58:15] SET
[2016-02-04 04:58:15] SET
[2016-02-04 04:58:15] SET
[2016-02-04 04:58:15] DROP SCHEMA
[2016-02-04 04:58:15] psql:/var/www/discourse/tmp/restores/discourse_instance3/2016-02-04-045815/dump.sql:16: ERROR:  permission denied for database discourse_dbase3
[2016-02-04 04:58:15] psql:/var/www/discourse/tmp/restores/discourse_instance3/2016-02-04-045815/dump.sql:16: ERROR:  current transaction is aborted, commands ignored until end of transaction block

Needs to be figured before can go production.


#5

Issue has been resolved; incorrect YAML


(Jeff Atwood) #6

@neil is still working on this problem


#7

I got it working tested 3 instance multisite just a few ago.


each 1 was 1.2GB, a week apart db, no issues.


(Michael - DiscourseHosting.com) #8

We’ve seen this as well lately - restarting Discourse immediately showed the restored data. Something seems to have changed here.