[OpenSIPS-Users] Postgresql question

Nick Altmann nick.altmann at gmail.com
Wed Apr 11 21:09:11 CEST 2012


Two problems.

1. Unique key conflict.
DB record is valid, but phone sends registers too quick.
For example, expire time 60 seconds, but phone send register packets
every 10 seconds.
It's buggy UACs.

2. Consistency problem.
I cannot reproduce it.
Sometimes opensips sends updates to db, but there are no record.
Record was earlier inserted by opensips, but now it's absent.

--
Nick


2012/4/11 Vlad Paiu <vladpaiu at opensips.org>:
> Hi Nick,
>
> Can you replicate such a scenario ?
> I see you get a conflict on the unique key (username, domain, contact ). Is
> the entry in the DB expired, or is it valid, but the phone sends Registers
> too fast ?
>
> Regards
>
> Vlad Paiu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
>
>
> On 04/10/2012 10:37 PM, Nick Altmann wrote:
>>
>> I see too many messages in log from postgresql:
>>
>> Apr 10 03:11:02 opensips /usr/sbin/opensips[27715]:
>> ERROR:db_postgres:db_postgres_submit_query: 0x85fd80 PQsendQuery
>> Error: ERROR:  duplicate key value violates unique constraint
>> "location_account_contact_idx"
>> DETAIL:  Key (username, domain, contact)=(fourten, diacom.mangosip.ru,
>> sip:client at 8.8.8.8:5060) already exists.
>>  Query: insert into location
>>
>> (username,contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified,domain
>> ) values ('client','sip:client at 8.8.8.8:5060','2012-04-10
>> 03:11:12',0.00
>> ,'E6BB-5B47-4717491289ED94D347BE-671 at SipHost',333,0,0,'dlink
>> 12-37-61928258-0.9.5.1.735',NULL,NULL,'udp:4.4.4.4:5060',NULL,'2012-04-10
>> 03:11:02','opensips.org')
>> Apr 10 03:11:02 opensips /usr/sbin/opensips[27715]:
>> ERROR:db_postgres:db_postgres_store_result: 0x85fd80 - invalid query,
>> execution aborted
>> Apr 10 03:11:02 opensips /usr/sbin/opensips[27715]:
>> ERROR:db_postgres:db_postgres_store_result: 0x85fd80:
>> PGRES_FATAL_ERROR
>> Apr 10 03:11:02 opensips /usr/sbin/opensips[27715]:
>> ERROR:db_postgres:db_postgres_store_result: 0x85fd80:
>> Apr 10 03:11:02 opensips /usr/sbin/opensips[27715]:
>> WARNING:db_postgres:db_postgres_insert: unexpected result returned
>>
>> It's when client send registration too quickly. What can I do to
>> resolve this problem?
>>
>> And also there are bug, that opensips "thinks" that record there and
>> sends updates, but there are no record.
>> It would be helpful if it checks number of updated records and if it's
>> equal 0, insert record.
>>
>> I don't know yet how to reproduce. But this problem may be enough often.
>>
>> --
>> Nick
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list