# Postgres Migration error

**URL:** <https://forum.ansible.com/t/postgres-migration-error/25447>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 11, 2017, 12:45am UTC](https://forum.ansible.com/t/postgres-migration-error/25447 "2017-09-11T00:45:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Hooks](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@John\_Hooks](https://forum.ansible.com/u/John_Hooks)\
**Post date:** [September 11, 2017, 12:45am UTC](https://forum.ansible.com/t/postgres-migration-error/25447/1 "2017-09-11T00:45:46Z")

</div>

Anyone else get this with an external Postgres server? CentOS 7 for both Postgres and AWX.

“ProgrammingError: relation “celery\_taskmeta” does not exist”

I’ve done it multiple times with the same results every time. Migration starts fine and then after a while a bunch of errors relating to this.

Here’s the full output:

exc, exc\_info.traceback)))  
[2017-09-11 00:32:58,332: CRITICAL/MainProcess] Task awx.main.scheduler.tasks.run\_task\_manager[0dd39143-c648-4b8c-915c-482a75f3acf1] INTERNAL ERROR: ProgrammingError(‘relation “celery\_taskmeta” does not exist\nLINE 1: …taskmeta".“hidden”, “celery\_taskmeta”.“meta” FROM "celery\_ta…\n ^\n’,)  
Traceback (most recent call last):  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/app/trace.py”, line 235, in trace\_task  
request=task\_request,  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/backends/base.py”, line 256, in store\_result  
request=request, \*\*kwargs)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/backends/database.py”, line 29, in \_store\_result  
traceback=traceback, children=self.current\_task\_children(request),  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py”, line 42, in \_inner  
return fun(\*args, \*\*kwargs)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py”, line 181, in store\_result  
‘meta’: {‘children’: children}})  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py”, line 87, in update\_or\_create  
return get\_queryset(self).update\_or\_create(\*\*kwargs)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py”, line 70, in update\_or\_create  
obj, created = self.get\_or\_create(\*\*kwargs)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py”, line 405, in get\_or\_create  
return self.get(\*\*lookup), False  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py”, line 328, in get  
num = len(clone)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py”, line 144, in **len**  
self.\_fetch\_all()  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py”, line 965, in \_fetch\_all  
self.\_result\_cache = list(self.iterator())  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py”, line 238, in iterator  
results = compiler.execute\_sql()  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py”, line 840, in execute\_sql  
cursor.execute(sql, params)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py”, line 64, in execute  
return self.cursor.execute(sql, params)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py”, line 98, in **exit**  
six.reraise(dj\_exc\_type, dj\_exc\_value, traceback)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py”, line 64, in execute  
return self.cursor.execute(sql, params)  
ProgrammingError: relation “celery\_taskmeta” does not exist  
LINE 1: …taskmeta".“hidden”, “celery\_taskmeta”.“meta” FROM "celery\_ta…

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 11, 2017, 1:46am UTC](https://forum.ansible.com/t/postgres-migration-error/25447/2 "2017-09-11T01:46:47Z")

</div>

Interesting… this is on a production environment? Were there any errors from the initial migrations?

---

<div class="post-metadata">

**Author:** ![John\_Hooks](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@John\_Hooks](https://forum.ansible.com/u/John_Hooks)\
**Post date:** [September 11, 2017, 1:50am UTC](https://forum.ansible.com/t/postgres-migration-error/25447/3 "2017-09-11T01:50:40Z")

</div>

Not production, two brand new VMs. I’ll give it a shot on Fedora and see if that makes a difference.

---

<div class="post-metadata">

**Author:** ![John\_Hooks](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@John\_Hooks](https://forum.ansible.com/u/John_Hooks)\
**Post date:** [September 11, 2017, 3:10am UTC](https://forum.ansible.com/t/postgres-migration-error/25447/4 "2017-09-11T03:10:04Z")

</div>

So Just redid both on Fedora 26 and it worked fine. Not sure what happened with CentOS.

---

<div class="post-metadata">

**Author:** ![swiedernix](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/swiedernix/32/9806_2.png) [@swiedernix](https://forum.ansible.com/u/swiedernix)\
**Post date:** [September 20, 2017, 1:03pm UTC](https://forum.ansible.com/t/postgres-migration-error/25447/5 "2017-09-20T13:03:21Z")

</div>

we’ve got the same problem, but on RHEL7.3 based VMs for AWX with an external Postresql (9.2, also on RHEL 7.3)  
but switching to Fedora is not a solution for us, we’re a plain RHEL shop.

damn…

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 1:33pm UTC](https://forum.ansible.com/t/postgres-migration-error/25447/6 "2017-09-20T13:33:12Z")

</div>

You could try just re-running it again. It looks like some folks interrupt the installation the first time and the migration doesn’t fully account for that, see: [https://github.com/ansible/awx/issues/138](https://github.com/ansible/awx/issues/138)

---

<div class="post-metadata">

**Author:** ![Bill\_Nottingham1](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@Bill\_Nottingham1](https://forum.ansible.com/u/Bill_Nottingham1)\
**Post date:** [September 20, 2017, 3:00pm UTC](https://forum.ansible.com/t/postgres-migration-error/25447/7 "2017-09-20T15:00:28Z")

</div>

Matthew Jones (majones@redhat.com) said:

> You could try just re-running it again. It looks like some folks interrupt  
> the installation the first time and the migration doesn't fully account for  
> that, see: [https://github.com/ansible/awx/issues/138](https://github.com/ansible/awx/issues/138)
> 
> \> we've got the same problem, but on RHEL7.3 based VMs for AWX with an  
> \> external Postresql (9.2, also on RHEL 7.3)  
> \> but switching to Fedora is not a solution for us, we're a plain RHEL shop.

In general, PG 9.2 may not work. We're designed for 9.6 or later. (But I  
defer to Matt.)

Bill

---

<div class="post-metadata">

**Author:** ![swiedernix](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/swiedernix/32/9806_2.png) [@swiedernix](https://forum.ansible.com/u/swiedernix)\
**Post date:** [September 20, 2017, 3:09pm UTC](https://forum.ansible.com/t/postgres-migration-error/25447/8 "2017-09-20T15:09:32Z")

</div>

re-running doesn’t help, I’ve enabled Postgresql query logging so I can see it’s doing the same thing over and over again…  
ERROR: relation “conf\_setting” does not exist at character 158

shall I add the sql statements to the issue 138 ?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 3:21pm UTC](https://forum.ansible.com/t/postgres-migration-error/25447/9 "2017-09-20T15:21:26Z")

</div>

It sounds like your migrations didn’t run. I don’t need to see the sql queries, I know what those are but I do need to see the migration run from the top of your task container logs to see what happened there.
