Here is the log, any suggestions for a workaround?
[2024-08-03 16:45:29] CREATE INDEX
[2024-08-03 16:45:29] CREATE INDEX
[2024-08-03 16:45:29] ERROR: function discourse_functions.raise_discourse_voting_category_settings_readonly() does not exist
[2024-08-03 16:45:29] EXCEPTION: psql failed: ERROR: function discourse_functions.raise_discourse_voting_category_settings_readonly() does not exist
I didn’t, the problem was the Post Voting Plugin was not installed. Interestingly, it was not enabled in the main site (just installed by default) but I guess that was enough to cause the error. Thanks.
I’m getting the same error on a development instance (where I just upgraded to pg16 to get the latest pgvector that was causing this retore to fail earlier) that I just git pulled.
I’ve added both post voting and topic voting (topic voting was on the source).
My inclination was to
DROP table discourse_voting_category_settings;
But then I needed to add CASCADE and I chickened out and tried restoring to staging.
On a staging site, if I try to restore the same database, I get this:
ERROR: type "hotlinked_media_status" already exists
EXCEPTION: psql failed: ERROR: type "hotlinked_media_status" already exists
/var/www/discourse/lib/backup_restore/database_restorer.rb:92:in `restore_dump'
/var/www/discourse/lib/backup_restore/database_restorer.rb:26:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:51:in `run'
That seems different. I forgot about it in the last three weeks but since then we had a few cases of backups failing to restore when the post voting plugin was not installed. So that’s a thing for sure.
But hotlinked_media_status is a core table from 2022… so that must be something different.
Well, I made sure that the dev instance has all of the plugins that the production site does and restored the backup there!
But the staging site, (that is missing the microsoft auth plugin for some reason, but that can’t be it, can it?!?!?!) still has the EXCEPTION: psql failed: ERROR: type "hotlinked_media_status" already exists problem.