Django: dependencies reference nonexistent parent node

nodenotfounderror django
0011_update_proxy_permissions
django-reset migrations
django messed up migrations
django migrations
django force migration
valueerror(could not find common ancestor of)
django migrations swappable_dependency

When I run the following command

python manage.py migrate

I receive this error from django so can't step forward in my practice:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/nikhil/testWeb-devEnv/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/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/nikhil/testWeb-devEnv/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/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 17, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 48, in __init__
    self.build_graph()
  File "/home/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 241, in build_graph
    self.graph.add_dependency(migration, key, parent)
  File "/home/nikhil/testWeb-devEnv/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 42, in add_dependency
    raise KeyError("Migration %s dependencies reference nonexistent parent node %r" % (migration, parent))
KeyError: u"Migration testBolt.0001_initial dependencies reference nonexistent parent node (u'delivery_boy', u'0004_auto_20150221_2011')"

How do I solve this problem?


Solution - 1

Remove pyc files from your migrations folder.

Solution - 2

Need to remove that reference from testBolt.0001_initial by editing migration file.

Solution - 3

  1. Remove the new changes from the models and run python manage.py migrate --fake

  2. Now again modify your models with new changes

  3. Run python manage.py makemigrations

  4. And then again run python manage.py migrate

NodeNotFoundError: Migration social_auth.0004_auto_20160423_0400 dependencies reference nonexistent parent node (u'default', u'  Home » Django » Django: dependencies reference nonexistent parent node Django: dependencies reference nonexistent parent node Posted by: admin December 9, 2017 Leave a comment


I had the same problem. In my case, because I played with migrations manually, I forgot to create __init__.py inside of migrations folder.

Migration dependencies reference nonexistent parent node #1430 2.12 * Python 2.7.9 * Django 1.11 * six 1.10.0 * social-auth-core 1.2.0  I have a problem with django migrations. I get this error: django.db.migrations.exceptions.NodeNotFoundError: Migration user.0050_merge_20170523_1254 dependencies reference nonexistent parent node ('user', '0049_auto_20170519_1934') I fix the errors, deleting some lines but after I fix all these errors, I get another:


I had a similar case, running django in windows in a virtual env. In my case the missing dependency was 0001_initial - which was definitely there in the migration folder.

The 'solution' was to remove the pyc files and do another migrate attempt.

in add_dependency raise KeyError("Dependency references nonexistent parent node %r" % (parent,)) KeyError: "Dependency references nonexistent parent  Django: dependencies reference nonexistent parent node reference nonexistent parent node %r" % (migration, parent)) KeyError: u"Migration testBolt.0001_initial


In my case, I had the .py extension in the dependency module name, like this:

dependencies = [
    ('dashboard', '0003_auto_20181024_0603.py'),
    ('auth', '__latest__'),
    ('contenttypes', '__latest__'),
]

I removed the .py, changing it to this

    ('dashboard', '0003_auto_20181024_0603')

and that fixed it.

When I run the following command python manage.py migrate. I receive this error from django so can't step forward in my practice: Traceback  Migration dependencies reference nonexistent parent node on AWS Elastic Beanstalk #100


KeyError: u"Migration testBolt.0001_initial dependencies reference nonexistent parent node (u'delivery_boy', u'0004_auto_20150221_2011')"

Remove

testBolt.0001_initial

then run migrate again

Solution – 1. Remove pyc files from your migrations folder. Solution – 2. Need to remove that reference from testBolt.0001_initial by editing  django.db.migrations.exceptions.NodeNotFoundError: Migration accounts.0016_add-api-keys dependencies reference nonexistent parent node (u'authtoken', u'0001_initial') #1048 Closed whedro opened this issue Apr 1, 2016 · 2 comments


Django: dependencies reference nonexistent parent node. likeanswer 2019-04-​24. When I run the following command python manage.py migrate. I receive this  But if A.2 is applied and A.3 is not, this migration set will fail to load with "django.db.migrations.exceptions.NodeNotFoundError: Migration A.3 dependencies reference nonexistent parent node ('B', '2')". When the loader iterates over all "replacing" migrations, it finds B.1_squashed_2.


I get the folloing error : ```log django.db.migrations.exceptions. dependencies reference nonexistent parent node ('djangoldp_circle',  Referencing the User model and migrations → Cannot run migrations that reference django.contrib.auth.models.User I've looked into adding migrations to contrib.auth , but ran into #21275 . It's also unclear how migrations are supposed to work with "swappable" models like User .


*First time I'm trying this plugin, maybe I did something wrong or my config is not correct. plugin looks very useful :)* I couldn't manage to run migrations. I tried running $ ./manage.py syncdb $ ./manage.py migrate $ ./manage.py migrate cmsplugin_nivoslider They all output the same error: ``` #!text Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from