[asterisk-bugs] [JIRA] (ASTERISK-21662) Res_odbc keeps losing connection to MySQL

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Mon Apr 22 09:48:01 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205508#comment-205508 ] 

Richard Mudgett edited comment on ASTERISK-21662 at 4/22/13 9:46 AM:
---------------------------------------------------------------------

Fixed that issue but I still see the same issue.
{noformat}
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.1 Driver]MySQL server has gone away
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.1.42]MySQL server has gone away (65)
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [MySQL-asterisk]...
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: Connection is down attempting to reconnect...
[Apr 21 13:09:35] NOTICE[24159][C-00000001] res_odbc.c: Connecting asterisk
{noformat}

I would think that many people would have this same issue if the connection to the mysql database doesn't always stay connecected 24/7.

{noformat}
mysql> desc sipusers;
+-------------------+--------------+------+-----+---------+-------+
| Field             | Type         | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| name              | char(64)     | NO   |     |         |       |
| defaultuser       | char(64)     | NO   |     |         |       |
| type              | varchar(6)   | NO   |     |         |       |
| secret            | char(25)     | NO   |     |         |       |
| host              | char(64)     | NO   |     |         |       |
| callerid          | char(64)     | NO   |     |         |       |
| context           | char(64)     | NO   |     |         |       |
| mailbox           | varchar(129) | NO   |     |         |       |
| subscribemwi      | varchar(2)   | NO   |     |         |       |
| regexten          | char(64)     | YES  |     | NULL    |       |
| nat               | varchar(7)   | NO   |     |         |       |
| fromuser          | char(64)     | NO   |     |         |       |
| authuser          | binary(0)    | YES  |     | NULL    |       |
| fromdomain        | char(64)     | NO   |     |         |       |
| mohinterpret      | char(64)     | NO   |     |         |       |
| mohsuggest        | char(64)     | NO   |     |         |       |
| insecure          | binary(0)    | YES  |     | NULL    |       |
| dtmfmode          | varchar(7)   | NO   |     |         |       |
| directmedia       | varchar(2)   | NO   |     |         |       |
| directrtpsetup    | varchar(3)   | NO   |     |         |       |
| disallow          | varchar(3)   | NO   |     |         |       |
| allow             | varchar(14)  | NO   |     |         |       |
| defaultip         | char(64)     | NO   |     |         |       |
| ipaddr            | char(64)     | NO   |     |         |       |
| port              | varchar(4)   | NO   |     |         |       |
| callbackextension | binary(0)    | YES  |     | NULL    |       |
| callcounter       | varchar(3)   | NO   |     |         |       |
| busylevel         | varchar(1)   | NO   |     |         |       |
| regseconds        | binary(0)    | YES  |     | NULL    |       |
+-------------------+--------------+------+-----+---------+-------+
29 rows in set (0.01 sec)
{noformat}

                
      was (Author: osiris123d):
    Fixed that issue but I still see the same issue.

[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.1 Driver]MySQL server has gone away
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.1.42]MySQL server has gone away (65)
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [MySQL-asterisk]...
[Apr 21 13:09:30] WARNING[24159][C-00000001] res_odbc.c: Connection is down attempting to reconnect...
[Apr 21 13:09:35] NOTICE[24159][C-00000001] res_odbc.c: Connecting asterisk

I would think that many people would have this same issue if the connection to the mysql database doesn't always stay connecected 24/7.

mysql> desc sipusers;
+-------------------+--------------+------+-----+---------+-------+
| Field             | Type         | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| name              | char(64)     | NO   |     |         |       |
| defaultuser       | char(64)     | NO   |     |         |       |
| type              | varchar(6)   | NO   |     |         |       |
| secret            | char(25)     | NO   |     |         |       |
| host              | char(64)     | NO   |     |         |       |
| callerid          | char(64)     | NO   |     |         |       |
| context           | char(64)     | NO   |     |         |       |
| mailbox           | varchar(129) | NO   |     |         |       |
| subscribemwi      | varchar(2)   | NO   |     |         |       |
| regexten          | char(64)     | YES  |     | NULL    |       |
| nat               | varchar(7)   | NO   |     |         |       |
| fromuser          | char(64)     | NO   |     |         |       |
| authuser          | binary(0)    | YES  |     | NULL    |       |
| fromdomain        | char(64)     | NO   |     |         |       |
| mohinterpret      | char(64)     | NO   |     |         |       |
| mohsuggest        | char(64)     | NO   |     |         |       |
| insecure          | binary(0)    | YES  |     | NULL    |       |
| dtmfmode          | varchar(7)   | NO   |     |         |       |
| directmedia       | varchar(2)   | NO   |     |         |       |
| directrtpsetup    | varchar(3)   | NO   |     |         |       |
| disallow          | varchar(3)   | NO   |     |         |       |
| allow             | varchar(14)  | NO   |     |         |       |
| defaultip         | char(64)     | NO   |     |         |       |
| ipaddr            | char(64)     | NO   |     |         |       |
| port              | varchar(4)   | NO   |     |         |       |
| callbackextension | binary(0)    | YES  |     | NULL    |       |
| callcounter       | varchar(3)   | NO   |     |         |       |
| busylevel         | varchar(1)   | NO   |     |         |       |
| regseconds        | binary(0)    | YES  |     | NULL    |       |
+-------------------+--------------+------+-----+---------+-------+
29 rows in set (0.01 sec)
                  
