fix: move profiles SeaweedFS migration earlier and harden S3 lifecycle setup#4268
fix: move profiles SeaweedFS migration earlier and harden S3 lifecycle setup#4268aldy505 wants to merge 12 commits into
Conversation
Changelog Preview📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Deps
Other
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Fresh installs get incomplete config file from reordering
- This is a real bug, and the bootstrap script now only appends profiles config when
sentry/config.ymlalready exists, preventing accidental creation of an incomplete file on fresh installs.
- This is a real bug, and the bootstrap script now only appends profiles config when
Or push these changes by commenting:
@cursor push 1fd751e7f1
Preview (1fd751e7f1)
diff --git a/install/bootstrap-s3-profiles.sh b/install/bootstrap-s3-profiles.sh
--- a/install/bootstrap-s3-profiles.sh
+++ b/install/bootstrap-s3-profiles.sh
@@ -22,7 +22,7 @@
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 [[ -f "$SENTRY_CONFIG_YML" ]] && ! 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."
@@ -66,7 +66,7 @@
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
+ echo "$profiles_config" >>"$SENTRY_CONFIG_YML"
fi
fiThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
aminvakil
left a comment
There was a problem hiding this comment.
Maybe PR name should be changed to something like "Turn things off after vroom-seaweed migration" ?
The goal would be clearer.
Other than this nitpicking, I think this can fix the issue, but maybe other improvements can be added later on?
Maybe make it optional opt-out for users who do not care about their profiling data? So their data can be removed and make this faster?
Or add this to docs, something like docker compose down -v && docker volume rm sentry-self-hosted_sentry-vroom?
I don't like either of these two solutions I've written :)
|
Hey @aminvakil I personally hate this PR (strong word for myself). Previously there was a decent command on I'm asking you for a re-review as the Bash wizard in our circle :D |
aminvakil
left a comment
There was a problem hiding this comment.
I think we should print all commands for users if we want to instruct them to do manual work.
Although I seriously doubt they will read install.sh output all the time :)
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Amin Vakil <info@aminvakil.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1e0f323. Configure here.
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Amin Vakil <info@aminvakil.com>


Closes #4263
install.sh:ensure-correct-permissions-profiles-dir.shbootstrap-s3-profiles.shbootstrap-s3-profiles.sh:$SENTRY_CONFIG_YMLwhen the file existsprofileslifecyclesetlifecyclebootstrap-s3-nodestore.sh:nodestorelifecyclesetlifecycleGoal: avoid installer hangs and ensure migration ordering is correct