Project sync fails to update inventory You might need to increase max_locks_per_transaction.

Hi,

My environment is as follows:

AWX 19.2.2

Ansible 2.9.13

config file = /etc/ansible/ansible.cfg
configured module search path = [‘/usr/share/ansible/openshift’]
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Dec 5 2019, 15:45:45) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

Syncing the project fails to update the inventory with below error

Traceback (most recent call last): File “/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/utils.py”, line 84, in _execute return self.cursor.execute(sql, params) psycopg2.errors.OutOfMemory: out of shared memory HINT: You might need to increase max_locks_per_transaction.

This is a known issue when deleting hosts that are related to a large number of jobs; see:
https://github.com/ansible/awx/issues/12277
https://github.com/ansible/awx/issues/12176
https://github.com/ansible/awx/issues/10337

There is a PR getting ready to address this: https://github.com/ansible/awx/pull/12447

In the mean time, you can do as the message says and increase the max_locks_per_transaction vale in the database: https://www.postgresql.org/docs/12/runtime-config-locks.html

  • The AWX Team

That make sense. however not sure how to connect to postgres , I can connect to awx operator using below command but not postgres

kubectl exec -it awx-operator-545497f7d5-j2m5v -c awx-operator /bin/sh

managed to figured it out and updated max_locks_per_transaction . Took approx 19 minutes to sync the inventory

Thanks