[OpenSIPS-Devel] [ opensips-Bugs-3488471 ] usrloc:db_insert_ucontact: inserting contact in db failed

SourceForge.net noreply at sourceforge.net
Thu Feb 23 10:51:25 CET 2012


Bugs item #3488471, was opened at 2012-02-16 23:32
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3488471&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.7.x
Status: Open
Resolution: None
Priority: 8
Private: Yes
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Vladut-Stefan Paiu (vladut-paiu)
Summary: usrloc:db_insert_ucontact: inserting contact in db failed

Initial Comment:
Usrloc strange stuck on this record:
mysql> select * from location order by expires asc;
+-------+----------+--------+---------------------------------+----------+------+---------------------+-------+---------------------------------------------------+-------+---------------------+-------+--------+---------------------------------------+------------------------+---------+
| id    | username | domain | contact                         | received | path | expires             | q     | callid                                            | cseq  | last_modified       | flags | cflags | user_agent                            | socket                 | methods |
+-------+----------+--------+---------------------------------+----------+------+---------------------+-------+---------------------------------------------------+-------+---------------------+-------+--------+---------------------------------------+------------------------+---------+
| 16638 |          |        | sip:81.211.5.210:5060           | NULL     | NULL | 2012-02-16 18:48:53 | -1.00 | abf2344f-ff1c-ff04-8000-0002a4055cd0 at 81.211.5.210 | 26963 | 2012-02-16 18:38:53 |     0 |      0 | AddPac SIP Gateway                    | udp:87.249.26.210:5061 |    NULL |

Logs:
Feb 17 11:07:12 SimpleOffice-1 /usr/local/sbin/opensips[79108]: ERROR:usrloc:db_insert_ucontact: inserting contact in db failed
Feb 17 11:07:12 SimpleOffice-1 /usr/local/sbin/opensips[79108]: ERROR:usrloc:wb_timer: inserting contact into database failed
Feb 17 11:07:42 SimpleOffice-1 /usr/local/sbin/opensips[79108]: CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error (1062): Duplicate entry 'sip:81.211.5.210:5060' for key 'account_contact_idx'
Feb 17 11:07:42 SimpleOffice-1 /usr/local/sbin/opensips[79108]: ERROR:usrloc:db_insert_ucontact: inserting contact in db failed
Feb 17 11:07:42 SimpleOffice-1 /usr/local/sbin/opensips[79108]: ERROR:usrloc:wb_timer: inserting contact into database failed
Feb 17 11:08:13 SimpleOffice-1 /usr/local/sbin/opensips[79108]: CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error (1062): Duplicate entry 'sip:81.211.5.210:5060' for key 'account_contact_idx'
... 
Fixed by removing this record from database.
FreeBSD 7.1-RC2 i386
OpenSIPS v1.7.1
Mysql 5.1.58

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

Comment By: Nobody/Anonymous (nobody)
Date: 2012-02-23 01:51

Message:
We restart the proxy because of another bug with hanged dialogs in state
3...
http://lists.opensips.org/pipermail/users/2011-February/016721.html
Limiting concurrent calls but dialogs stuck so users can't make calls.. so
it is another story)
Bug over the bug :)

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

Comment By: Nobody/Anonymous (nobody)
Date: 2012-02-23 01:49

Message:
Yes, after restart. I'll try to upgrade to version 1.7.2 and see what's
changed.

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

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-02-21 04:22

Message:
Hi,

So you are saying that the stuck location entries only happen when you do a
restart on the proxy ?
Is it possible to get the full debug OpenSIPS logs for a restart that
caused the stuck location entry ?

Regards,
Vlad

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

Comment By: Nobody/Anonymous (nobody)
Date: 2012-02-21 03:57

Message:
Yes, this is proxy restart problem.
One more stuck record:
Feb 21 15:51:43 SimpleOffice-1 /usr/local/sbin/opensips[21827]:
CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error (1062): D
                  x101--sip:419x101 at 10.192.116.142:5060' for key
'account_contact_idx'
Feb 21 15:51:43 SimpleOffice-1 /usr/local/sbin/opensips[21827]:
ERROR:usrloc:db_insert_ucontact: inserting contact in db failed
Feb 21 15:51:43 SimpleOffice-1 /usr/local/sbin/opensips[21827]:
ERROR:usrloc:wb_timer: inserting contact into database failed

+-------+----------+--------+---------------------------------+----------+------+---------------------+-------+--------------------------------------------+-------+---------------------+-------+--------+----------------------------------+------------------------+---------+
| id    | username | domain | contact                         | received |
path | expires             | q     | callid                                
    | cseq  | last_modified       | flags | cflags | user_agent            
          | socket                 | methods |
+-------+----------+--------+---------------------------------+----------+------+---------------------+-------+--------------------------------------------+-------+---------------------+-------+--------+----------------------------------+------------------------+---------+
| 44822 | 419x101  |        | sip:419x101 at 10.192.116.142:5060 | NULL     |
NULL | 2012-02-21 16:13:58 | -1.00 |
1BD1-859F-47539598E1C3E56C1892-705 at SipHost | 40722 | 2012-02-21 15:55:38 | 
   0 |      0 | dlink 12-37-61928258-0.9.5.1.735 | udp:87.249.26.210:5060 |
   NULL |
+-------+----------+--------+---------------------------------+----------+------+---------------------+-------+--------------------------------------------+-------+---------------------+-------+--------+----------------------------------+------------------------+---------+

Seems that some hardware sending register packets in wrong format and proxy
can't parse them correctly. After restart.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2012-02-20 02:50

Message:
Logs are clear...
2012-02-16 18:48:53 we restarted opensips... then this began to appear in
the logfile.
Another restart, again error in the logfile:
Feb 17 16:05:28 SimpleOffice-1 /usr/local/sbin/opensips[38705]:
CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error (1062):
Duplicate entry 'sip:81.211.5.210:5060' for key 'account_contact_idx'

mysql> select count(*) from location;
+----------+
| count(*) |
+----------+
|     1429 |
+----------+

And only one record is buggy.. i think problem with importing data from
table location on proxy startup.

Tcpdump'ed packet from addpack:
REGISTER sip:87.249.26.210:5061 SIP/2.0
Via: SIP/2.0/UDP 81.211.5.210:5060;branch=z9hG4bKb54ffd01a443419
From: <sip:87.249.26.210>;tag=b54ffd01a4
To: <sip:87.249.26.210>
Call-ID: b5fb344f-efe7-fd41-8001-0002a4055cd0 at 81.211.5.210
CSeq: 43419 REGISTER
Date: Mon, 20 Feb 2012 14:12:58 GMT
User-Agent: AddPac SIP Gateway
Contact: <sip:81.211.5.210:5060>;expires=600
Expires: 600
Content-Length: 0
Max-Forwards: 70


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

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-02-20 01:19

Message:
Hello,

Do you, by any chance, still have any logs from the OpenSIPS and/or Mysql
side from 2012-02-16 18:48:53, the date when that specific contact should
have gotten expired & removed from DB ? I'm curious to see if there were
any relevant errors around that time.

Regards,
Vlad

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

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



More information about the Devel mailing list