jazzband / django-oauth-toolkit

OAuth2 goodies for the Djangonauts!
https://django-oauth-toolkit.readthedocs.io
Other
3.16k stars 793 forks source link

migrate to 3.0.1 error #1526

Closed duanhongyi closed 2 weeks ago

duanhongyi commented 2 weeks ago

DEBUG DROP INDEX IF EXISTS "oauth2_provider_accesstoken_token_8af090f8_like"; (params None) Traceback (most recent call last): File "/workspace/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/psycopg/cursor.py", line 732, in execute raise ex.with_traceback(None) psycopg.errors.UndefinedColumn: column oauth2_provider_accesstoken.token_checksum does not exist LINE 1: ...id", "oauth2_provider_accesstoken"."id_token_id", "oauth2_pr... ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/workspace/manage.py", line 21, in main() File "/workspace/manage.py", line 17, in main execute_from_command_line(sys.argv) File "/workspace/.venv/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line utility.execute() File "/workspace/.venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/workspace/.venv/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv self.execute(*args, cmd_options) File "/workspace/.venv/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute output = self.handle(*args, *options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/core/management/base.py", line 106, in wrapper res = handle_func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 356, in handle post_migrate_state = executor.migrate( ^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate state = self._migrate_all_forwards( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards state = self.apply_migration( ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 252, in apply_migration state = migration.apply(state, schema_editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply operation.database_forwards( File "/workspace/.venv/lib/python3.12/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards self.code(from_state.apps, schema_editor) File "/workspace/.venv/lib/python3.12/site-packages/oauth2_provider/migrations/0012_add_token_checksum.py", line 13, in forwards_func for accesstoken in accesstokens: ^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 398, in iter self._fetch_all() File "/workspace/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1881, in _fetch_all self._result_cache = list(self._iterable_class(self)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 91, in iter results = compiler.execute_sql( ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql cursor.execute(sql, params) File "/workspace/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers return executor(sql, params, many, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 84, in _execute with self.db.wrap_database_errors: File "/workspace/.venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/workspace/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/.venv/lib/python3.12/site-packages/psycopg/cursor.py", line 732, in execute raise ex.with_traceback(None) django.db.utils.ProgrammingError: column oauth2_provider_accesstoken.token_checksum does not exist LINE 1: ...id", "oauth2_provider_accesstoken"."id_token_id", "oauth2_pr... ^

duanhongyi commented 2 weeks ago

Ignoring it is caused by the delay in PostgreSQL read-write separation.