Probleem met herstellen: functie "mirror_topic_timers_topic_id" bestaat al met dezelfde argumenttypen

I’m trying to restore a production database from 04dbc622ab1e0197d16703ba47cf005ec93697ee to a development site f608e0cd7e7d4785b3ecb401999cfb837cfbe783

I’m getting these errors:

Failed to migrate database.                                                                                                                           [90/9045]
Ignoring db/schema_cache.yml because it has expired. The current schema version is 20250724012518, but the one in the schema cache file is 20250916082012.
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)

PG::DuplicateFunction: ERROR:  function "mirror_topic_timers_topic_id" already exists with same argument types
/home/pfaffman/src/discourse-repos/discourse/lib/migration/safe_migrate.rb:107:in `async_exec'
/home/pfaffman/src/discourse-repos/discourse/db/migrate/20250902014817_add_timerable_id_to_topic_timer.rb:15:in `up'
/home/pfaffman/src/discourse-repos/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/home/pfaffman/src/discourse-repos/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/home/pfaffman/src/discourse-repos/discourse/lib/migration/safe_migrate.rb:28:in `migrate'
/home/pfaffman/src/discourse-repos/discourse/lib/migration/safe_migrate.rb:53:in `migrate'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/db.rake:267:in `block (2 levels) in <main>'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/db.rake:242:in `block in <main>'

Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateFunction: ERROR:  function "mirror_topic_timers_topic_id" already exists with same argument types (ActiveRecord::S
tatementInvalid)
/home/pfaffman/src/discourse-repos/discourse/lib/migration/safe_migrate.rb:107:in `async_exec'
/home/pfaffman/src/discourse-repos/discourse/db/migrate/20250902014817_add_timerable_id_to_topic_timer.rb:15:in `up'
/home/pfaffman/src/discourse-repos/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/home/pfaffman/src/discourse-repos/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/home/pfaffman/src/discourse-repos/discourse/lib/migration/safe_migrate.rb:28:in `migrate'
/home/pfaffman/src/discourse-repos/discourse/lib/migration/safe_migrate.rb:53:in `migrate'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/db.rake:267:in `block (2 levels) in <main>'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/db.rake:242:in `block in <main>'

I think it might have to do with this:

1 like

Heb hetzelfde probleem (1e42f55be0 tot 452e5064c9).

1 like

Ik zal er vandaag naar kijken.

3 likes

Gek, ik heb net alles voorbereid in mijn dev-versie, mijn eerste Discourse-installatie, was het net van plan te importeren in mijn vers geïnstalleerde live-versie en kreeg precies deze fout. En het enige resultaat op Google is dit 5 uur oude bericht. Hopelijk wordt het opgelost zodat ik kan lanceren.

1 like

Je zou kunnen proberen te starten met de commit vóór degene die hier wordt vermeld.

Je moet de bestaande database verwijderen, opnieuw opbouwen met de vorige commit en waarschijnlijk de herstelactie uitvoeren.

En 5 uur is behoorlijk goede SEO.

I’ve opened a PR with a fix and am getting it reviewed ASAP.

5 likes

En het werd al snel na dit bericht samengevoegd!

3 likes

Dit onderwerp werd automatisch gesloten 7 dagen na het laatste antwoord. Nieuwe antwoorden zijn niet meer toegestaan.