Hi Jayesh,

Sorry for the delay - now I'm ready for troubleshooting this problem.

First of all, are you using any extra or per-leg accounting ? because I see the error comes on param 15, while the acc module uses by default only 6 values.

Also find attached a patch will produce some more logs to help me in finding the error - do not get scared - the patch is printing more stuff as error (but they are not). So, when you get the error again, please send me the logs.

Thanks and regards,
Bogdan

Jayesh Nambiar wrote:
Yes Bogdan, Sure will test it.

--- Jayesh

On Tue, May 26, 2009 at 9:28 PM, Bogdan-Andrei Iancu <[email protected] <mailto:[email protected]>> wrote:

    Hi Jayesh,

    If I prepared some patch to give more info on this error, are you
    willing to test it ?I was not able to reproduce it.

    Regards,
    Bogdan

    Jayesh Nambiar wrote:


           Hello All,


        I came across this problem of entries not getting entered into
        the ACC properly twice or thrice in last two months since I
        upgraded to Opensips 1.5. It so happens that inserts are done
        but many inserts are missed out. The error observed in the
        logs are as follows:
        ERROR:db_mysql:db_mysql_do_prepared_query:
        mysql_stmt_bind_param() failed: Using unsupported buffer type:
        22  (parameter: 15)
        ERROR:acc:acc_db_request: failed to insert into database
        ERROR:db_mysql:db_mysql_do_prepared_query:
        mysql_stmt_bind_param() failed: Using unsupported buffer type:
        17  (parameter: 15)
        ERROR:acc:acc_db_request: failed to insert into database

        The error stops after I restart my Mysql server and then my
        Opensips. After I restart it works well for a period of 8-10
        days and after that I again observe the same errors.
        Can someone please help to debug this. I have downgraded my
        Opensips to 1.4.5 because of this being repeated.

        Thanks in Advance !!

        --- Jayesh
        ------------------------------------------------------------------------

        _______________________________________________
        Users mailing list
        [email protected] <mailto:[email protected]>
        http://lists.opensips.org/cgi-bin/mailman/listinfo/users



Index: modules/db_mysql/dbase.c
===================================================================
--- modules/db_mysql/dbase.c	(revision 5769)
+++ modules/db_mysql/dbase.c	(working copy)
@@ -497,6 +497,10 @@
 		if ( mysql_stmt_bind_param(ctx->stmt, mysql_bind) ) {
 			LM_ERR("mysql_stmt_bind_param() failed: %s\n",
 				mysql_stmt_error(ctx->stmt));
+			for(i=0;i<n+un;i++) {
+				LM_ERR("xXx: param %d was found %d\n",
+					i,mysql_bind[i].buffer_type);
+			}
 			return -1;
 		}
 
Index: modules/db_mysql/val.c
===================================================================
--- modules/db_mysql/val.c	(revision 5769)
+++ modules/db_mysql/val.c	(working copy)
@@ -256,36 +256,42 @@
 
 	switch(VAL_TYPE(v)) {
 		case DB_INT:
+			LM_ERR("xXx: setting param %d as LONG\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_LONG;
 			binds[i].buffer= (char*)&(VAL_INT(v));
 			*binds[i].length= sizeof(VAL_INT(v));
 			break;
 
 		case DB_BITMAP:
+			LM_ERR("xXx: setting param %d as LONG\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_LONG;
 			binds[i].buffer= (char*)&(VAL_BITMAP(v));
 			*binds[i].length= sizeof(VAL_BITMAP(v));
 			break;
 
 		case DB_DOUBLE:
+			LM_ERR("xXx: setting param %d as DOUBLE\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_DOUBLE;
 			binds[i].buffer= (char*)&(VAL_DOUBLE(v));
 			*binds[i].length= sizeof(VAL_DOUBLE(v));
 			break;
 
 		case DB_STRING:
+			LM_ERR("xXx: setting param %d as STRING\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_STRING;
 			binds[i].buffer= (char*)VAL_STRING(v);
 			*binds[i].length= strlen(VAL_STRING(v));
 			break;
 
 		case DB_STR:
+			LM_ERR("xXx: setting param %d as STRING\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_STRING;
 			binds[i].buffer= VAL_STR(v).s;
 			*binds[i].length= VAL_STR(v).len;
 			break;
 
 		case DB_DATETIME:
+			LM_ERR("xXx: setting param %d as DATETIME\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_DATETIME;
 			t = localtime( &VAL_TIME(v) );
 			mt = (MYSQL_TIME*)binds[i].buffer;
@@ -299,6 +305,7 @@
 			break;
 
 		case DB_BLOB:
+			LM_ERR("xXx: setting param %d as BLOB\n",i);
 			binds[i].buffer_type= MYSQL_TYPE_BLOB;
 			binds[i].buffer= VAL_BLOB(v).s;
 			*binds[i].length= VAL_BLOB(v).len;
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to