Skip to content

New install hangs on 0012 migration #1591

@edmenendez

Description

@edmenendez

Describe the bug
When trying to run python manage.py migrate it gets stuck on oauth2_provider.0012_add_token_checksum

To Reproduce
Run python manage.py migrate the first time. It will get through all the migrations except 0012 where it gets stuck.

Expected behavior
Complete run of all the migrations and an "OK" after running 0012.

Version
3.0.1

  • I have tested with the latest published release and it's still a problem.
  • I have tested with the master branch and it's still a problem.

Additional context
Checking locks in postgres, I can see that the DROP INDEX IF EXISTS seems to be blocking the rest of the migration.

"pid","usename","state","query_start","query"
42784,"django","idle in transaction","2025-08-11 16:43:19.601059-06","DROP INDEX IF EXISTS ""oauth2_provider_accesstoken_token_8af090f8_like"""
44744,"django","active","2025-08-11 16:43:19.688369-06","SELECT ""oauth2_provider_accesstoken"".""id"", ""oauth2_provider_accesstoken"".""token"", ""oauth2_provider_accesstoken"".""expires"", ""oauth2_provider_accesstoken"".""scope"", ""oauth2_provider_accesstoken"".""application_id"", ""oauth2_provider_accesstoken"".""user_id"", ""oauth2_provider_accesstoken"".""created"", ""oauth2_provider_accesstoken"".""updated"", ""oauth2_provider_accesstoken"".""source_refresh_token_id"", ""oauth2_provider_accesstoken"".""id_token_id"", ""oauth2_provider_accesstoken"".""token_checksum"" FROM ""oauth2_provider_accesstoken"""
44584,"postgres","active","2025-08-11 16:43:23.006766-06","SELECT pid, usename, state, query_start, query 
FROM pg_stat_activity 
WHERE state != 'idle' AND query LIKE '%oauth2_provider%'
ORDER BY query_start;"```


Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions