Hi all,
I was trying to keep persistent registrations in the mysql db, but it seems that something is broken in the latest svn: version: openser 1.3.0-pre1-notls (i386/linux) flags: STATS: Off, EXTRA_DEBUG, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. svnrevision: 2:3034M @(#) $Id: main.c 3015 2007-11-05 13:08:50Z henningw $ main.c compiled on 11:41:03 Nov 6 2007 with gcc 4.1.2
The config that I used for testing is pretty simple:
# ----------- global configuration parameters ------------------------ debug=9 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E) children=1 disable_tcp=yes
# ------------------ module loading ---------------------------------- mpath="/usr/local/lib/openser/modules/" loadmodule "mysql.so" loadmodule "sl.so" loadmodule "tm.so" loadmodule "rr.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "mi_fifo.so" modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
loadmodule "usrloc.so" modparam("usrloc", "db_url", "mysql://openser:openserrw@127.0.0.1/openser") modparam("usrloc", "db_mode", 1)
loadmodule "registrar.so" #------------------------- request routing logic ------------------- route{
if (!method=="REGISTER") record_route();
if (loose_route()) { # mark routing logic in request append_hf("P-hint: rr-enforced\r\n"); route(1); };
if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(1); };
if (uri==myself) { if (method=="REGISTER") { save("location"); exit; }; if (!lookup("location")) { sl_send_reply("404", "Not Found"); exit; }; append_hf("P-hint: usrloc applied\r\n"); };
route(1); }
route[1] { if (!t_relay()) { sl_reply_error(); }; exit; }
Here are the relevant debug logs:
Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: core:db_double2str: Error in snprintf Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: mysql:val2str: error while converting string to double Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: core:db_print_values: Error while converting value to string Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: usrloc:db_insert_ucontact: inserting contact in db failed Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: usrloc:insert_ucontact: failed to insert in database
I can see the in memory registration via `openserctl ul show' command, but the mysql database is not updated (verified via `openserctl db show location')
Regards, Ovidiu Sas
Hi Ovidiu,
I will take a look on this.
Regards, Bogdan
Ovidiu Sas wrote:
Hi all,
I was trying to keep persistent registrations in the mysql db, but it seems that something is broken in the latest svn: version: openser 1.3.0-pre1-notls (i386/linux) flags: STATS: Off, EXTRA_DEBUG, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. svnrevision: 2:3034M @(#) $Id: main.c 3015 2007-11-05 13:08:50Z henningw $ main.c compiled on 11:41:03 Nov 6 2007 with gcc 4.1.2
The config that I used for testing is pretty simple:
# ----------- global configuration parameters ------------------------ debug=9 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E) children=1 disable_tcp=yes
# ------------------ module loading ---------------------------------- mpath="/usr/local/lib/openser/modules/" loadmodule "mysql.so" loadmodule "sl.so" loadmodule "tm.so" loadmodule "rr.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "mi_fifo.so" modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
loadmodule "usrloc.so" modparam("usrloc", "db_url", "mysql://openser:openserrw@127.0.0.1/openser") modparam("usrloc", "db_mode", 1)
loadmodule "registrar.so" #------------------------- request routing logic ------------------- route{
if (!method=="REGISTER") record_route(); if (loose_route()) { # mark routing logic in request append_hf("P-hint: rr-enforced\r\n"); route(1); }; if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(1); }; if (uri==myself) { if (method=="REGISTER") { save("location"); exit; }; if (!lookup("location")) { sl_send_reply("404", "Not Found"); exit; }; append_hf("P-hint: usrloc applied\r\n"); }; route(1);
}
route[1] { if (!t_relay()) { sl_reply_error(); }; exit; }
Here are the relevant debug logs:
Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: core:db_double2str: Error in snprintf Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: mysql:val2str: error while converting string to double Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: core:db_print_values: Error while converting value to string Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: usrloc:db_insert_ucontact: inserting contact in db failed Nov 6 12:19:04 localhost /usr/local/sbin/openser[8963]: usrloc:insert_ucontact: failed to insert in database
I can see the in memory registration via `openserctl ul show' command, but the mysql database is not updated (verified via `openserctl db show location')
Regards, Ovidiu Sas
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Hi Henning,
I was suspecting this ;)...it was the last change in the DB value translation.
OK - I will let it to you.
Thanks and regards, Bogdan
Henning Westerholt wrote:
On Wednesday 07 November 2007, Bogdan-Andrei Iancu wrote:
Hi Ovidiu,
I will take a look on this.
Hello Bogdan,
i was able to reproduce this, it belongs to my commit in rev 3022. I'm working on this.
Cheers,
Henning
On Wednesday 07 November 2007, Bogdan-Andrei Iancu wrote:
Hi Henning,
I was suspecting this ;)...it was the last change in the DB value translation.
OK - I will let it to you.
I've reverted the commit in question. The current behaviour is not optimal, so the complain from the db_berkeley module is correct. But mysql don't work without this quoting at all.
The quoting for time values should be done in the val2str function, like for the other conversion functions for STRING or BLOB datatypes. But for this changes its probably to late now. We need stability in this area.
William, could you please try to work around this error in the db_berkeley module? One option would be to simply copy and modify the time2str function to your needs.
Thanks and regards,
Henning
Hi Henning,
I agree...The right fix will be to have db_time2str() returning a not-quoted value and let the val2str() func of each driver to decide if it should be or not quoted..
If it is not to much work, I think it will be better to have the fix before the release. Otherwise, we need to open a bug report to have it in mind.
Regards, Bogdan
Henning Westerholt wrote:
On Wednesday 07 November 2007, Bogdan-Andrei Iancu wrote:
Hi Henning,
I was suspecting this ;)...it was the last change in the DB value translation.
OK - I will let it to you.
I've reverted the commit in question. The current behaviour is not optimal, so the complain from the db_berkeley module is correct. But mysql don't work without this quoting at all.
The quoting for time values should be done in the val2str function, like for the other conversion functions for STRING or BLOB datatypes. But for this changes its probably to late now. We need stability in this area.
William, could you please try to work around this error in the db_berkeley module? One option would be to simply copy and modify the time2str function to your needs.
Thanks and regards,
Henning