Opened 8 years ago

Closed 8 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:2 by Christopher Neugebauer, 8 years ago

Cc: _@… added

comment:3 by Tim Graham, 8 years ago

Has patch: set
Needs tests: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Also confirmed in #26490 (closed that as a duplicate).

comment:4 by Berker Peksag, 8 years ago

Needs tests: unset
Owner: changed from nobody to Berker Peksag
Status: newassigned

comment:5 by Claude Paroz, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 93deb16:

Fixed #26492 -- Fixed "maximum recursion depth exceeded" migrate error.

A regression introduced in 0d3c616fbb2f49fa7ff6809e5a6777275352b35b;
refs #26351.

Note: See TracTickets for help on using tickets.
Back to Top