Open skywalkw3r opened 6 months ago
Note the last upgrade to 24.0.0 appeared to run the migration pod with no issues.
migration-24.0.0:
Operations to perform: Apply all migrations: auth, conf, contenttypes, dab_resource_registry, main, oauth2_provider, sessions, sites, social_django, sso Running migrations: Applying dab_resource_registry.0001_initial... OK Applying dab_resource_registry.0002_remove_resource_id... OK Applying dab_resource_registry.0003_alter_resource_object_id... OK Applying main.0190_alter_inventorysource_source_and_more... OK
Also tested a brand new deployment via AWX operator and latest version deploys with no issues.
is this problem still reproducible in your environment? do you have a backup of your database pre-upgrade?
I'd expect this message to happen if somehow the unique constraint for the team model's id
field got messed up. This is happening as a ForeignKey is added to the team model, but this should not use the name
field, which is not unique. Maybe somehow some change made it think the name field is the primary_key.
is this problem still reproducible in your environment? do you have a backup of your database pre-upgrade?
Yes it is. I was able to restore from backup and get my instance upgraded to 24.2.0 however it appears even with the version i am on trying to upgrade to 24.3.1 has the same issue.
I'd expect this message to happen if somehow the unique constraint for the team model's
id
field got messed up. This is happening as a ForeignKey is added to the team model, but this should not use thename
field, which is not unique. Maybe somehow some change made it think the name field is the primary_key.
Interesting, any ideas on how to resolve? I'm looking at the postgres db and i see the table in question but nothing looks out of the ordinary. Could i manually set the primary_key back to id? Interesting thing is i don't see a unique constraint listed at the bottom of the table output.
Another fresh install of AWX main_team table for reference:
FYI - I "resolved" the issue by following these steps. Probably not the cleanest way but i needed to get my instance up and running with the latest release.
pg_dump --table main_team awx > main_team_bkp
oc project ansible-awx
oc rsh awx-prod-postgres-15-0
pg_dump awx > awx_bkp
psql awx < main_team_bkp
awx-manage migrate
command on web podAny thoughts on if this is a terrible idea or if this should be ok?
I'm almost completely convinced that something messed up the indices of your team table. I think you have a great strategy for the immediate issue. My only concern would be whether the constraints of other tables also got corrupted. Looking into the obvious tools for this, it seems we already have django-extensions installed so awx-manage sqldiff main dab_rbac
should work, but it gives a lot of junk output, here is what I get in a fresh DB:
https://gist.github.com/AlanCoding/dcd9e67e02423e5524450b8150a4d6d8
So you could run that and cross-reference against mine. If you have other tables which dropped constraints, I wonder if it might still be obvious enough you can compare and see it.
Please confirm the following
security@ansible.com
instead.)Bug Summary
Hello when upgrading from 24.0.0 to 24.3.1 i am getting the following error in my migration pod.
AWX version
24.3.1
Select the relevant components
Installation method
openshift
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
No response
Steps to reproduce
Perform awx upgrade via operator from 24.0.0 to 24.3.1
Expected results
Migration pod to finish and new version of AWX to be running
Actual results
Migration pod failing
Additional information
No response