question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration error when calling runserver after upgrade from PSA

See original GitHub issue

Got this error when trying to upgrade from python-social-auth, when running runserver:

django.db.migrations.graph.NodeNotFoundError: Migration social_django.0005_auto_20160727_2333 dependencies reference nonexistent parent node (u'social_django', u'0004_auto_20160423_0400')

As far as I can see, there is a migration social_django/migrations/0004_auto_20160423_0400.py, so not sure yet of the problem.

I am running Django 1.8.17.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
tomislatercommented, Feb 15, 2017

If someone had used an old version (https://github.com/omab/python-social-auth) and changed it to the new version (https://github.com/python-social-auth/social-app-django), he would encounter the error.

2reactions
tisdallcommented, Jul 10, 2017

I think this issue needs to be re-opened. I’m trying to do an upgrade and followed the migration guide and am getting the same exception:

# python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/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 "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 63, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 17, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 48, in __init__
    self.build_graph()
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 237, in build_graph
    self.graph.add_dependency(migration, key, parent)
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 46, in add_dependency
    "Migration %s dependencies reference nonexistent parent node %r" % (migration, parent)
KeyError: u"Migration social_django.0005_auto_20160727_2333 dependencies reference nonexistent parent node (u'social_django', u'0004_auto_20160423_0400')"

I originally had installed and was using python-social-auth==0.2.21 and Django==1.7.11 and then installed the following:

social-auth-app-django==1.2.0
social-auth-core==1.4.0

My django_migrations looks like this:

app name applied
default 0001_initial 2017-01-19 14:33:43.873019+00
default 0002_add_related_name 2017-01-19 14:33:43.881544+00
default 0003_alter_email_max_length 2017-01-19 14:33:43.887557+00
default 0004_auto_20160423_0400 2017-01-19 14:33:43.893561+00
social_auth 0005_auto_20160727_2333 2017-01-19 14:33:43.899437+00

There’s possible solutions/hacks at https://github.com/omab/python-social-auth/issues/962 to get around this issue.

It seems like #4 should have fixed this, but for some reason it’s not working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't migrate or makemigrations while trying to runserver
To solve this issue, try to comment out every code line in the specific view function, which uses the Gallery model, then create/run...
Read more >
django-admin and manage.py
Shows the migration operations that will be performed for the given migrate command. --run-syncdb ¶. Allows creating tables for apps without migrations. While ......
Read more >
VMware vCenter Server 6.0 Update 3g Release Notes
Important: Upgrade and migration paths from vCenter Server 6.0 Update 3g ... You might see the following error message: An internal error ......
Read more >
CMD Error trying to run server? : r/Minecraft - Reddit
I downloaded the server.jar, ran the command line prompt (yes, I cd'd into the right folder) and got the following error: Error: A...
Read more >
Plesk 10 update post-install failed
#3 /usr/local/psa/admin/smb/application/externals/Doctrine/Migration.php(230): Doctrine_Connection->fetchColumn('SELECT version ...') ... **** ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found