> Res_odbc keeps losing connection to MySQL
> -----------------------------------------
>
>                 Key: ASTERISK-21662
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21662
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_odbc
>    Affects Versions: 11.3.0
>         Environment: Debian 6.0
>            Reporter: Duane Larson
>            Assignee: Duane Larson
>
> For some reason my ODBC connection to my MySQL server keeps losing its connection.  Because of this calls might be delayed until Asterisk re-establishes the connection.
> I have posted this before in the forum and never got an answer.
> http://forums.asterisk.org/viewtopic.php?p=170284
> Here are the errors I see
> [Apr 19 15:05:18] WARNING[7380][C-00000003] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.1 Driver]MySQL server has gone away
> [Apr 19 15:05:18] WARNING[7380][C-00000003] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.1.42]MySQL server has gone away (65)
> [Apr 19 15:05:18] WARNING[7380][C-00000003] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [MySQL-asterisk]...
> [Apr 19 15:05:18] WARNING[7380][C-00000003] res_odbc.c: Connection is down attempting to reconnect...
> [Apr 19 15:05:23] NOTICE[7380][C-00000003] res_odbc.c: Connecting asterisk
> [Apr 19 15:05:23] NOTICE[7380][C-00000003] res_odbc.c: res_odbc: Connected to asterisk [MySQL-asterisk]
> [Apr 19 15:05:23] WARNING[7380][C-00000003] res_odbc.c: SQL Execute returned an error -1: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.1.42]Unknown column 'callbackextension' in 'where clause' (91)
> [Apr 19 15:05:23] WARNING[7380][C-00000003] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [MySQL-asterisk]...
> [Apr 19 15:05:23] WARNING[7380][C-00000003] res_odbc.c: Connection is down attempting to reconnect...
> [Apr 19 15:05:28] NOTICE[7380][C-00000003] res_odbc.c: Connecting asterisk
> [Apr 19 15:05:28] NOTICE[7380][C-00000003] res_odbc.c: res_odbc: Connected to asterisk [MySQL-asterisk]
> [Apr 19 15:05:28] WARNING[7380][C-00000003] res_odbc.c: SQL Execute returned an error -1: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.1.42]Unknown column 'callbackextension' in 'where clause' (91)
> [Apr 19 15:05:28] WARNING[7380][C-00000003] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [MySQL-asterisk]...
> [Apr 19 15:05:28] WARNING[7380][C-00000003] res_odbc.c: Connection is down attempting to reconnect...
> [Apr 19 15:05:33] NOTICE[7380][C-00000003] res_odbc.c: Connecting asterisk
> [Apr 19 15:05:33] NOTICE[7380][C-00000003] res_odbc.c: res_odbc: Connected to asterisk [MySQL-asterisk]
> [Apr 20 13:24:25] WARNING[7380][C-00000004] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.1 Driver]MySQL server has gone away
> [Apr 20 13:24:25] WARNING[7380][C-00000004] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.1.42]MySQL server has gone away (65)
> [Apr 20 13:24:25] WARNING[7380][C-00000004] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [MySQL-asterisk]...
> [Apr 20 13:24:25] WARNING[7380][C-00000004] res_odbc.c: Connection is down attempting to reconnect...
> [Apr 20 13:24:30] NOTICE[7380][C-00000004] res_odbc.c: Connecting asterisk
> [Apr 20 13:24:30] NOTICE[7380][C-00000004] res_odbc.c: res_odbc: Connected to asterisk [MySQL-asterisk]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list