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

AI-generated summary

A user, Pad_Pors, encountered an error while restoring a backup during a migration to a fresh install of Discourse. The error message indicated a problem with notifying the admin, Something went wrong while notifying user. Despite this error, the restore process appeared to complete successfully. RGJ pointed out that this error may not be the cause of the restore failure, as it occurs after the restore is finished. Further investigation by RGJ revealed a NoMethodError that may be related to the issue. Pad_Pors later discovered a previous error related to a duplicated index, which may be the root cause of the problem. gerhard provided a link to a GitHub commit that may be relevant to the issue.

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 Like

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 Likes

@gerhard any idea what might be causing this issue?

7 Likes

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

2 Likes

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 Likes

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 Likes

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 Like

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 Likes

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

9 Likes