-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(backup/restore): Warn users of integrity violations during backup/restore #44705
fix(backup/restore): Warn users of integrity violations during backup/restore #44705
Conversation
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
a8c4a39
to
631a10e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
src/sentry/runner/commands/backup.py
Outdated
# these errors come from restoring on a different version of Sentry or not restoring | ||
# on a clean install. | ||
except IntegrityError as e: | ||
warningText = ">> Are you restoring from a backup of the same version of Sentry?\n>> Are you restoring onto a clean database?\n>> https://github.com/getsentry/sentry/issues/new/choose" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I was unclear, if we have the link we should also have the "if neither, then open an issue here:" text. 🐭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah added 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
822129c
to
82c178b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Some users are getting this error when restoring from a backup
We should wrap the model saves in one single atomic transaction so that none of the data is saved if an error happens. On integrity error, let's warn users to use a clean db.
Also added some quick tests are backup/restore logic to make sure it doesn't error out