Upgrade issues 9.1.2 to 21.6.3 (relation "auth_user" already exists)

We’re having issues upgrading from Sentry 9.1.2 to 21.6.3

It fails creating the table auth_user, because it already exists.
It seems like Sentry/Django has lost track of which migrations to run.

This is also kind of a special setup (of course).
As we need to do test the upgrade without too much disruption we’ve cloned the database and sentry-data to a new VM, where we’re testing the upgrade.

Timeline:

  • Make database dump (pg 9.6), import dump to new db (pg 13) - Everything looks fine, no errors
  • Clone config and sentry-data to new VM
  • run ./install.sh (9.1.2) - log in to web interface, verify everything looks ok. No errors in logs
  • clone 21.6.3, update config, run ./install.sh (log below)

I’ve also attached the tables django_migrations and south_migrationhistory (as I’ve seen these were mentioned in other issues)

Too much log for the body of this post, see attached gist for logs:

Very smart :slight_smile:

This might be the culprit of issues as we do not support beyond pg 9.6 yet. You will get errors at some point.

Let’s try again with pg 9.6 with the same procedure and see how it goes?

1 Like

Oh wow, did not know that! Thanks :smiley: !
Will try that

1 Like

Exactly the same error using PG 9.6 unfortunately :confused:

One more piece of information i forgot to mention, we are using a GCP postgres instance - not the docker container (it’s removed from the compose file). This has worked very well for us in 9.1.2.

Our upgrade docs look like they are missing a step. Could you try upgrading to 21.5.0 before going to 21.6.3?

21.6.3 no longer has the south to django migration code. Going to 21.5.0 first will let you get off of south migrations and onto django migrations. 21.6.3 is important to stop at as that release will get you past the last migration that was squashed in 21.7.0

2 Likes

Thanks!

9.1.2 → 21.5.0 → 21.6.3 → 21.8.0 worked like a charm.

Thank you for trying that. I’ll get the docs updated.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.