awx 9.1.0 to 9.1.1 "awx-manage migrate" fails

Hi Team,

Thought I’d try out the new AWX 9.1.1 release.

tried options

a) install 9.1.1 fresh everything works, but when I try to initialise with a 9.1.0 backup data “psql_sql_dump_data” it fails after “awx-manage migrate”
i) dropping 9.1.1.fresh install DB
ii) create new empty awx db
iii) successfully initialise with 9.1.0 backup db sqldump
step “awx-manage migrate” fails (NB prior step “awx-manage makemigrations” works see details below)

b) Take a working AWX 9.1.0 with 6 month old data base. Update to 9.1.1, run “awx-manage migrate” fails (NB prior step “awx-manage makemigrations” works)

The above methods always worked perfectly for migrations of all AXW versions 4.x through 9.1.0.
Any migration changes I should be aware of staring in 9.1.1?

Migration Method
sudo -u awx scl enable rh-postgresql10 rh-python36 “GIT_PYTHON_REFRESH=quiet awx-manage makemigrations”

sudo -u awx scl enable rh-postgresql10 rh-python36 “GIT_PYTHON_REFRESH=quiet awx-manage migrate”

details:

[awx@gbld9011153:[DEV] ~]$ /bin/scl enable rh-postgresql10 rh-python36 rh-git29 "GIT_PYTHON_REFRESH=quiet awx-manage makemigrations "

No changes detected

[awx@gbld9011153:[DEV] ~]$ /bin/scl enable rh-postgresql10 rh-python36 rh-git29 “GIT_PYTHON_REFRESH=quiet awx-manage migrate”

Operations to perform:

Apply all migrations: auth, conf, contenttypes, main, oauth2_provider, sessions, sites, social_django, sso, taggit

Running migrations:

Applying main.0100_v370_projectupdate_job_tags…Traceback (most recent call last):

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/utils.py”, line 84, in _execute

return self.cursor.execute(sql, params)

psycopg2.ProgrammingError: column “job_tags” of relation “main_projectupdate” already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File “/opt/rh/rh-python36/root/usr/bin/awx-manage”, line 11, in

load_entry_point(‘awx==9.1.1’, ‘console_scripts’, ‘awx-manage’)()

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/awx/init.py”, line 152, in manage

execute_from_command_line(sys.argv)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/core/management/init.py”, line 381, in execute_from_com mand_line

utility.execute()

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/core/management/init.py”, line 375, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/core/management/base.py”, line 323, in run_from_argv

self.execute(*args, **cmd_options)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/core/management/base.py”, line 364, in execute

output = self.handle(*args, **options)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/core/management/base.py”, line 83, in wrapped

res = handle_func(*args, **kwargs)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/core/management/commands/migrate.py”, line 234, in handle

fake_initial=fake_initial,

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/migrations/executor.py”, line 117, in migrate

state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/migrations/executor.py”, line 147, in _migrate_all_forwa rds

state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/migrations/executor.py”, line 245, in apply_migration

state = migration.apply(state, schema_editor)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/migrations/migration.py”, line 124, in apply

operation.database_forwards(self.app_label, schema_editor, old_state, project_state)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/migrations/operations/fields.py”, line 112, in database_ forwards

field,

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/base/schema.py”, line 447, in add_field

self.execute(sql, params)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/base/schema.py”, line 137, in execute

cursor.execute(sql, params)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/utils.py”, line 67, in execute

return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/utils.py”, line 76, in _execute_with_wrappers

return executor(sql, params, many, context)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/utils.py”, line 84, in _execute

return self.cursor.execute(sql, params)

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/utils.py”, line 89, in exit

raise dj_exc_value.with_traceback(traceback) from exc_value

File “/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/django/db/backends/utils.py”, line 84, in _execute

return self.cursor.execute(sql, params)

django.db.utils.ProgrammingError: column “job_tags” of relation “main_projectupdate” already exists

[awx@gbld9011153:[DEV] ~]$

Hi Team,

Managed to fix the issue with:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rh/rh-postgresql10/root/usr/lib64
/opt/rh/rh-postgresql10/root/usr/bin/psql -U postgres -h /tmp -d awx -c "alter table main_projectupdate drop column job_tags"

before running the *awx-manage migrate* and then realized the issue had been fixed completely in a later update release of 9.1.1.

rgds,

Nik