Environment
| Asterisk | 20.18.2/20.19.0 |
|---|---|
| MySQL | 8.0.46 |
| MySQL ODBC Driver | 9.7(a)/9.6 |
| OS | centos 7/9 |
Issue: After a full server reboot, Asterisk fails to write to the queue_log table via ODBC. The SQL INSERT fails immediately with an “Unknown column ‘data’” error, despite the column existing in the table. The issue resolves itself as soon as module reload res_odbc.so is run from the Asterisk CLI — no config or schema changes needed.
Workaround: Run the following from the Asterisk CLI after every reboot:
asterisk -rx "module reload res_odbc.so"
Error from /var/log/asterisk/full:
[2026-05-07 12:09:26] WARNING[572581][C-000045a4]: res_odbc.c:534 ast_odbc_print_errors: SQL Prepare returned an error: 42S22: [MySQL][ODBC 9.7(a) Driver][mysqld-8.0.46]Unknown column 'data' in 'field list'
[2026-05-07 12:09:26] WARNING[572581][C-000045a4]: res_config_odbc.c:125 custom_prepare: SQL Prepare failed! [INSERT INTO queue_log (time, data, event, agent, queuename, callid) VALUES (?, ?, ?, ?, ?, ?)]
Root cause is unclear. The issue only appeared after upgrading to MySQL 8.0.46 with ODBC driver 9.7(a)/9.6, and may coincide with Asterisk 20.18.2 or 20.19. The schema is correct — the column data exists and is fully accessible after module reload res_odbc.so.
where would i check the root of the issue ?
edit
Asterisk starts: 01:05:12 / 01:05:13
mysqld process: 01:05:15
MySQL operational: 01:05:28