wazo-stats fails to compute stats because of missing values in queuelog events

Description

Traceback (most recent call last): File "/usr/bin/wazo-stat", line 33, in <module> sys.exit(load_entry_point('wazo-stat==0.1', 'console_scripts', 'wazo-stat')()) File "/usr/lib/python3/dist-packages/wazo_stat/main.py", line 33, in main core.update_db( File "/usr/lib/python3/dist-packages/wazo_stat/core.py", line 89, in update_db queue.fill_calls(dao_sess, period_start, period_end) File "/usr/lib/python3/dist-packages/wazo_stat/queue.py", line 31, in fill_calls fill_abandoned_call(dao_sess, start, end) File "/usr/lib/python3/dist-packages/wazo_stat/queue.py", line 16, in fill_abandoned_call for call in abandoned_calls: File "/usr/lib/python3/dist-packages/xivo_dao/queue_log_dao.py", line 150, in _get_ended_call 'waittime': int(end_event.data3), ValueError: invalid literal for int() with base 10: ''
  • xivo_dao.queue_log_dao._get_ended_call expects end events ABANDON and EXITWITHTIMEOUT from queuelog table to have values filled for column data3, as per asterisk documentation(https://docs.asterisk.org/Operation/Logging/Queue-Logs )

  • occurrences of ABANDON and EXITWITHTIMEOUT events with missing data3 values cause critical error, preventing wazo-stats from completing

Details

queues involved are named q-outbound and _q-outbound. Could outbound queues be configured such as to have unexpected behavior?

Proposal

Code should be resilient to missing data(we apparently can’t assume documentation holds true in all cases). xivo_dao.queue_log_dao._get_ended_call should validate missing values, log an error mentioning the queue name and id, and skip those cases.

Zendesk Ticket IDs

None

Activity

Charles Langlois 
February 16, 2024 at 4:34 PM

According to , outbound queues are not part of wazo, so the client must have a custom setup for those queues. For root cause debugging, more information on those queues would be needed. LIke I said, the best we can do for now would be to ignore those entries and log errors.

Charles Langlois 
February 16, 2024 at 3:24 PM
(edited)

I’m taking on this ticket for 24.03. Expected resolution is that wazo-stats can ignore(skip over) the invalid entries(with missing values). Resolving the underlying cause of the missing data would be out of scope(at least for this sprint).

Done

Details

Priority

Assignee

Reporter

Approvers

Pascal Cadotte

Fix versions

Sprint

Story Points

Zendesk Support

1
Created December 8, 2023 at 4:53 PM
Updated February 21, 2024 at 4:38 PM
Resolved February 19, 2024 at 7:41 PM

Flag notifications