Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres issue while upgrading #3014

Open
hubertdeng123 opened this issue May 2, 2024 · 2 comments
Open

Postgres issue while upgrading #3014

hubertdeng123 opened this issue May 2, 2024 · 2 comments

Comments

@hubertdeng123
Copy link
Member

hubertdeng123 commented May 2, 2024

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

  1. ./install.sh
  2. 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

@hubertdeng123
Copy link
Member Author

hubertdeng123 commented May 2, 2024

Possible solution from Friberg on discord:

https://discord.com/channels/621778831602221064/796028405833007104/1235624852564611106

@aldy505
Copy link
Collaborator

aldy505 commented May 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants