Git Product home page Git Product logo

Comments (7)

skywalkw3r avatar skywalkw3r commented on June 3, 2024

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.

from awx.

TheRealHaoLiu avatar TheRealHaoLiu commented on June 3, 2024

is this problem still reproducible in your environment? do you have a backup of your database pre-upgrade?

from awx.

AlanCoding avatar AlanCoding commented on June 3, 2024

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.

from awx.

skywalkw3r avatar skywalkw3r commented on June 3, 2024

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.

from awx.

skywalkw3r avatar skywalkw3r commented on June 3, 2024

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.

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.

image

Another fresh install of AWX main_team table for reference:
image

from awx.

skywalkw3r avatar skywalkw3r commented on June 3, 2024

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.

  1. psql dump fresh install of AWX postgres DB table main_team pg_dump --table main_team awx > main_team_bkp
  2. oc rsh into postgres pod on broken instance oc project ansible-awx oc rsh awx-prod-postgres-15-0
  3. take psql dump backup of existing DB (the one having issues) pg_dump awx > awx_bkp
  4. import psql dump of fresh main_team table psql awx < main_team_bkp
  5. perform awx-manage migrate command on web pod
  6. reload web/task pods and everything seems happy now.

Any thoughts on if this is a terrible idea or if this should be ok?

from awx.

AlanCoding avatar AlanCoding commented on June 3, 2024

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.

from awx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.