An automatic rebuild failed due to a duplicate key error on the post_hotlinked_media table, introduced by a recent migration commitaxfelix. david confirmed the issue and quickly pushed a fix PR #16611, which axfelix confirmed resolved the problem after tests passed. A second fix commit was later deployed to address remaining edge cases. Separately, pfaffman reported migration failures when restoring older backups, which david addressed with another PR #16624. pfaffman confirmed the restore succeeded after the fix. The issue was resolved through rapid collaboration and iterative patches.
Do I need to do anything special to pull this down? I’m still getting Caused by: ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_post_hotlinked_media_on_post_id_and_url_md5" when running a launcher rebuild, even after doing a Docker prune.
On my development instance it does successfully migrate the database, but if I restore a backup from 2022-04-27-153103-v20220407195246.tar.gz it fails:
[361/9020]
Migrating the database... EXCEPTION: /home/pfaffman/src/discourse-repos/discourse/lib/discourse.rb:126:in `exec': Failed to migrat
e database.
Ignoring /home/pfaffman/src/discourse-repos/discourse/db/schema_cache.yml because it has expired. The cu
rrent schema version is 20220407195246, but the one in the schema cache file is 20220428094027.
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
followed by some more of that with some of these:
ActiveRecord::StatementInvalid: PG::DuplicateObject: ERROR: type "hotlinked_media_status" already exist