-
-
Notifications
You must be signed in to change notification settings - Fork 311
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 upgrading from v2.9.1 to v4.1.2 #592
Comments
You're trying to do a massive upgrade. Including v2 -> v3 and v3 -> v4 at the same time. |
To be clear, migrating the same data from v2 to v3 is successful. It's only in trying to migrate from v2 directly to v4 that it fails. |
If you have already migrated to v3 which errors do you have v3->v4? |
Migrating v3 to v4 also seems to be successful. It's only the direct upgrade from v2 to v4 that fails. I'm guessing the issue may be with the ways the migrations for constance have been outright rewritten between major releases, instead of being left as-is and augmented by new migration files? We have users who are still running an older version of our code that uses constance v2. We'd like to make the latest version of our code use constance v4. If we have to make upgrading users make a "stop" along the way at an intermediate version of our code that uses constance v3, we can write appropriate documentation if necessary, but it will be something some deployments stumble over so I'd prefer to avoid that if possible. |
This looks strange to me. |
May be possible, the issue is that we have apps that are relying on the Constance config data at app initialization to determine whether certain functionality should be enabled/disabled. I'm not the primary author of those apps so I'll have to do some investigation to determine how difficult it would be to have them defer their Constance interaction to a later point. Thanks! |
@glennmatthews I believe you can change https://github.com/nautobot/nautobot/blob/eaa693abcf860fd98276c366c36ef01c6493f058/nautobot/core/utils/config.py#L7-L12 this function, all you need is ensure is the Constance already migrated to the right version or not before accessing |
Hmm, possibly - What would be the appropriate way to make that determination? |
btw here (https://github.com/nautobot/nautobot/blob/next/nautobot/core/utils/config.py) is the updated version of that file that tries to work around constance unavailability during startup. |
There are many ways to do this. I think the easiest is to check if the |
Describe the problem
We're seeing an issue upgrading an existing deployment from Constance 2.9.1 to 4.1.2.
Steps to reproduce
constance_config
database table, migrations run includedatabase 0001_initial
anddatabase 0002_auto_20190129_2304
Sure enough, somehow the attempt to read the records from
constance_constance
during app startup has resulted in records being created in this newly initialized table, which are now conflicting with the records that Constance is trying to auto-migrate fromconstance_config
:All of the records currently showing in
constance_constance
are settings that apps are attempting to read during application startup, so something (presumably django-constance itself?) resulted in these being written to the database in the middle of running migrations.System configuration
The text was updated successfully, but these errors were encountered: