-
-
Notifications
You must be signed in to change notification settings - Fork 447
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 error when upgrading to 1.15.4 #647
Comments
I have the exact same issue. My environment: Python version: 3.11.x |
May I ask you to test with 1.15.5, please? |
The update did not help:
And in my requirements file:
|
It hasn't helped for me either. |
@knyghty @hanckmann Could you share the |
I can share the working one from 1.15.3:
But I can't share the one from 1.15.5 because running the command gives the same error. |
I tried to reproduce the error, but unfortunately, I can't. I use the following Dockerfile:
requirements_dev.txt
Then I use the If you are able to create an example where the error is happening, that would be great. |
The error is still present in version 1.15.5. Is there any work on this? It will be a stopper moving forward! |
@hanckmann @knyghty Hello, I am willing to help here, but I can't reproduce the issue you are facing. I use it also on my projects, and the migration went fine. Would it be possible to get a setup to reproduce the issue somehow ? A copy of your database with random data in it or something like that. |
Hii, well... I am not sure how to reproduce it. |
Same issue here. |
@JeroenvO ; for the time being, I am maintaining this fork: Feel free to use it as well. If I manage to resolve the issue and work my way back to this branch, I can give you a heads-up. |
Still an issue in |
@rob101 could you tell us what versions of Python, Django, and django-otp you are using please |
And provide a minimal reproducible example... I tried with the example app from this repo or from other personal repo and I couldn't reproduce the issue |
We are having the same issue while migrating an application from django 3 to django 4. I will share some of the steps hoping this can help coming to a faster solution, since this issue is blocking for us. Steps to replicate
OutcomeNo matter wich version/setup I tried (see Scenarios below), I always get this error:
ScenariosHere are some different scenarios I tried, all with the same result
All with the same result:
Any help will be greatly appreciated. |
FWIW, because it's triggered by the order in which migrations are loaded, at least in my local testing reversing the order in which If the phone number plugin comes first, the loader tries to load a migration that replaces migrations inside |
Interesting! Could you evaluate if adding a dependency on two_factor in phonenumber squashed migration would help fixing this issue? |
Nope. I actually think that TBH I don't think enforcing a load order is that uncommon, and it's even something that can be reasonably checked for. |
Yep - see It:
There's no attempt to re-order things at this stage that I can see. I think this actually happens much later, inside |
Thanks for the thorough exploration 🚀. In the end, do you have a potential fix to suggest for this issue? |
TBH I don't have a "perfect" solution - IMO the reasonable thing to do is enforce the load order by checking |
Wow. Changing the order of the installed apps actually fixed this issue for (early tests show). In the mean time, I propose to add a note in the documentation about the order of the plugins (or did I miss that?). |
I'm wondering if we could also detect this situation and generate a warning. |
Expected Behavior
Migrations work.
Current Behavior
Migrations fail.
Possible Solution
?
Steps to Reproduce (for bugs)
Running migrate after upgrading to 1.15.4 from 1.15.3. Presumably needs the
phonenumber
plugin.Context
Your Environment
The text was updated successfully, but these errors were encountered: