# awx 9.1.0 to 9.1.1 "awx-manage migrate" fails

**URL:** <https://forum.ansible.com/t/awx-9-1-0-to-9-1-1-awx-manage-migrate-fails/31997>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [January 17, 2020, 8:10am UTC](https://forum.ansible.com/t/awx-9-1-0-to-9-1-1-awx-manage-migrate-fails/31997 "2020-01-17T08:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nik\_Tetteh-Lartey](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@Nik\_Tetteh-Lartey](https://forum.ansible.com/u/Nik_Tetteh-Lartey)\
**Post date:** [January 17, 2020, 8:10am UTC](https://forum.ansible.com/t/awx-9-1-0-to-9-1-1-awx-manage-migrate-fails/31997/1 "2020-01-17T08:10:46Z")

</div>

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] ~]$

---

<div class="post-metadata">

**Author:** ![Nik\_Tetteh-Lartey](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@Nik\_Tetteh-Lartey](https://forum.ansible.com/u/Nik_Tetteh-Lartey)\
**Post date:** [January 20, 2020, 8:51pm UTC](https://forum.ansible.com/t/awx-9-1-0-to-9-1-1-awx-manage-migrate-fails/31997/2 "2020-01-20T20:51:41Z")

</div>

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
