Opened 10 years ago

Closed 10 years ago

#23021 closed Bug (duplicate)

Cannot migrate: KeyError: u"Dependency references nonexistent parent node (u'contenttypes', u'__last__')"

Reported by: artscoop Owned by: nobody
Component: Migrations Version: 1.7-rc-1
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello all,
I found a migration bug I cannot resolve. I wanted to create an initial migration for an app.
I called "makemigrations content". Everything ok (was broken in 1.7 RC1 but fixed in stable/1.7.x).
Then I tried to "migrate content --fake". Here's the whole output:

    Traceback (most recent call last):
      File "/home/artscoop/virtualenv/project/one/manage.py", line 8, in <module>
        execute_from_command_line(sys.argv)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
        utility.execute()
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute
        output = self.handle(*args, **options)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 63, in handle
        executor = MigrationExecutor(connection, self.migration_progress_callback)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 16, in __init__
        self.loader = MigrationLoader(self.connection)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 48, in __init__
        self.build_graph()
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 241, in build_graph
        self.graph.add_dependency(key, parent)
      File "/home/artscoop/virtualenv/project/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 42, in add_dependency
        raise KeyError("Dependency references nonexistent parent node %r" % (parent,))
    KeyError: u"Dependency references nonexistent parent node (u'contenttypes', u'__last__')"

On 13 models, 4 have a generic foreign key (a "contenttypes.ContentType" foreign key).

Change History (1)

comment:1 by Tim Graham, 10 years ago

Resolution: duplicate
Status: newclosed

Seems like a duplicate of #23008.

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