From 4ce0b832b051225d6f56441c9b2c2d3e67eec33c Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 8 Apr 2026 09:17:44 +0700 Subject: [PATCH 1/4] fix: move vroom-seaweed migration upwards Closes https://github.com/getsentry/self-hosted/issues/4263 --- install.sh | 4 ++-- install/bootstrap-s3-profiles.sh | 1 + install/migrate-s3-profiles.sh | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 install/migrate-s3-profiles.sh diff --git a/install.sh b/install.sh index fb41671798e..643e1e6da1a 100755 --- a/install.sh +++ b/install.sh @@ -29,6 +29,8 @@ source install/check-minimum-requirements.sh # in order to determine whether or not the clickhouse version needs to be upgraded. source install/upgrade-clickhouse.sh source install/update-docker-images.sh +source install/ensure-correct-permissions-profiles-dir.sh +source install/bootstrap-s3-profiles.sh source install/turn-things-off.sh source install/create-docker-volumes.sh source install/ensure-files-from-examples.sh @@ -39,8 +41,6 @@ source install/build-docker-images.sh source install/bootstrap-s3-nodestore.sh source install/bootstrap-snuba.sh source install/upgrade-postgres.sh -source install/ensure-correct-permissions-profiles-dir.sh -source install/bootstrap-s3-profiles.sh source install/set-up-and-migrate-database.sh source install/migrate-pgbouncer.sh source install/geoip.sh diff --git a/install/bootstrap-s3-profiles.sh b/install/bootstrap-s3-profiles.sh index 447570a9d22..10d8d829407 100644 --- a/install/bootstrap-s3-profiles.sh +++ b/install/bootstrap-s3-profiles.sh @@ -84,6 +84,7 @@ if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then $dc exec vroom sh -c 's3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=seaweedfs:8333 --host-bucket="seaweedfs:8333/%(bucket)" sync /var/vroom/sentry-profiles/ s3://profiles/' echo "Migration completed." + $dc exec vroom sh -c 'rm -rf /var/vroom/sentry-profiles/*' else echo "No files found in 'sentry-vroom' volume. Skipping files migration." fi diff --git a/install/migrate-s3-profiles.sh b/install/migrate-s3-profiles.sh new file mode 100644 index 00000000000..e87dac06a93 --- /dev/null +++ b/install/migrate-s3-profiles.sh @@ -0,0 +1,4 @@ +if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then + echo "${_group}Migrating profiles data from sentry-vroom volume to SeaweedFS..." + + From 6a246fa969c186b7d643c19d930bad1eab7f277e Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 8 Apr 2026 09:19:26 +0700 Subject: [PATCH 2/4] ref: remove unwanted file --- install/migrate-s3-profiles.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 install/migrate-s3-profiles.sh diff --git a/install/migrate-s3-profiles.sh b/install/migrate-s3-profiles.sh deleted file mode 100644 index e87dac06a93..00000000000 --- a/install/migrate-s3-profiles.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then - echo "${_group}Migrating profiles data from sentry-vroom volume to SeaweedFS..." - - From 737375566e6508ef2c9c1f2f9e11e1ff06404929 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 8 Apr 2026 14:46:09 +0700 Subject: [PATCH 3/4] fix: create volume first --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 643e1e6da1a..01bc76b15f4 100755 --- a/install.sh +++ b/install.sh @@ -29,10 +29,10 @@ source install/check-minimum-requirements.sh # in order to determine whether or not the clickhouse version needs to be upgraded. source install/upgrade-clickhouse.sh source install/update-docker-images.sh +source install/create-docker-volumes.sh source install/ensure-correct-permissions-profiles-dir.sh source install/bootstrap-s3-profiles.sh source install/turn-things-off.sh -source install/create-docker-volumes.sh source install/ensure-files-from-examples.sh source install/check-memcached-backend.sh source install/ensure-relay-credentials.sh From 96315ae2cf8d4e22bfe672b5ccd6d1b65800342a Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 8 Apr 2026 15:08:14 +0700 Subject: [PATCH 4/4] fix: ensure sentry config exists --- install/bootstrap-s3-profiles.sh | 91 ++++++++++++++++---------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/install/bootstrap-s3-profiles.sh b/install/bootstrap-s3-profiles.sh index 10d8d829407..5b3c82487ec 100644 --- a/install/bootstrap-s3-profiles.sh +++ b/install/bootstrap-s3-profiles.sh @@ -21,55 +21,57 @@ if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then if ! echo "$bucket_list" | grep -q "s3://profiles"; then apply_config_changes_profiles=0 - # Only touch if no existing profiles config is found - if ! grep -q "filestore.profiles-backend" $SENTRY_CONFIG_YML; then - if [[ -z "${APPLY_AUTOMATIC_CONFIG_UPDATES:-}" ]]; then - echo - echo "We are migrating the Profiles data directory from the 'sentry-vroom' volume to SeaweedFS." - echo "This migration will ensure profiles ingestion works correctly with the new 'vroomrs'" - echo "and allows both 'sentry' and 'vroom' to transition smoothly." - echo "To complete this, your sentry/config.yml file needs to be modified." - echo "Would you like us to perform this modification automatically?" - echo + # Ensure `$SENTRY_CONFIG_YML` file exists + if [[ -f "$SENTRY_CONFIG_YML" ]]; then + # Only touch if no existing profiles config is found + if ! grep -q "filestore.profiles-backend" $SENTRY_CONFIG_YML; then + if [[ -z "${APPLY_AUTOMATIC_CONFIG_UPDATES:-}" ]]; then + echo + echo "We are migrating the Profiles data directory from the 'sentry-vroom' volume to SeaweedFS." + echo "This migration will ensure profiles ingestion works correctly with the new 'vroomrs'" + echo "and allows both 'sentry' and 'vroom' to transition smoothly." + echo "To complete this, your sentry/config.yml file needs to be modified." + echo "Would you like us to perform this modification automatically?" + echo - yn="" - until [ ! -z "$yn" ]; do - read -p "y or n? " yn - case $yn in - y | yes | 1) - export apply_config_changes_profiles=1 - echo - echo -n "Thank you." - ;; - n | no | 0) - export apply_config_changes_profiles=0 - echo - echo -n "Alright, you will need to update your sentry/config.yml file manually before running 'docker compose up'." - ;; - *) yn="" ;; - esac - done + yn="" + until [ ! -z "$yn" ]; do + read -p "y or n? " yn + case $yn in + y | yes | 1) + export apply_config_changes_profiles=1 + echo + echo -n "Thank you." + ;; + n | no | 0) + export apply_config_changes_profiles=0 + echo + echo -n "Alright, you will need to update your sentry/config.yml file manually before running 'docker compose up'." + ;; + *) yn="" ;; + esac + done - echo - echo "To avoid this prompt in the future, use one of these flags:" - echo - echo " --apply-automatic-config-updates" - echo " --no-apply-automatic-config-updates" - echo - echo "or set the APPLY_AUTOMATIC_CONFIG_UPDATES environment variable:" - echo - echo " APPLY_AUTOMATIC_CONFIG_UPDATES=1 to apply automatic updates" - echo " APPLY_AUTOMATIC_CONFIG_UPDATES=0 to not apply automatic updates" - echo - sleep 5 - fi + echo + echo "To avoid this prompt in the future, use one of these flags:" + echo + echo " --apply-automatic-config-updates" + echo " --no-apply-automatic-config-updates" + echo + echo "or set the APPLY_AUTOMATIC_CONFIG_UPDATES environment variable:" + echo + echo " APPLY_AUTOMATIC_CONFIG_UPDATES=1 to apply automatic updates" + echo " APPLY_AUTOMATIC_CONFIG_UPDATES=0 to not apply automatic updates" + echo + sleep 5 + fi - if [[ "$APPLY_AUTOMATIC_CONFIG_UPDATES" == 1 || "$apply_config_changes_profiles" == 1 ]]; then - profiles_config=$(sed -n '/filestore.profiles-backend/,/s3v4"/{p}' sentry/config.example.yml) - echo "$profiles_config" >>$SENTRY_CONFIG_YML + if [[ "$APPLY_AUTOMATIC_CONFIG_UPDATES" == 1 || "$apply_config_changes_profiles" == 1 ]]; then + profiles_config=$(sed -n '/filestore.profiles-backend/,/s3v4"/{p}' sentry/config.example.yml) + echo "$profiles_config" >>$SENTRY_CONFIG_YML + fi fi fi - $s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' mb s3://profiles # Check if there are files in the sentry-vroom volume @@ -84,7 +86,6 @@ if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then $dc exec vroom sh -c 's3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=seaweedfs:8333 --host-bucket="seaweedfs:8333/%(bucket)" sync /var/vroom/sentry-profiles/ s3://profiles/' echo "Migration completed." - $dc exec vroom sh -c 'rm -rf /var/vroom/sentry-profiles/*' else echo "No files found in 'sentry-vroom' volume. Skipping files migration." fi