[asterisk-bugs] [JIRA] (ASTERISK-28455) Asterisk res_odbc not working on Proxysql

cagdas kopuz (JIRA) noreply at issues.asterisk.org
Thu Jun 20 03:45:47 CDT 2019


     [ https://issues.asterisk.org/jira/browse/ASTERISK-28455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

cagdas kopuz updated ASTERISK-28455:
------------------------------------

    Attachment: func_odbc without proxysql.txt
                func_odbc with proxysql.txt

With proxysql, asterisk can not continue working to " res_odbc.c:825 ast_odbc_release_obj: Releasing ODBC handle 0x17b6628 into pool"

> Asterisk res_odbc not working on Proxysql
> -----------------------------------------
>
>                 Key: ASTERISK-28455
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28455
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_odbc
>    Affects Versions: 13.26.0
>         Environment: centos 7
>            Reporter: cagdas kopuz
>         Attachments: func_odbc without proxysql.txt, func_odbc with proxysql.txt
>
>
> Asterisk realtime and func_odbc can not connect proxysql server.
> I tried all mysql-connector-odbc 5.0 to 8.0.
> When I connect same database without proxysql everything is fine.
> Asterisk gives me these errors:
> [Jun 20 10:55:21] ERROR[16739]: res_odbc.c:292 ast_odbc_find_table: Unable to query database columns on connection 'proxysql'.
> [Jun 20 10:55:21] ERROR[16739]: res_odbc.c:292 ast_odbc_find_table: Unable to query database columns on connection 'proxysql2'.
> [Jun 20 10:55:21] WARNING[16739]: res_odbc.c:550 ast_odbc_print_errors: SQL Execute returned an error: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.5.30]Unknown column 'data' in 'field list'
> [Jun 20 10:55:21] WARNING[16739]: res_odbc.c:445 ast_odbc_prepare_and_execute: SQL Execute error -1!
> *CLI> [Jun 20 10:55:21] WARNING[16739]: res_odbc.c:550 ast_odbc_print_errors: SQL Execute returned an error: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.5.30]Unknown column 'data' in 'field list'
> [Jun 20 10:55:21] WARNING[16739]: res_odbc.c:445 ast_odbc_prepare_and_execute: SQL Execute error -1!
> [Jun 20 10:55:25] ERROR[16771]: res_odbc.c:292 ast_odbc_find_table: Unable to query database columns on connection 'pbxconf1'.
> [Jun 20 10:55:25] WARNING[16771]: res_odbc.c:550 ast_odbc_print_errors: SQL Execute returned an error: 42000: [MySQL][ODBC 5.1 Driver][mysqld-5.5.30]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE name='startrinity'' at line 1
> [Jun 20 10:55:25] WARNING[16771]: res_odbc.c:445 ast_odbc_prepare_and_execute: SQL Execute error -1!
> realtime reloading:
> [Jun 20 11:17:28] DEBUG[18214]: res_odbc.c:982 _ast_odbc_request_obj2: Reusing ODBC handle 0x7fd648001ac8 from class 'pbxconf1'
> [Jun 20 11:17:28] WARNING[18214]: res_odbc.c:550 ast_odbc_print_errors: SQL Execute returned an error: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.5.30]Lost connection to MySQL server during query
> [Jun 20 11:17:28] WARNING[18214]: res_odbc.c:445 ast_odbc_prepare_and_execute: SQL Execute error -1!
> [Jun 20 11:17:28] WARNING[18214]: res_config_odbc.c:974 config_odbc: SQL select error! [SELECT MAX(LENGTH(var_val)) FROM dialplan WHERE filename='extensions_realtime.include']
> [Jun 20 11:17:28] DEBUG[18214]: res_odbc.c:825 ast_odbc_release_obj: Releasing ODBC handle 0x7fd648001ac8 into pool
> odbcinst.ini
> [MySQL ODBC 5.1 Driver]
> Driver=/usr/lib64/libmyodbc5.so
> UsageCount=1
> -------------------------
> odbc.ini
> [proxysql]
> Description = pbxproxy
> Driver = MySQL ODBC 5.1 Driver
> Server = 10.10.10.221
> Port = 6033
> User = pbxuser
> Password = passw0rd
> Database = pbxlogs
> Option = 3
> --------------------------
> res_odbc.conf
> [proxysql]
> enabled => yes
> dsn => proxysql
> username => pbxuser 
> password => passw0rd 
> pre-connect => yes
> -----------------------
> asterisk cli: odbc show all
> ODBC DSN Settings
>   Name:   proxysql
>   DSN:    proxysql
>     Last connection attempt: 1970-01-01 02:00:00
>     Number of active connections: 1 (out of 1)
>     Logging: Disabled
> I can connect proxysql from host with isql command or php-pdo.
> root at netsantral-test modules]# isql proxysql pbxuser passw0rd -vvv
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL> SELECT start,linkedid FROM pbxlogs.cdr limit 1;
> +--------------------+---------------------------------+
> | start              | linkedid                        |
> +--------------------+---------------------------------+
> | 2019-06-20 10:52:09| 1561017129.475827               |
> +--------------------+---------------------------------+
> SQLRowCount returns 1
> 1 rows fetched



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list