Coder Social home page Coder Social logo

Comments (13)

tomislater avatar tomislater commented on June 16, 2024 6

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.

from social-app-django.

 avatar commented on June 16, 2024 2

Do you know how fix this error? I am migration from social_auth to social_django and can't apply migrations

from social-app-django.

tisdall avatar tisdall commented on June 16, 2024 2

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 omab/python-social-auth#962 to get around this issue.

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

from social-app-django.

tisdall avatar tisdall commented on June 16, 2024 1

After trying different things I finally got it to get past that exception and run the final migration (0006) for me by inserting the following into django_migrations (on top of what was already in there):

INSERT INTO django_migrations ("app", "name", "applied") VALUES ('social_auth', '0001_initial', NOW());
INSERT INTO django_migrations ("app", "name", "applied") VALUES ('social_auth', '0002_add_related_name', NOW());
INSERT INTO django_migrations ("app", "name", "applied") VALUES ('social_auth', '0003_alter_email_max_length', NOW());
INSERT INTO django_migrations ("app", "name", "applied") VALUES ('social_auth', '0004_auto_20160423_0400', NOW());

I had tried inserting it with the app name social_django, but it seemed to have no effect.

from social-app-django.

strindhaug avatar strindhaug commented on June 16, 2024

Same thing happened to me on Django==1.9.10

from social-app-django.

browniebroke avatar browniebroke commented on June 16, 2024

@omab I appreciate you might have created a lot of work with the split of PSA, but I'm happy to help out.

Maybe a good place to start would be to setup some automated tests? Do you a preferred service? Travis + Tox? I'm happy to start a PR starting off with the files generated by a fresh cookie cutter project, but ultimately you'll have to activate it in Travis.

from social-app-django.

omab avatar omab commented on June 16, 2024

I don't have tests for the Django app yet, I do have them for the core component (and enabled the Travis.ci integration a couple minutes ago).

from social-app-django.

EnaVl avatar EnaVl commented on June 16, 2024

Next steps helped me:

  1. Uninstall current version and install 0.2.21 version:
pip uninstall python-social-auth
pip install "python-social-auth==0.2.21"
pip install social-auth-app-django
  1. Run migrations:
python manage.py migrate
  1. Make changes according to python-social-auth doc
  2. Run migrations:
python manage.py migrate

from social-app-django.

chipx86 avatar chipx86 commented on June 16, 2024

I just hit this problem. Migration 004_auto_20160423_0400 contains this:

    replaces = [
        ('default', '0004_auto_20160423_0400'),
        ('social_auth', '0004_auto_20160423_0400')
    ]

Tracing the migration dependency graph code, that replaces is causing this migration to add itself to the dependency graph and then remove itself, since it's replacing itself. That's then preventing migration 0005_auto_20160727_2333 from finding its parent.

Removing the default entry solves this.

from social-app-django.

m-misseri avatar m-misseri commented on June 16, 2024

Same error here. I was using python social auth, and then now trying to update it to social-auth-app-django

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

from social-app-django.

tisdall avatar tisdall commented on June 16, 2024

@chipx86 - the replaces is basically a list of pseudonyms for that particular migration. It should never cause a migration to not be found but only indicate that a migration has already be run. The 'default' entry is there to indicate that if it sees that entry in django_migrations that it's already be run and doesn't need to be run again. In my situation (outlined above), removing that line would cause that migration to be run again.

That being said, obviously something isn't working right.

There was a refactoring done to the build_graph and was only backported to Django 1.10. I wonder if that fixed this issue. Is anyone having this issue in Django >= 1.10?

from social-app-django.

sahithi-rp avatar sahithi-rp commented on June 16, 2024

I am having the same issue. I am on Django1.10

from social-app-django.

abidibo avatar abidibo commented on June 16, 2024

This steps fixed it for me:
omab/python-social-auth#962 (comment)

from social-app-django.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.