Skip to content

Commit

Permalink
Fix groupedmessage indexing error (#2777)
Browse files Browse the repository at this point in the history
* fix groupedmessage indexing error
  • Loading branch information
hubertdeng123 committed Feb 8, 2024
1 parent de9f52f commit 2346a69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions install/set-up-and-migrate-database.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
echo "${_group}Setting up / migrating database ..."

# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
$dc up -d postgres
timeout 90s bash -c "until $dc exec postgres pg_isready ; do sleep 5 ; done"
indexes=$($dc exec postgres psql -qAt -U postgres -c "SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'sentry_groupedmessage';")
if [[ $indexes == *"sentry_groupedmessage_project_id_id_515aaa7e_uniq"* ]]; then
$dc postgres psql -qAt -U postgres -c "DROP INDEX sentry_groupedmessage_project_id_id_515aaa7e_uniq;"

This comment has been minimized.

Copy link
@cadmi

cadmi Feb 9, 2024

the exec command is missing

must be $dc exec postgres psql ...

fi

if [[ -n "${CI:-}" || "${SKIP_USER_CREATION:-0}" == 1 ]]; then
$dcr web upgrade --noinput
echo ""
Expand Down

0 comments on commit 2346a69

Please sign in to comment.