New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
django.db.migrations.exceptions.NodeNotFoundError: Migration social_auth.0004_auto_20160423_0400 dependencies reference nonexistent parent node (u'default', u'0003_alter_email_max_length') #962
Comments
Same issue here, did you ever work out what it was @yeago ? |
I just hacked the migration manually to change the name and ran it. On Aug 3, 2016 9:46 AM, "Carey Williams" notifications@github.com wrote:
|
I now have the following error: In social_django instead of default. Any idea? |
I am still getting this error using social-auth-app-django==0.1.0 and social-auth-core==0.2.1 . Error: Quite weird, cause that migration file |
Same issue. Django==1.9.7, python-social-auth[django]==0.3.3 |
same issue here, using Django 1.8 or 1.9, and social_auth_app_django-0.1.0.dist-info |
One more over here with the same problem - using Django 1.8, migration 0005 doesn't seem to locate it's previous dependancy despite it being in the file and correctly named. Really weird. |
Yes, someone more knowledgeable: please help! |
I'm having the same issue. @omab until this is resolved we are stuck on PSA... |
@dvdhpkns, did you try the steps on https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md#migrations ? |
@omab, yes, I followed the steps. I am currently on python-social-auth==0.2.21, ran migrations and everything is working fine there. I run into trouble, however, when I try to update to the new library. I have install the new libs, updated all my settings, but when I run migrate I get the following:
Could this be related to the renaming of the app and change in the migration here: python-social-auth/social-app-django@08b4fae? Thanks for your help! |
From what I understand, django adds to the INSERT INTO `django_migrations` (`app`, `name`, `applied`) VALUES ("social_auth", "0001_initial", 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());
INSERT INTO `django_migrations` (`app`, `name`, `applied`) VALUES ("social_auth", "0002_add_related_name", NOW()); |
@teeberg is there a way to do this in an automated way so that everyone on my team won't have the same migration issue? |
Do anybody have detailed steps to reproduce the situation? So far I wasn't able to do it on my end. |
@omab We were seeing this error:
These migrations were applied to our database when that error was thrown:
Adding these four to the table (without applying any changes) fixed it:
|
@dvdhpkns @omab added a section about migrations here: https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md#migrations Ideally, applying all migrations from python-social-auth would let you upgrade smoothly. If it doesn't, I think the best automated way forward is to make python-social-auth fix the migrations so that it does go smoothly :) Hopefully, the info about the migrations above can help @omab pinpoint the issue |
@omab steps to repro:
|
Hi! Looks like, the same issue here I've done everything according to the instruction - https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md But during the last step (
But as I can see, all migration files are at their proper places:
After some
Maybe, you can help me understand, why does it behaves in such way? Thanks! |
Used @teeberg's advice about manual inserts to db and it seems fixed the current process, but I'm afraid of possible further issues, that could appear when module development will move forward. Is it possible, how do you think? |
As far as I understand, adding those rows to the migrations table only made it look like it should've looked in the first place. So I don't expect any trouble because of it in the future. But please share if you run into any problems! |
@teeberg @omab if adding these rows is necessary for migration, should we add a migration step to insert those rows? Not sure if that's even possible, but my concern is manually adding those rows and then having every other user of my project having to do the same and every new / future user having to learn this through tribal knowledge. |
Theoretically, you can have arbitrary python code in django migrations, so it should be doable to fix the migrations automatically by figuring out which ones are missing. |
Following migration instructions and hitting same issue. Also had to manually insert the migrations (for sqlite use DATETIME() instead of NOW()). Seems to work now, but not feeling any confidence in this. Migration social_django.0005_auto_20160727_2333 dependencies reference nonexistent parent node (u'social_django', u'0004_auto_20160423_0400 At this point I have only (there are only 112 users total, and only a few are using social auth): |
folks, in my august 3rd message I had indicated that a straightforward hack of the migration was all that was needed to proceed. I have since looked at the repository and the migrations directory has been replaced by a .py file. This is something of an experimental practice (at best). To anyone contending with this issue, I would say that you could #href="https://github.com/omab/python-social-auth/pull/980/files#diff-ea3ca5165c1c3aaac32d6d8299e3a9a9">go back to this diff and rename "default" to "social_auth" and then upgrade (or whatever) and then fake all migrations from there to a present-like state. |
@yeago thanks, but in my case it was referencing 'social_django' not 'default' nor 'social_auth' (see error msg above). I inserted the "social_auth" migrations manually, but now I see I have newer 'social_django' entries as well (woops). It may be that my first packaging included "social-auth-app-django" then I realized I needed "python-social-auth[django]" as well. Since I don't have much experience with migrations, I've probably completely messed this up, though it seems to be working at the moment. I imagine that we could put python code in the migration to detect if there were 'social_auth' or 'default' migrations that looked like a match, then use that dependency auto-magically, no?
|
After teeberg's solution didn't work, I did what 81c0a54 suggested:
That fixed it for me. |
We ran into this issue; the cause was, as seems to be mentioned above, that we imported an old database which hadn't been migrated past We solved it by these steps:
I hope this helps someone else. |
Thank you @shaib |
I'm still in trouble. |
Hey Guys! here is link to my problem scenario.:- https://stackoverflow.com/q/61122442/11351226 Please help me with this because im not able to go further without solving this error . |
@MayurBagul I posted an answer on your SO question; your problem doesn't seem to be related to this issue, or to python-social-auth at all. |
|
I GOT it working - django created migrations folder in my app , just delete it and run again |
okay i found the answers chances are u guys are using venv(python virtual enviroment) please delete that folder and delete all your migrations folder |
django.db.migrations.exceptions.NodeNotFoundError: Migration social_auth.0004_auto_20160423_0400 dependencies reference nonexistent parent node (u'default', u'0003_alter_email_max_length')
Nobody?
Looking at https://github.com/omab/python-social-auth/blob/master/social/apps/django_app/default/migrations/0004_auto_20160423_0400.py#L11
kinda weird, did the app name change? look at the previous one.
https://github.com/omab/python-social-auth/blob/master/social/apps/django_app/default/migrations/0003_alter_email_max_length.py#L14
The text was updated successfully, but these errors were encountered: