sip-router

SIP Router Project

Tasklist

FS#178 - Kamailio 3.2.0 postgresql 9.1.1 connection problems.

Attached to Project: sip-router
Opened by Nick Altmann (nikbyte) - Monday, 14 November 2011, 06:43 GMT
Last edited by Daniel-Constantin Mierla (miconda) - Thursday, 24 November 2011, 11:38 GMT
Task Type Bug Report
Category DB interface
Status Closed
Assigned To No-one
Operating System Linux
Severity Critical
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Kamailio 3.2.0, linux x86_64.
After upgrading postgresql from 9.0 to 9.1.1 I get:
Nov 14 10:30:59 ERROR: db_postgres [km_pg_con.c:82]: connection pointer is NULL
in log.

In postgresql log I see that about a half connections was made ok, but then this error.
If I set debug=4 in config, connections are made okay and kamailio starts.

I think because connections was made slowly than without debug options.

This task depends upon

Closed by  Daniel-Constantin Mierla (miconda)
Thursday, 24 November 2011, 11:38 GMT
Reason for closing:  Fixed
Additional comments about closing:  Closing at the fix was already in the branch 3.2 but not an official released version number. It will be in 3.2.1
Comment by Nick Altmann (nikbyte) - Monday, 14 November 2011, 09:11 GMT

After postgresql upgrade, kamailio was recompiled.

Comment by Nick Altmann (nikbyte) - Monday, 14 November 2011, 10:48 GMT

Same problem in git 3.3.0

Comment by Nick Altmann (nikbyte) - Monday, 14 November 2011, 10:56 GMT

It seems, problem in location module:

Nov 14 14:56:04 ERROR: db_postgres [km_pg_con.c:82]: connection pointer is NULL
Nov 14 14:56:04 ERROR: db_postgres [km_pg_con.c:95]: cleaning up 0x7f4dca93bc00=pkg_free()
Nov 14 14:56:04 ERROR: <core> [db.c:302]: could not add connection to the pool
Nov 14 14:56:04 ERROR: usrloc [ul_mod.c:360]: child(0): failed to connect to database
Nov 14 14:56:04 ERROR: <core> [sr_module.c:882]: init_mod_child(): Error while initializing module usrloc (//lib64/kamailio/modules_k/usrloc.so)

When I disable location module, kamailio works with db without problems.

Comment by Nick Altmann (nikbyte) - Monday, 14 November 2011, 10:57 GMT

Whan I disable db support in location module - kamailio works.

Comment by Nick Altmann (nikbyte) - Monday, 14 November 2011, 11:11 GMT

I’m sorry. In 3.3.0 from git all right. And problem is in usrloc module of kamailio 3.2.0

Comment by Daniel-Constantin Mierla (miconda) - Monday, 14 November 2011, 20:39 GMT

I checked the logs and there was no commit on usrloc since 3.2.0 was released. Practically 3.2.0 and 3.3.0 have the same usrloc module. So the problem might be something else.

What is your linux distribution? Do you have SELinux enabled or a firewall that does not allow fast opening of new connections? Is potgress on same server or remote? Have you tried with mysql and if yes, did you get same behavior?

Comment by Nick Altmann (nikbyte) - Tuesday, 15 November 2011, 03:10 GMT

I had working server with 3.2.0 and postgresql 9.0. Fedora 14. SELinux disabled, firewall has not rate limit rules. Postgresql on the same server. Mysql also connected to this configuration. Nothing changes. I upgraded to postgresql 9.1.1 and kamailio doesn’t start. :-( I tries to disable module by module and when I disable usrloc it starts. After, I upgrade kamailio to 3.3.0 from git and it starts and works. No changes in configuration. 3.2.0 doesn’t start, 3.3.0 does start. Mystical problem. :-)

Comment by Nick Altmann (nikbyte) - Tuesday, 15 November 2011, 05:10 GMT

0(435) ERROR: db_postgres [km_pg_con.c:82]: connection pointer is NULL

0(435) ERROR: db_postgres [km_pg_con.c:95]: cleaning up 0x7fb7c8970e10=pkg_free()
0(435) ERROR: <core> [db.c:302]: could not add connection to the pool 0(435) ERROR: usrloc [ul_mod.c:360]: child(0): failed to connect to database
0(435) ERROR: <core> [sr_module.c:882]: init_mod_child(): Error while initializing module usrloc (//lib64/kamailio/modules_k/usrloc.so)
0(435) ERROR: <core> [main.c:1388]: ERROR: main_dontfork: init_child(PROC_MAIN) – exiting

Comment by Nick Altmann (nikbyte) - Tuesday, 15 November 2011, 07:43 GMT Comment by Daniel-Constantin Mierla (miconda) - Tuesday, 15 November 2011, 08:15 GMT

OK, that was in DB api and also backported to branch 3.2. For now you would have to update from GIT branch, a tutorial is available at:

The next release in 3.2 series (i.e., version 3.2.1) will have it included.

Btw, have you tried the suggestion of loading the postgres module first?

Loading...