Asterisk, Mysql, Odbc (Unknown column 'data' in 'field list')

I use Asterisk 16.5.0, Mysql 5.7.28 and MySQL ODBC 8.0 Unicode Driver. I configured connection with MySql via ODBC connection. After some time Asterisk shows warning like that.

[2019-12-11 15:34:06] WARNING[1995]: res_odbc.c:538 ast_odbc_print_errors: SQL Prepare returned an error: 42S22: [MySQL][ODBC 8.0(w) Driver][mysqld-5.7.28-log]Unknown column 'data' in 'field list'
[2019-12-11 15:34:06] WARNING[1995]: res_config_odbc.c:122 custom_prepare: SQL Prepare failed! [INSERT INTO queue_log (time, data, event, agent, queuename, callid) VALUES (?, ?, ?, ?, ?, ?)]

After restarting Asterisk, the problem does not occur. But after some time problem begins occur.

Have you checked the database table to make sure that the column exists? This insertion would only occur when app_queue was used.

Ofcourse column exists. Yes i use Mysql queue_log table for queue actions.

I resolved problem with increase interactive_timeout and wait_timeout. One day enough for me (1 day = 86400 secnd)

interactive_timeout=86400
wait_timeout=86400

I still cannot understand that why command odbc show returns

Number of active connections: 1 (out of 1) 

but connection is broken. It looks from database (nothing inserts to tables like cdr, cel, queue_log) and also i looked connected users from mysql with command show processlist. Really which user Asterisk connects to Mysql not exist in connectected users. What does show command odbc show ? Or may be exist some bug in odbc show ?

It shows the ODBC configuration as defined for Asterisk and the connections that are active. The above means that there is a single ODBC connection to the database active, from the perspective of Asterisk and ODBC.

ODBC is an abstraction layer so stuff can happen underneath in the ODBC part of the MySQL connector part, of which Asterisk is unaware.

1 Like

I happens again with connection problem.
How can i increase timeout time between Asterisk and Mysql (via ODBC connection).
I know some metod which solve this problem.
Every 1 hour execute command with cron job.

asterisk -rx 'reload'

With this command Asterisk reload resumes connection or restore died connection.
But I think that is not a professional approach.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.