-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Restore feature not working - django.core.serializers.base.DeserializationError #1865
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
Comments
Did you check the output of the generated JSON file? It seems that something expected is missing. |
I am not an expert on json syntax, it looks good enough to me. jq reports some errors. Here are some snippets :
|
I removed the top part from backup.json, starting now with this: now I get more specific error: `13:44:04 [INFO] sentry.plugins.github: apps-not-configured During handling of the above exception, another exception occurred: Traceback (most recent call last): I can see this entry in backup.json, but not sure what could be wrong with it: |
Thanks for digging into that! In that case, I believe this might be the same as getsentry/sentry#36868 I will close this in favor of that issue. Unfortunately right now we don't have the bandwidth to fix the backup, but we likely will tackle it Q1. |
Self-Hosted Version
22.12.0.dev0+99926859321bd1f82d1ac4b07bc8601e3d78b9c9
CPU Architecture
x86_64
Docker Version
20.10.21
Docker Compose Version
1.29.2
Steps to Reproduce
docker-compose run --rm -T web import /etc/sentry/backup.json
Starting sentry-self-hosted_symbolicator_1 ... done
Starting sentry-self-hosted_postgres_1 ... done
Starting sentry-self-hosted_zookeeper_1 ... done
Starting sentry-self-hosted_clickhouse_1 ... done
Starting sentry-self-hosted_memcached_1 ... done
Starting sentry-self-hosted_smtp_1 ... done
Starting sentry-self-hosted_redis_1 ... done
Starting sentry-self-hosted_kafka_1 ... done
Starting sentry-self-hosted_snuba-subscription-consumer-transactions_1 ... done
Starting sentry-self-hosted_snuba-replacer_1 ... done
Starting sentry-self-hosted_snuba-sessions-consumer_1 ... done
Starting sentry-self-hosted_snuba-consumer_1 ... done
Starting sentry-self-hosted_snuba-api_1 ... done
Starting sentry-self-hosted_snuba-transactions-consumer_1 ... done
Starting sentry-self-hosted_snuba-outcomes-consumer_1 ... done
Starting sentry-self-hosted_snuba-subscription-consumer-events_1 ... done
Creating sentry-self-hosted_web_run ... done
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
15:06:27 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/serializers/json.py", line 68, in Deserializer
objects = json.loads(stream_or_string)
File "/usr/local/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/sentry", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/sentry/runner/init.py", line 192, in main
func(**kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/runner/decorators.py", line 29, in inner
return ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return _callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/runner/commands/backup.py", line 19, in import
for obj in serializers.deserialize("json", src, stream=True, use_natural_keys=True):
File "/usr/local/lib/python3.8/site-packages/django/core/serializers/json.py", line 73, in Deserializer
raise DeserializationError() from exc
django.core.serializers.base.DeserializationError
ERROR: 1
Unable to restore
Expected Result
Restore would finish OK and project data would be restored correctly
Actual Result
backup is not restored, producing error:
15:06:27 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/serializers/json.py", line 68, in Deserializer
objects = json.loads(stream_or_string)
File "/usr/local/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/sentry", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/sentry/runner/init.py", line 192, in main
func(**kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/runner/decorators.py", line 29, in inner
return ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return _callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/runner/commands/backup.py", line 19, in import
for obj in serializers.deserialize("json", src, stream=True, use_natural_keys=True):
File "/usr/local/lib/python3.8/site-packages/django/core/serializers/json.py", line 73, in Deserializer
raise DeserializationError() from exc
django.core.serializers.base.DeserializationError
ERROR: 1
Event ID
No response
The text was updated successfully, but these errors were encountered: