self-hosted
self-hosted copied to clipboard
Postgres issue while upgrading
Self-Hosted Version
24.4.2
CPU Architecture
x86_64
Docker Version
n/a
Docker Compose Version
n/a
Steps to Reproduce
Upgrading to 24.4.2+ is giving some users issues. This is taken from discord
- ./install.sh
- See error below
Running migrations for default
Operations to perform:
Apply all migrations: auth, contenttypes, feedback, hybridcloud, nodestore, replays, sentry, sessions, sites, social_auth
Running migrations:
Alert Rules: 100% |# | ETA: --:--:--
OK
Applying sentry.0702_alert_rule_project_backfill_migration_2... OK
Applying sentry.0703_add_team_user_to_rule... OK
Rules: 100% |##################################################| Time: 0:00:00
OK
Applying sentry.0705_grouphistory_add_userteam... OK
Group Historys: 100% |#########################################| Time: 0:00:00
OK
Applying sentry.0707_alert_rule_activations_incidents_fk... OK
Applying sentry.0708_rule_remove_owner_state... OK
Creating missing DSNs
Correcting Group.num_comments counter
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sentry/db/postgres/decorators.py", line 91, in inner
return func(self, sql, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sentry/db/postgres/base.py", line 84, in execute
return self.cursor.execute(sql, clean_bad_params(params))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.IndexCorrupted: table tid from new index tuple (20,3) overlaps with invalid duplicate tuple at offset 7 of block 8 in index "sentry_groupedmessage_logger_993cb6d5"
Expected Result
no error
Actual Result
error
Event ID
No response
Possible solution from Friberg on discord:
https://discord.com/channels/621778831602221064/796028405833007104/1235624852564611106
Didn't encountered the migration error when not using the alpine image (meaning continue using the debian image)
diff --git a/docker-compose.yml b/docker-compose.yml
index 9cc58dd..cb800ad 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -132,7 +132,7 @@ services:
postgres:
<<: *restart_policy
# Using the same postgres version as Sentry dev for consistency purposes
- image: "postgres:14.11-alpine"
+ image: "postgres:14.11"
healthcheck:
<<: *healthcheck_defaults
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
What @aldy505 posted worked for me as well
note you can create a docker.override.yml
file instead of editing docker-compose.yml directly (which is tracked)
docker.override.yml
services:
postgres:
# https://github.com/getsentry/self-hosted/issues/3014
image: "postgres:14.11"
Ref: #3027
Going to close this due to https://github.com/getsentry/self-hosted/pull/3116