Opened 10 years ago
Closed 10 years ago
#26492 closed Bug (fixed)
"./manage.py migrate" causes "maximum recursion depth exceeded" error
| Reported by: | Berker Peksag | Owned by: | Berker Peksag |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Release blocker | Keywords: | |
| Cc: | Berker Peksag, _@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
With the latest master (0247c9b08f8da4a2d93b9cede6c615011552b55a), I'm getting the following exception:
[snipped]
File "/home/berker/projects/django/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self).check(**kwargs))
File "/home/berker/projects/django/django/core/management/base.py", line 385, in check
include_deployment_checks=include_deployment_checks,
File "/home/berker/projects/django/django/core/management/commands/migrate.py", line 61, in _run_checks
issues = run_checks(tags=[Tags.database])
File "/home/berker/projects/django/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/berker/projects/django/django/core/checks/database.py", line 9, in check_database_backends
for conn in connections.all():
File "/home/berker/projects/django/django/db/utils.py", line 226, in all
return [self[alias] for alias in self]
RuntimeError: maximum recursion depth exceeded
I created a sample project to demonstrate the bug: https://bitbucket.org/berkerpeksag/django-bug You can see the full output of ./manage.py migrate at https://bitbucket.org/berkerpeksag/django-bug/src/b527f36d15c4e68168621dd39db164a8beaf905e/tdj/log.txt?at=master&fileviewer=file-view-default
The project is simple. I only created a model: https://bitbucket.org/berkerpeksag/django-bug/src/b527f36d15c4e68168621dd39db164a8beaf905e/tdj/polls/models.py?at=master&fileviewer=file-view-default
I believe the cause of the issue is at https://github.com/django/django/commit/0d3c616fbb2f49fa7ff6809e5a6777275352b35b#diff-e835ddfb52774b39749788a0d046e477R62 If I replace line 62 with
issues.extend(super(Command, self)._run_checks(**kwargs))
it works as expected.
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Cc: | added |
|---|
comment:3 by , 10 years ago
| Has patch: | set |
|---|---|
| Needs tests: | set |
| Severity: | Normal → Release blocker |
| Triage Stage: | Unreviewed → Accepted |
Also confirmed in #26490 (closed that as a duplicate).
comment:4 by , 10 years ago
| Needs tests: | unset |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:5 by , 10 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
A simple fix (without tests) can be found at https://github.com/django/django/compare/master...berkerpeksag:26492-migrate-recursion