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
Migration broken from 0.2.19 (and older) #28
Comments
The workaround that works is to upgrade to 0.2.21 first and then to social_django. |
More or less same issue here, when trying to migrate from python-social-auth==python-social-auth==0.2.14 to the new system.
Suggested workaround worked (switch to python-social-auth 0.2.21 first, run migration, then upgrade to new system). Thanks! |
Hi, |
@nijel thanks for posting the results and the workaround, I've updated the migration guide to reflect this https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md#migrations. @marcperrin take a look to the link above, that should help. |
I'm encountering the same isssue, and the steps listed in the migrations guide do not help: $ pip list --format=columns | grep social
python-social-auth 0.2.21
rest-social-auth 0.5.0
social-auth-app-django 1.1.0
social-auth-core 1.2.0
$ ./manage.py showmigrations social_django
social_django
[ ] 0005_auto_20160727_2333 (1 squashed migrations)
[ ] 0006_partial
$ ./manage.py migrate social_django
Operations to perform:
Apply all migrations: social_django
Running migrations:
Applying social_django.0005_auto_20160727_2333...Traceback (most recent call last):
File "./manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 204, in handle
fake_initial=fake_initial,
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/db/migrations/executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/db/migrations/migration.py", line 119, in apply
operation.state_forwards(self.app_label, project_state)
File "/mnt/d/Users/coriolinus/Documents/Toptal/cardamom/.venv_wsl/lib/python3.5/site-packages/django/db/migrations/operations/models.py", line 521, in state_forwards
model_state = state.models[app_label, self.name_lower]
KeyError: ('social_django', 'association') |
I found that I had to uninstall python-social-auth and |
I had a tricky time migrating, however I managed to overcome it using the following method to upgrade from python-social-auth v 0.2.19
Now it should be working with all migrations applied. |
Any method for upgrade from django_social_auth==0.7.28 to social_django? |
@coriolinus I had that same issue after hammering (incorrectly) past the issue described in this comment: #22 (comment) Doing the following db stuff got me past that issue. $ update django_migrations set app='social_django' where app='default'; Ref: #22 (comment) Then I encountered your error @Kuein and did the following: $ python manage.py migrate social_django 0001 --fake and then finished the migrations for $ python manage.py migrate social_django Then and appeared.. and everything works! |
One Caution
The migration checks both 'default' and 'social_django' in the migrations. If you update this, then you will get 'NodeNotFoundError' in runserver. |
None of these methods worked for me when upgrading from Django 1.9 to 1.11: when trying to make
|
Échec de la remise pour ces destinataires ou groupes :
marcperrin (marc.perrin@dont-nod.com)<mailto:marc.perrin@dont-nod.com>
L'adresse de messagerie que vous avez entrée est introuvable. Vérifiez l'adresse de messagerie du destinataire et essayez de renvoyer le message. Si le problème persiste, contactez le support technique.
Informations de diagnostic pour les administrateurs :
Génération du serveur : dont-nod.com
marc.perrin@dont-nod.com
#550 5.1.1 RESOLVER.ADR.RecipNotFound; not found ##
En-têtes de message d'origine :
Received: from SRV (192.168.1.5) by SRV.dont-nod.lan (192.168.1.5) with
Microsoft SMTP Server id 14.3.361.1; Wed, 18 Jul 2018 06:18:16 +0200
Return-Path: <noreply@github.com>
Received: from out-5.smtp.github.com ([192.30.252.196]) by mx.kundenserver.de
(mxeue012 [212.227.15.41]) with ESMTPS (Nemesis) id 1MCrom-1foPLB1Zlw-009CwJ
for <marc.perrin@dont-nod.com>; Wed, 18 Jul 2018 06:17:09 +0200
Date: Tue, 17 Jul 2018 21:17:08 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com;
s=pf2014; t=1531887428;
bh=PI1o+tHUiS0N/gEHScVwqXyjoOa+DIZT18PU1JjgGPs=;
h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID:
List-Archive:List-Post:List-Unsubscribe:From;
b=xxTYFvWRhkW6ReKH1RDwH7lsAyCELh9hpfqe0mecZzXPiwQ7uCn1zrRkcGH4Nqj6v
McSv6zsZsdcK0gyB6ixmf0n2acaYRd+xYhdC/yrwnZy3uFEnT5S0/aq2cVkoc+WusH
7tOd1U9mXCR93PZikoHd/n4lJQFhSLxkabfhQxU4=
From: Spartach1985 <notifications@github.com>
Reply-To: python-social-auth/social-app-django <reply@reply.github.com>
To: python-social-auth/social-app-django
<social-app-django@noreply.github.com>
CC: marcperrin <marc.perrin@dont-nod.com>, Mention
<mention@noreply.github.com>
Message-ID: <python-social-auth/social-app-django/issues/28/405803775@github.com>
In-Reply-To: <python-social-auth/social-app-django/issues/28@github.com>
References: <python-social-auth/social-app-django/issues/28@github.com>
Subject: Re: [python-social-auth/social-app-django] Migration broken from
0.2.19 (and older) (#28)
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5b4ebf443482c_33ef3ff4c9cccf60812f8";
charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: Spartach1985
X-GitHub-Recipient: marcperrin
X-GitHub-Reason: mention
List-ID: python-social-auth/social-app-django
<social-app-django.python-social-auth.github.com>
List-Archive: https://github.com/python-social-auth/social-app-django
List-Post: <mailto:reply@reply.github.com>
List-Unsubscribe: <mailto:unsub+0137a5373b8cdaf16e2b0403b1976cee7eb5578515e0944092cf000000011766814492a169ce0c321e78@reply.github.com>,
<https://github.com/notifications/unsubscribe/ATelNzmkdn0xtU59c52cmvfafqzVKp0Eks5uHrbEgaJpZM4Lz-6j>
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: marc.perrin@dont-nod.com
Envelope-To: <marc.perrin@dont-nod.com>
X-UI-Filterresults: notjunk:1;V01:K0:AvI3R1A6zgk=:PrYuhS3YI96xC3hr4MQDv4e2yO
Yu6NJC0KeOQXwAMtSIfQV9/YqnKkxqOrxZDO7qI3KJewT3+1VAJ6CDYB66w7qXFWVyykksjSZ
PkGw3YjYEN9xya6S1YCTCgo8acuT+zLhipuAbne+fX9+VG6Wk29vOaDUJ9laWF2R4aYe8/YJV
lmvLuJUuRBHJMwk44/Wtqs9L5y9tE0l5NV/upz6i/gnL2maHR+m2ki9QUMDlLkVVdZDRK3YvR
XmXOqCiCzAP3I/19Yt2htlzwVr8gSXteGY3Imn0t1RZfiaGDpkGecNAgxbdH7xnTSlFmXc3Xh
Ppm6EdBKtpuz4PpwNHKEMDBFGCN3HMVlnHKkMyM1Sj23xgKRbcyOvUC6IaaaAzMXTgHO6tT7M
BWWj7KvgnTdFGDHMDrBpRxHQJ7fVoby4ZtzIXPxYNjsKedPmLaQX5wKEhSWHN4s2C4zcKRcK4
0+iqw/12J0nnU7N1wGjmaY1lJfdSWGdcrIJQozWlIhV2dm6U+OMse2sUMyNG281ieXTEDw1x5
qulUsiQQj+C2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Mj0aF3cAknEvkaSg==
|
Try apply the migrations backwards! - First you need to run
There is an error. So now run...
Then finally run
eg.
Then some error about the wrong number of constraints in the initial migration:
Then when I tried python manage.py migrate...
|
This is followup for #16.
With #25 the migration from 0.2.20 and 0.2.21 is working fine, however users upgrading from 0.2.19 and older will still end up with error.
It can end up with error described in #16:
Or it can pop up as error while validating relations (see WeblateOrg/weblate#1344):
The problem is that Django does not see the old migrations as they are just half applied (due to missing
social_auth
ones):This is what is stored in the database:
The text was updated successfully, but these errors were encountered: