open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
34 stars 25 forks source link

Upgrade 2.2.1 to 2.3.0 fails #3533

Closed sjoerdie closed 11 months ago

sjoerdie commented 11 months ago

Product versie / Product version

2.2.1

Omschrijf het probleem / Describe the bug

Reported by Sander on behalf of Gemeente Assen. When upgrading:

Operations to perform:
Apply all migrations: accounts, admin, admin_index, analytics_tools, appointments, auth, authentication_digid, authentication_eherkenning, authtoken, axes, bag, brp, config, contenttypes, cookie_consent, cspreports, custom_field_types, digid_eherkenning, digid_eherkenning_oidc_generics, django_camunda, django_yubin, emails, forms, jcc, kadaster, kvk, log_outgoing_requests, logging, microsoft, mozilla_django_oidc_db, multidomain, np_family_members, of_authentication, otp_static, otp_totp, payments, payments_ogone, prefill, prefill_haalcentraal, products, qmatic, registrations_email, registrations_microsoft_graph, registrations_objects_api, sessions, simple_certmanager, soap, stuf, stuf_bg, stuf_zds, submissions, timeline_logger, two_factor, upgrades, variables, zgw_apis, zgw_consumers

Running migrations:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
psycopg2.errors.DuplicateTable: relation "appointments_appointment" already exists

Stappen om te reproduceren / Steps to reproduce

No response

Verwacht gedrag / Expected behavior

No response

Screen resolution

None

Device

None

OS

None

Browser

No response

sergei-maertens commented 11 months ago

This sounds like multiple replica's are racing each other to execute the migrations to me, can you confirm?

sjoerdie commented 11 months ago

Verified, he is using one replica.

joeribekker commented 11 months ago

Refinement: @sergei-maertens will check the migration history because we suspect they didn't follow a proper update path. It could be a migration order issue but will be investigated.

sergei-maertens commented 11 months ago

Took a look, couldn't find anything obvious except that this particular instance looks beyond recovery. I could not find a structural problem with our code and other instances are fine too.