[asterisk-bugs] [Asterisk 0018634]: PGSQL db update issue

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jan 17 09:57:40 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18634 
====================================================================== 
Reported By:                hydr0gen
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18634
Category:                   CDR/cdr_pgsql
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.2.16 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-01-17 09:44 CST
Last Modified:              2011-01-17 09:57 CST
====================================================================== 
Summary:                    PGSQL db update issue
Description: 
I can't reproduce error. It happend sometimes. Asterisk is trying to insert
wrong SQL code.

from Postgresql debug:
Jan 17 15:27:58 TuX postgres[26769]: [4-1] ERROR:  syntax error at or near
"VALUES" at character 329
Jan 17 15:27:58 TuX postgres[26769]: [4-2] STATEMENT:   VALUES
("calldate"'2011-01-17 15:30:03',"clid",'"759"
<759>',"src",'759',"dst",'1007',"dcontext",'local',"channel",'SIP/759-00000371',"dstchannel",'SIP/1007-00000372',"lastapp",'Dial',"lastdata",'SIP/1007,20,rtT',"duration",82,"billsec",75,"disposition",'ANSWERED',"amaflags",3,"accountcode",'759',"uniqueid",'1295278203.882')
VALUES ("calldate"'2011-01-17 15:30:03',"clid",'"759"
<759>',"src",'759',"dst",'1007',"dcontext",'local',"channel",'SIP/759-00000371',"dstchannel",'SIP/1007-00000372',"lastapp",'Dial',"lastdata",'SIP/1007,20,rtT',"duration",82,"billsec",75,"disposition",'ANSWERED',"amaflags",3,"accountcode",'759',"uniqueid",'1295278203.882')

as you can see asterisk is trying to insert wrong code, the values, witch
goes past "VALUES" consist values name.

The thing is - when it's happen asterisk core dumps. I havn't seen this
issue before i start using:

sip.conf:
limitonpeer=yes
notifyringing=yes
rtcachefriends=yes
rtupdate=yes

I'm using REALTIME SIP/Queues/MOH/VM

Today i updated from 1.6.2.15 (freebsd) to 1.6.2.16. Nothing changed.
Asterisk still sometimes core dumps.
====================================================================== 

---------------------------------------------------------------------- 
 (0130564) hydr0gen (reporter) - 2011-01-17 09:57
 https://issues.asterisk.org/view.php?id=18634#c130564 
---------------------------------------------------------------------- 
It's look like some garbage goes to sql buffer. 

First time when i got this issue, it was when asterisk try to update suo
table in pgsql. And crashesh because fullname field was 97 char leng, but
db field was only 64. 

asterisk/message:
[Jan 17 15:31:25] ERROR[73256] cdr_pgsql.c: Failed to insert call detail
record into database!
[Jan 17 15:31:25] ERROR[73256] cdr_pgsql.c: Reason: ERROR:  syntax error
at or near "VALUES"
LINE 1: ...,"accountcode",'759',"uniqueid",'1295278203.882') VALUES
("c...
                                                             ^

[Jan 17 15:31:25] ERROR[73256] cdr_pgsql.c: Connection may have been
lost... attempting to reconnect.
[Jan 17 15:31:25] ERROR[73256] cdr_pgsql.c: Connection reestablished.
[Jan 17 15:31:25] ERROR[73256] cdr_pgsql.c: HARD ERROR!  Attempted
reconnection failed.  DROPPING CALL RECORD!
[Jan 17 15:31:25] ERROR[73256] cdr_pgsql.c: Reason: ERROR:  syntax error
at or near "VALUES"
LINE 1: ...,"accountcode",'759',"uniqueid",'1295278203.882') VALUES
("c...
                                                             ^

[Jan 17 15:31:25] ERROR[73256] astobj2.c: bad magic number 0x35323a for
0x2a9afb00
[Jan 17 15:31:25] ERROR[73256] astobj2.c: bad magic number 0x747261 for
0x2a054f22
[Jan 17 15:31:25] ERROR[73256] astobj2.c: bad magic number 0x7261 for
0x2a054f22
[Jan 17 15:31:25] ERROR[73256] astobj2.c: bad magic number 0x7261 for
0x2a054f22
[Jan 17 15:31:25] ERROR[73256] astobj2.c: bad magic number 0x3a706973 for
0x2a9af800 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-17 09:57 hydr0gen       Note Added: 0130564                          
======================================================================




More information about the asterisk-bugs mailing list