-
-
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 flow #36868
Comments
Thank you for reporting this! This looks like an issue in Sentry itself, so I am going to move this issue there for the proper team to look into. |
Routing to @getsentry/app-backend for triage. ⏲️ |
Ah, it seems that in #22341 we changed things to write in text mode, perhaps we can/should read in text mode too? (I'm unsure of the invariants here, mostly thinking out loud). |
Facing the same issue in the middle of moving sentry. Any news here? |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Trying to move a self-hosted Sentry server 22.9.0, we have the same issue, but not on the same field: |
@sraillard you have to fix the file manually... Find the |
I have tried to add double quotes to all values but, there are other issues. For example, for the "sentry:install-id" option, I have this JSON in my file:
And here is the content of the Postgres table:
But I have this error when trying the import:
The sentry:install-id key is existing in the database, as shown above, if the import script works correctly it should ignore or update the value (and the value is the same as in the JSON file...) Edit: the id isn't the same in the datatabase and in the JSON file (13<>3) Edit#2: it's finally working but ... it isn't an easy path:
Final words: good luck to everybody who try to import/export Sentry settings... it may work, or not. |
Yeah, I did struggle a lot with this too |
what a struggle to restore a backup, never seen anything like this before 🤦 |
Yes, just exporting/importing the most important information isn't that easy (at least to keep the users and the projects settings with their DSN). The Sentry version should be the same on exporting and importing servers. I have started from a clean Sentry installation, done the basic setup then I imported the backup. Before importing the backup, the JSON has been modified:
Hope it may help |
Why is this issue still jot fixed after months? Backup/restore functionality is important and it's completely broken now, i.e. there is no way to restore a backup automatically without spending hours fixing backup file manually. Can you please raise issue priority? |
@getsentry/app-backend would anyone be able to chime in here 🤔? |
I'll attempt to reproduce and investigate this issue |
Update on this, the @getsentry/open-source team will be taking over maintenance of the backup/restore functionality but we've got a few other projects on our plate before we can focus on this. Maybe next quarter? |
We also should make sure to add tests around backup/restore to our end-to-end tests when we take this on. |
While backup still not work as expected, I wrote quick script that makes auto-fix for sentry-generated backup.json file. https://gist.github.com/Cactiw/c2397561966e2f343b0563a6c5b7f17f |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Seems like backup and restore is working in |
The deserialization error should now be resolved in the latest image that will be published shortly |
@hubertdeng123 Hi! |
@xSirrioNx Oh drat. Is it because there are still headers in the backup file? That is something I'm aware of but the deserialization errors should now be fixed. |
No, unqoted fields again
PS: I upgrade new instance from 23.1.1 to 23.2.0 through |
^^ Sounds like the |
@xSirrioNx I've just double checked the backup/restore process with my own setup on 23.2.0 and it isn't giving me Deserialization errors anymore. I actually got the same error as you when I checked out 23.1.1. Are you sure you're on 23.2.0? |
@hubertdeng123 |
@xSirrioNx Great to hear 😁 |
I'm going to close this since the |
Self-Hosted Version
22.7.0
CPU Architecture
x86_64
Docker Version
Docker version 20.10.11, build dea9396
Docker Compose Version
docker-compose version 1.29.2, build unknown
Steps to Reproduce
Following to the doc https://develop.sentry.dev/self-hosted/backup/
docker-compose run --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export > sentry/backup.json
docker-compose run --rm -T web import /etc/sentry/backup.json
Expected Result
Valid backup.json file
Actual Result
First, the
backup.json
contains the following headersAfter removing the logs in backup.json, I still have following error:
Workaround:
We can see
DeserializationError: Input string must be text, not bytes: (sentry.option:pk=1) field_value was 'False'
. If I check thebackup.json
file and search forsentry.option:pk=1
we have:I need to change
false
=>"false"
manually according to the error. Then you can try the restore command again, you'll pick the nextDeserializationError
and fix it manually until it works.The text was updated successfully, but these errors were encountered: