Error: Can't notify admin while restoring backup during a migration to a fresh install

Continuing the discussion from Move your Discourse Instance to a Different Server:

after installing discourse on a new server, registering a new admin (with the same username as the old admin), and restoring backups, everything goes well till the end, and then I got this error:

[2020-01-24 07:06:47] Notifying 'padpors' of the end of the restore... [2020-01-24 07:06:47] Something went wrong while notifying user.

as a result the backup can not be restored.

1개의 좋아요

I got another backup from the site, and tried to restore it via terminal using this howto: Restore a backup from the command line. but then at the end of the restore, I got the same error in the terminal:

Notifying 'system' of the end of the restore...
Something went wrong while notifying user.
Finished!
[FAILED]
Restore done.

since the backups were fine, I guess this is a bug.

6개의 좋아요

@gerhard any idea what might be causing this issue?

7개의 좋아요

There have been lots of changes to backup/restore code lately. Are you on latest?

2개의 좋아요

I see this error all the time as well.
BUT… this error happens after the restore, and it finishes with SUCCESS. So it is an error, but it is certainly not causing restores to fail.

Unpausing sidekiq...
Marking restore as finished...
Notifying 'DHSupport' of the end of the restore...
Something went wrong while notifying user.
Finished!
[SUCCESS]

Are you sure there is not an error higher up?

6개의 좋아요

Looked into this a bit further.

#<NoMethodError: undefined method `join' for nil:NilClass>
Backtrace:
     lib/discourse.rb:45:in `pretty_logs'
     /var/www/discourse/lib/backup_restore/restorer.rb:134:in `notify_user'

Seems like @logs is not initialized?

7개의 좋아요

Yes, it is a very fresh install and updated install on both instances.

No other errors upward, but I will check again to be sure.

1개의 좋아요

you were right, here is the previous error:

ERROR:  could not create unique index "index_tags_on_lower_name"
DETAIL:  Key (lower(name::text))=(زبا�) is duplicated.
EXCEPTION: psql failed: DETAIL:  Key (lower(name::text))=(زبا�) is duplicated.

which I guess is already reported here: Can't restore due to corrupt indexes (with some clues on how to deal with corrupt indexes) and here There are some duplicated tags due to database corruption and I can't merge .

8개의 좋아요

https://github.com/discourse/discourse/commit/7c30986b5efe231d4b22ad3e657fc83ec452e89c

9개의 좋아요