diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 9858d1db0f..1acd5ab432 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -393,7 +393,13 @@ def update_inventory_computed_fields(inventory_id, should_update_hosts=True): logger.error("Update Inventory Computed Fields failed due to missing inventory: " + str(inventory_id)) return i = i[0] - i.update_computed_fields(update_hosts=should_update_hosts) + try: + i.update_computed_fields(update_hosts=should_update_hosts) + except DatabaseError as e: + if 'did not affect any rows' in str(e): + logger.debug('Exiting duplicate update_inventory_computed_fields task.') + return + raise @task(queue='tower', base=LogErrorsTask)