CR-Pusher panic pq: dialcode

38 views
Skip to first unread message

Joe Nilson Zegarra Galvez

unread,
Dec 7, 2016, 5:29:38 PM12/7/16
to CDR-Stats
I have installed cdr-stats 3.1 on debian 8.6 and is working fine, and installed cdr-pusher in ubuntu 12.04 with asterisk 1.8, when i start supervisor the cdr-pusher.log says:


    /usr/local/go/src/database/sql/sql.go:452 +0x31c
time="2016-12-07T18:10:49-04:00" level=info msg="StartTime: Wed Dec  7 2016 18:10:49"
time="2016-12-07T18:10:49-04:00" level=info msg="RunFetcher waiting on chanSync before fetching"
time="2016-12-07T18:10:49-04:00" level=info msg="Total fetched from database: 100"
time="2016-12-07T18:10:49-04:00" level=info msg="RunFetcher sleeps for 1 seconds!"
panic: pq: null value in column "dialcode" violates not-null constraint

goroutine 7 [running]:
github.com/jmoiron/sqlx.MustExec(0x7f81e3f4bed0, 0xc208103cb0, 0xc2080b4f00, 0x61e6, 0x0, 0x0, 0x0, 0x0, 0x0)
    /opt/app/cdr-pusher/src/github.com/jmoiron/sqlx/sqlx.go:701 +0xde
github.com/jmoiron/sqlx.(*Tx).MustExec(0xc208103cb0, 0xc2080b4f00, 0x61e6, 0x0, 0x0, 0x0, 0x0, 0x0)
    /opt/app/cdr-pusher/src/github.com/jmoiron/sqlx/sqlx.go:442 +0xa2
main.(*PGPusher).BatchInsert(0xc20814b900, 0xc208102840, 0x0, 0x0)
    /opt/app/cdr-pusher/pusher_postgres.go:257 +0xd98
main.(*PGPusher).Push(0xc20814b900, 0xc208102840, 0x0, 0x0)
    /opt/app/cdr-pusher/pusher_postgres.go:303 +0x15f
main.DispatchPush(0xc20800b520, 0x8, 0xc208010f50, 0x70, 0xc20800b530, 0xa, 0xc20800b550, 0xe, 0xc20800b570, 0xa, ...)
    /opt/app/cdr-pusher/cdr_pusher.go:58 +0x124
main.PushResult(0xc20800b520, 0x8, 0xc208010f50, 0x70, 0xc20800b530, 0xa, 0xc20800b550, 0xe, 0xc20800b570, 0xa, ...)
    /opt/app/cdr-pusher/cdr_pusher.go:84 +0x1ff
created by main.RunApp
    /opt/app/cdr-pusher/cdr_pusher.go:124 +0x30b

The error says: panic: pq: null value in column "dialcode" violates not-null constraint

In the cdr-stats server i dont see noone error, the asterisk is configured with mysql

I can't see the error, anyone was see this before?.


thanks for your time

JN

Joe Nilson Zegarra Galvez

unread,
Dec 16, 2016, 5:11:36 PM12/16/16
to CDR-Stats
I solved it, when you create the cdr_import table with cdr-stats scripts they create the dialcode field as not null field in cdr_import table, but in the cdr-pusher sql script it is created as varchar(10) not null.

I simply drop the cdr_import table and in the cdr-pusher make a supervisor stop, supervisor start and the cdr-pusher created the cdr_import table and begin the transmision,

Regards,

JN

obaid...@yuave.com

unread,
Jan 9, 2017, 8:43:00 AM1/9/17
to CDR-Stats

Hi Joe, 

Can you please help me with it.. I am having the same problem. 

Please email me instruction at obaid...@yuave.com 

obaid...@yuave.com

unread,
Jan 9, 2017, 10:56:07 AM1/9/17
to CDR-Stats
thanks Joe.. got it fixed... thanks for sharing.. :)
Reply all
Reply to author
Forward
0 new messages