# Inventory is reset when inventory script fails

**URL:** <https://forum.ansible.com/t/inventory-is-reset-when-inventory-script-fails/31346>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 24, 2019, 7:03am UTC](https://forum.ansible.com/t/inventory-is-reset-when-inventory-script-fails/31346 "2019-09-24T07:03:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_A\_S](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@Juan\_A\_S](https://forum.ansible.com/u/Juan_A_S)\
**Post date:** [September 24, 2019, 7:03am UTC](https://forum.ansible.com/t/inventory-is-reset-when-inventory-script-fails/31346/1 "2019-09-24T07:03:19Z")

</div>

Hi All, I have configured a script, that uses a inventory script as source (AWX 6.1.0). This inventory script is a bash script similar to this, and run with a schedule every 2 hours:

#!/bin/bash  
curl -sSfL -H “Authorization: Apikey xxxx” [https://xxx-dev.xxx.com/ansible/inventory](https://xxx-dev.xxx.com/ansible/inventory)

The problem is that the URL sometimes fails, and that makes that the inventory gets empty. Is there any way to avoid this, so the inventory is not reset when the script fails?
