# TASK \[kubernetes : Migrate database\] failing

**URL:** <https://forum.ansible.com/t/task-kubernetes-migrate-database-failing/31069>\
**Category:** AWX Project\
**Tags:** awx, kubernetes\
**Created:** [August 19, 2019, 9:02am UTC](https://forum.ansible.com/t/task-kubernetes-migrate-database-failing/31069 "2019-08-19T09:02:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashok\_kumar](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@ashok\_kumar](https://forum.ansible.com/u/ashok_kumar)\
**Post date:** [August 19, 2019, 9:02am UTC](https://forum.ansible.com/t/task-kubernetes-migrate-database-failing/31069/1 "2019-08-19T09:02:22Z")

</div>

Hi Team,

I am trying to install AWX using kubernetes with external postgres. But while executing Migrate database task getting below error.

TASK [kubernetes : Migrate database] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

fatal: [localhost]: FAILED! =\> {“changed”: true, “cmd”: “kubectl -n 2304378531 exec ansible-tower-management – bash -c "awx-manage migrate --noinput"”, “delta”: “0:00:05.503190”, “end”: “2019-08-19 13:14:24.285694”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-08-19 13:14:18.782504”, “stderr”: “Traceback (most recent call last):\n File "/usr/bin/awx-manage", line 11, in \n load\_entry\_point(‘awx==4.0.0.0’, ‘console\_scripts’, ‘awx-manage’)()\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/ **init**.py", line 140, in manage\n execute\_from\_command\_line(sys.argv)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/ **init**.py", line 364, in execute\_from\_command\_line\n utility.execute()\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/ **init**.py", line 356, in execute\n self.fetch\_command(subcommand).run\_from\_argv(self.argv)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", line 283, in run\_from\_argv\n self.execute(\*args, \*\*cmd\_options)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", line 330, in execute\n output = self.handle(\*args, \*\*options)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 86, in handle\n executor.loader.check\_consistent\_history(connection)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/loader.py", line 298, in check\_consistent\_history\n connection.alias,\ndjango.db.migrations.exceptions.InconsistentMigrationHistory: Migration oauth2\_provider.0001\_initial is applied before its dependency main.0025\_v330\_add\_oauth\_activity\_stream\_registrar on database ‘default’.\ncommand terminated with exit code 1”, “stderr\_lines”: [“Traceback (most recent call last):”, " File "/usr/bin/awx-manage", line 11, in “, " load\_entry\_point(‘awx==4.0.0.0’, ‘console\_scripts’, ‘awx-manage’)()”, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/ **init**.py", line 140, in manage", " execute\_from\_command\_line(sys.argv)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/ **init**.py", line 364, in execute\_from\_command\_line”, " utility.execute()“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/ **init**.py", line 356, in execute”, " self.fetch\_command(subcommand).run\_from\_argv(self.argv)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", line 283, in run\_from\_argv”, " self.execute(\*args, \*\*cmd\_options)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py", line 330, in execute”, " output = self.handle(\*args, \*\*options)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 86, in handle”, " executor.loader.check\_consistent\_history(connection)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/migrations/loader.py", line 298, in check\_consistent\_history”, " connection.alias,", “django.db.migrations.exceptions.InconsistentMigrationHistory: Migration oauth2\_provider.0001\_initial is applied before its dependency main.0025\_v330\_add\_oauth\_activity\_stream\_registrar on database ‘default’.”, “command terminated with exit code 1”], “stdout”: “”, “stdout\_lines”: }

to retry, use: --limit @/Users/ashok.g/Desktop/awx-devel/installer/install.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

localhost : ok=18 changed=8 unreachable=0 failed=1

Anyone Please help me on this

Thanks,  
Ashok.G

9900151637
