Migration from 9.1.2 to 21.5.0 fails with UnicodeDecodeError

Hi everyone, we are currently in the process of updating our Sentry server from 9.1.2 to the newest version using the “hard stops” as described in the upgrading guide but the update is failing due to errors during the migration.

To give a bit of background information: we have a custom crash reporting setup which consists of a Sentry 9.1.2 on premise installation and a self written proxy server which converts the crash reports of our app into the Sentry format and then forwards the reports to our Sentry server. This is a workaround we had to do to support crashreporting with iOS symbolication for our Xamarin apps for iOS, Android and UWP.

When we now try to update from 9.1.2 to 21.5.0 we get the following error multiple times when the migrations are executed and after the migration almost all of the previous data seems to be lost:

[ERROR] sentry.runner.initializer: django.compat.model-unpickle-compat (model_id=('sentry', 'Team') attrs=[] factory=<function __simple_class_factory_compat at 0x7efec02daea0>)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sentry/monkey/pickle.py", line 213, in py3_compat_pickle_loads
    return original_pickle_loads(*args, **kwargs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 1: ordinal not in range(128)

Does anyone know what the issue is and can point us in the right direction?