# Project sync fails to update inventory You might need to increase max\_locks\_per\_transaction.

**URL:** <https://forum.ansible.com/t/project-sync-fails-to-update-inventory-you-might-need-to-increase-max-locks-per-transaction/36881>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [July 21, 2022, 7:24am UTC](https://forum.ansible.com/t/project-sync-fails-to-update-inventory-you-might-need-to-increase-max-locks-per-transaction/36881 "2022-07-21T07:24:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmiho](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@rmiho](https://forum.ansible.com/u/rmiho)\
**Post date:** [July 21, 2022, 7:24am UTC](https://forum.ansible.com/t/project-sync-fails-to-update-inventory-you-might-need-to-increase-max-locks-per-transaction/36881/1 "2022-07-21T07:24:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [July 21, 2022, 12:57pm UTC](https://forum.ansible.com/t/project-sync-fails-to-update-inventory-you-might-need-to-increase-max-locks-per-transaction/36881/2 "2022-07-21T12:57:16Z")

</div>

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/12277)  
[https://github.com/ansible/awx/issues/12176](https://github.com/ansible/awx/issues/12176)  
[https://github.com/ansible/awx/issues/10337](https://github.com/ansible/awx/issues/10337)

There is a PR getting ready to address this: [https://github.com/ansible/awx/pull/12447](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](https://www.postgresql.org/docs/12/runtime-config-locks.html)

- The AWX Team

---

<div class="post-metadata">

**Author:** ![rmiho](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@rmiho](https://forum.ansible.com/u/rmiho)\
**Post date:** [July 21, 2022, 9:04pm UTC](https://forum.ansible.com/t/project-sync-fails-to-update-inventory-you-might-need-to-increase-max-locks-per-transaction/36881/3 "2022-07-21T21:04:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rmiho](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@rmiho](https://forum.ansible.com/u/rmiho)\
**Post date:** [July 22, 2022, 1:00am UTC](https://forum.ansible.com/t/project-sync-fails-to-update-inventory-you-might-need-to-increase-max-locks-per-transaction/36881/4 "2022-07-22T01:00:56Z")

</div>

managed to figured it out and updated max\_locks\_per\_transaction . Took approx 19 minutes to sync the inventory

Thanks
