From 93aed04389f488be97a9318cd097d1309360e069 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 8 Aug 2017 14:48:21 -0400 Subject: [PATCH] log specific errors for problems managing lost instance --- awx/main/tasks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index bd6e999848..458c68f041 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -246,8 +246,11 @@ def cluster_node_heartbeat(self): other_inst.save(update_fields=['capacity']) logger.error("Host {} last checked in at {}, marked as lost.".format( other_inst.hostname, other_inst.modified)) - except (IntegrityError, OperationalError): - pass # another instance is updating the lost instance + except DatabaseError as e: + if 'did not affect any rows' in str(e): + logger.debug('Another instance has marked {} as lost'.format(other_inst.hostname)) + else: + logger.exception('Error marking {} as lost'.format(other_inst.hostname)) @task(bind=True, base=LogErrorsTask)