django.db.migrations.graph.NodeNotFoundError:

303 views
Skip to first unread message

Bose Yi

unread,
May 31, 2016, 6:58:55 PM5/31/16
to Django users

When new project start,   commands makemigrations and runserver  get  error message.    I do not know what I did wrong.   I cannot find solution to fix it.  Please  any suggestion ? 


------------------------------------------------------------------------------------------------------------------------------------------------------------------------

System check identified no issues (0 silenced).

Unhandled exception in thread started by <function wrapper at 0x0391B9B0>

Traceback (most recent call last):

  File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper

    fn(*args, **kwargs)

  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run

    self.check_migrations()

  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 168, in check_migrations

    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])

  File "C:\Python27\lib\site-packages\django\db\migrations\executor.py", line 19, in __init__

    self.loader = MigrationLoader(self.connection)

  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 47, in __init__

    self.build_graph()

  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 318, in build_graph

    _reraise_missing_dependency(migration, parent, e)

  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 288, in _reraise_missing_dependency

    raise exc

django.db.migrations.graph.NodeNotFoundError: Migration auth.0007_user_following dependencies reference nonexistent parent node (u'account', u'0003_contact')

skerdi

unread,
Dec 22, 2016, 8:33:48 PM12/22/16
to Django users
I have the same problem, but with an existing project. I've deleted migrations and the database and shows the same problem.
I have 2+ hours searching but I haven't fixed it. 

Collin Anderson

unread,
Dec 23, 2016, 11:27:06 PM12/23/16
to Django users
Hi,

Do you want to copy and paste your error message? (I assume it's similar, but it might have some better clues.)

My guess you have a migration that's referencing a migration file that was deleted or something.

Collin

skerdi

unread,
Dec 24, 2016, 6:44:39 AM12/24/16
to Django users
I solved it. 
The error message is in the previous comment. 
When I deleted the database and the migrations, somehow Migration auth.0007_user_following was created or remained (???) and was referencing with the migrate command(creating the database).
I found and deleted it.
Reply all
Reply to author
Forward
0 new messages