GSA/notifications-api

Bug: KeyError: "'notification'" in the logs

Closed this issue · 0 comments

Who discovered this?

Bev

What happened?

I was on the staging app and I notice this KeyError: "'notification'" in the logs. Doesn't seem "normal". It looks like an error in the log itself

11:07:43.515: [APP/PROC/WORKER.0] [2024-07-25 18:07:43,514: INFO/ForkPoolWorker-7] START TIME 2024-07-25 18:07:12.896489 END TIME 2024-07-25 18:07:43.514677
11:07:44.193: [APP/PROC/WORKER.0] [2024-07-25 18:07:44,192: ERROR/ForkPoolWorker-7] failed to format log message: "'notification'" not found
11:07:44.193: [APP/PROC/WORKER.0] Traceback (most recent call last):
11:07:44.193: [APP/PROC/WORKER.0]   File "/home/vcap/app/notifications_utils/logging.py", line 162, in process_log_record
11:07:44.193: [APP/PROC/WORKER.0]     log_record["message"] = log_record["message"].format(**log_record)
11:07:44.193: [APP/PROC/WORKER.0]                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11:07:44.193: [APP/PROC/WORKER.0] KeyError: "'notification'"
11:07:44.193: [APP/PROC/WORKER.0] [2024-07-25 18:07:44,191: INFO/ForkPoolWorker-7] DELIVERED: {'notification': {'messageId': '41b5e462-9a98-5326-8ec0-bb7e0c09008c', 'timestamp': '2024-07-25 18:07:13.49'}, 'delivery': {'numberOfMessageParts': 1, 'destination': '1XXXXXXXXXX', 'priceInUSD': 0.00881, 'smsType': 'Transactional', 'providerResponse': 'Message has been accepted by phone', 'dwellTimeMs': 21, 'dwellTimeMsUntilDeviceAck': 1704}, 'status': 'SUCCESS'} for message_id 41b5e462-9a98-5326-8ec0-bb7e0c09008c

Environment

staging

What pages did this appear on?

In notify-api-staging logs

Detail the steps for someone to reproduce

Go through the send flow, send message

What browsers are you seeing the problem on?

No response

Relevant log output

11:07:43.515: [APP/PROC/WORKER.0] [2024-07-25 18:07:43,514: INFO/ForkPoolWorker-7] START TIME 2024-07-25 18:07:12.896489 END TIME 2024-07-25 18:07:43.514677
11:07:44.193: [APP/PROC/WORKER.0] [2024-07-25 18:07:44,192: ERROR/ForkPoolWorker-7] failed to format log message: "'notification'" not found
11:07:44.193: [APP/PROC/WORKER.0] Traceback (most recent call last):
11:07:44.193: [APP/PROC/WORKER.0]   File "/home/vcap/app/notifications_utils/logging.py", line 162, in process_log_record
11:07:44.193: [APP/PROC/WORKER.0]     log_record["message"] = log_record["message"].format(**log_record)
11:07:44.193: [APP/PROC/WORKER.0]                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11:07:44.193: [APP/PROC/WORKER.0] KeyError: "'notification'"
11:07:44.193: [APP/PROC/WORKER.0] [2024-07-25 18:07:44,191: INFO/ForkPoolWorker-7] DELIVERED: {'notification': {'messageId': '41b5e462-9a98-5326-8ec0-bb7e0c09008c', 'timestamp': '2024-07-25 18:07:13.49'}, 'delivery': {'numberOfMessageParts': 1, 'destination': '1XXXXXXXXXX', 'priceInUSD': 0.00881, 'smsType': 'Transactional', 'providerResponse': 'Message has been accepted by phone', 'dwellTimeMs': 21, 'dwellTimeMsUntilDeviceAck': 1704}, 'status': 'SUCCESS'} for message_id 41b5e462-9a98-5326-8ec0-bb7e0c09008c