You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrations containing 0003_drop_pickle often fail. I recently noticed this happens when 0003 succeeds in a migration where another migration has failed, and running the migration again after fixing the other migration leads to this error.
Steps to reproduce
Migrate to 0003_drop_pickle after a previous call to migrate failed where 0003 succeeded in that migration.
System configuration
Django version: 5.1.1
Python version: 3.12
Django-Constance version: 4.1.1
Last line of stack trace
File "/app/.heroku/python/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/app/.heroku/python/lib/python3.12/site-packages/django/db/migrations/operations/special.py", line 196, in database_forwards
self.code(from_state.apps, schema_editor)
File "/app/.heroku/python/lib/python3.12/site-packages/constance/migrations/0003_drop_pickle.py", line 23, in migrate_pickled_data
constance.value = dumps(pickle.loads(b64decode(constance.value.encode()))) # noqa: S301
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_pickle.UnpicklingError: invalid load key, '\xb7'.
Django migrations failed
Constance table 'value' column values
{"type": "default", "value": ""}
gAJHP564UeuFHrgu
Workaround
Delete records with 'value' column containing JSON
The text was updated successfully, but these errors were encountered:
Describe the problem
Migrations containing 0003_drop_pickle often fail. I recently noticed this happens when 0003 succeeds in a migration where another migration has failed, and running the migration again after fixing the other migration leads to this error.
Steps to reproduce
Migrate to 0003_drop_pickle after a previous call to migrate failed where 0003 succeeded in that migration.
System configuration
Last line of stack trace
Constance table 'value' column values
Workaround
Delete records with 'value' column containing JSON
The text was updated successfully, but these errors were encountered: