[OpenSIPS-Devel] [ opensips-Bugs-3612192 ] db_mysql: Commands out of sync

SourceForge.net noreply at sourceforge.net
Tue May 7 14:53:18 CEST 2013


Bugs item #3612192, was opened at 2013-04-29 06:52
Message generated for change (Comment added) made by osas
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3612192&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ovidiu Sas (osas)
Assigned to: Vladut-Stefan Paiu (vladut-paiu)
Summary: db_mysql: Commands out of sync

Initial Comment:
Opensips started to throw out this errors:
ERROR:db_mysql:db_mysql_do_prepared_query: mysql_stmt_store_result() failed: Commands out of sync; you can't run this command now (2014)
ERROR:usrloc:db_update_ucontact: updating database failed
ERROR:usrloc:update_ucontact: failed to update database

It is only one single process that is constantly throwing out this error.  All other process are able to use the db.

There was another process that had a similar issue, but it cleared out.  That process had a different error:
ERROR:db_mysql:db_mysql_do_prepared_query: mysql_stmt_store_result() failed: Commands out of sync; you can't run this command now (2014)
ERROR:auth_db:get_ha1: failed to query database

It seems that on a query, the system is able to recover, but on an insert, the system fails to recover,

This is on latest 1.9 svn: svnrevision: 2:9980M


Regards,
Ovidiu Sas

----------------------------------------------------------------------

>Comment By: Ovidiu Sas (osas)
Date: 2013-05-07 05:53

Message:
Here's the list of modules with db access that are used:
"usrloc"
"auth_db"
"dispatcher"
"dialplan"
"pua"
"presence"

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2013-05-07 05:49

Message:
The module that is throwing those errors is usrloc.
Those errors were printed out while handling REGISTER and saving location.

Before that, the same process properly handled REGISTERs and there were no
other errors or warnings before (in any opensips process).

----------------------------------------------------------------------

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2013-05-07 02:59

Message:
Hello,

Seems there is a module that doesn't do proper error handling in case of an
error for a select query, and it doesn't properly free the result set after
the query. Thus all subsequent queries attempted on that connection (
shared by all modules for a particular process ) will fail, since freeing
the result for a select query is mandatory before trying to run any other
queries on a connection. On reconnection this will auto-magically fix
itself, since the old result will be purged by the mysqlclient lib.

I'll prepare a patch for this, that will print the module and query that
didn't get properly freed, so we can trace this bug.
In your logs, before you start seeing the 'Commands out of sync' errors, do
you notice any other ( non-db related perhaps ) errors for that process ?

Best Regards,
Vlad

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2013-04-29 07:44

Message:
Here are some updates:
After aprox 6h1/2, the process with issues recovered while processing a
request different then REGISTER:
INFO:db_mysql:switch_state_to_disconnected: disconnect event for
0x2ae4584ea8c0
INFO:db_mysql:reset_all_statements: reseting all statements on connection:
(0x2ae458566b98) 0x2ae4584ea8c0
INFO:db_mysql:connect_with_retry: re-connected successful for
0x2ae4584ea8c0

Regards,
Ovidiu Sas

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3612192&group_id=232389



More information about the Devel mailing list