I just upgraded Sentry from 9.1.2 to 20.12.1 on Kubernetes and it all worked fine.
However, when I try to change certain settings (like enabling SAML, among others), I get a server error. Looking at the sentry-web logs, it’s always the same;
Further digging revealed that sentry.url-prefix and sentry:latest_version both exist in the sentry_options table TWICE - both with the same ID as well.
The table also has no primary key, no other indices or anything, making it virtually impossible to delete 1 of 2 identical rows.
I think something went very wrong here during the migrations. Is there a way to fix this?
Some more;
SELECT "key", COUNT(*) FROM sentry_option GROUP BY "key" HAVING COUNT(*) > 1;
Also, if you delete all these values, I think some will be taken from the disk and you’ll be prompted for the others at your first admin login. I’d still take a backup of the table before trying the deletion option.
I eventually managed to fix this by installing a bare Sentry and importing the data into that DB while ignoring errors. It was a bit of a hassle, but it worked out.