Hi All,
I've performed some crude troubleshooting and managed to replicate the
issue with the Debian packages and standard installation
<https://kamailio.org/docs/tutorials/devel/kamailio-install-guide-deb/>
with example configuration, the only changes to kamailio.cfg are:
#!define WITH_MYSQL
#!define WITH_PRESENCE
modparam("presence", "local_log_facility", "LOG_LOCAL3")
When the "local_log_facility" parameter is defined as per the documentation
<https://kamailio.org/docs/modules/5.4.x/modules/presence.html#presence.p.local_log_facility>,
Kamailio will fail to start with the following error:
May 12 15:48:41 kamailio /usr/sbin/kamailio[13050]: ERROR: presence
[presence.c:656]: fixup_presence(): Bad config - you can not call
'handle_publish' function (db_url not set)
May 12 15:48:41 kamailio /usr/sbin/kamailio[13050]: ERROR: <core>
[core/route.c:1166]: fix_actions(): fixing failed (code=-1) at
cfg:/etc/kamailio/kamailio.cfg:769
May 12 15:48:41 kamailio /usr/sbin/kamailio[13050]: ERROR: <core>
[core/route.c:1166]: fix_actions(): fixing failed (code=-1) at
cfg:/etc/kamailio/kamailio.cfg:775
If I set it as the following, Kamailio starts up without error:
modparam("presence", "local_log_facility", "3")
Thanks
On Tue, May 11, 2021 at 8:12 PM Marrold <kamailio(a)marrold.co.uk> wrote:
Hi Both,
Juha - Thanks for sharing your config , I tweaked the values in my config
but still experience the same issue.
Daniel - We're not using the utils module, although we are using siputils
and cfgutils. OS is stock Debian 10 and GCC is version 8.3.0
For what it's worth I edited the "Bad config - you can not call
'handle_publish' function" log line to include the value for
*pres_library_mode
*and it appears to be set to 10. Where that's coming from, I have no idea.
Thanks again
On Mon, May 10, 2021 at 6:10 PM Daniel-Constantin Mierla <
miconda(a)gmail.com> wrote:
> Hello,
>
> do you use utils module? If yes, what is your operating system and the
> compiler version (if you compiled from sources, not installing from
> packages)?
>
> Cheers,
> Daniel
> On 10.05.21 15:01, Marrold wrote:
>
> Hi,
>
> We're trying to upgrade from 5.3.X to 5.4.5 however kamailio will not
> start and produces the following error, despite the db_url being set in the
> config and printed in the logs:
>
> Bad config - you can not call 'handle_publish' function (db_url not set)
>
> Looking at the code this error only seems plausible if the
> *pres_library_mode* is set to 1 here
>
<https://github.com/kamailio/kamailio/blob/cc2a9518207e36b7b18aef5c8714f0c21da3dd95/src/modules/presence/presence.c#L296>
but
> we don't see the corresponding "switch to library mode" message in the
> debug logs which leaves me a bit stuck - I've included the grepped logs at
> the bottom of the message.
>
> Does anyone have any ideas what is causing this issue? I've seen a
> previous issue relating to interactions between presence and presence_xml
> which we're also using, but it looks like this was fixed in an older
> version.
>
> Any suggestions appreciated.
>
> # ----- presence params -----
> modparam("presence", "db_url", DBURL)
> modparam("presence", "db_update_period", 20)
> modparam("presence", "clean_period", 60)
> modparam("presence", "local_log_facility",
"LOG_LOCAL3")
> modparam("presence", "max_expires", 14430)
>
> # ----- presence_xml params -----
> modparam("presence_xml", "db_url", DBURL)
> modparam("presence_xml", "force_active", 1)
>
> root@kamailio:/etc/kamailio# grep -i "presence"
> /var/log/kamailio/kamailio.log
> May 10 12:44:14 kamailio /sbin/kamailio[23729]: ERROR: presence
> [presence.c:656]: fixup_presence(): Bad config - you can not call
> 'handle_publish' function (db_url not set)
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.y:1810]:
> yyparse(): loading module presence.so
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:525]:
> load_module(): trying to load </lib64/kamailio/modules/presence.so>
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/kemi.c:2927]:
> sr_kemi_modules_add(): adding module: presence
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:287]:
> register_module(): register PV from: presence
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.lex:1796]:
> pp_define(): defining id: MOD_presence
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.y:1810]:
> yyparse(): loading module presence_xml.so
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:525]:
> load_module(): trying to load </lib64/kamailio/modules/presence_xml.so>
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/kemi.c:2927]:
> sr_kemi_modules_add(): adding module: presence_xml
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.lex:1796]:
> pp_define(): defining id: MOD_presence_xml
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.y:1810]:
> yyparse(): loading module presence_mwi.so
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:525]:
> load_module(): trying to load </lib64/kamailio/modules/presence_mwi.so>
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.lex:1796]:
> pp_define(): defining id: MOD_presence_mwi
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.y:1810]:
> yyparse(): loading module presence_dialoginfo.so
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:525]:
> load_module(): trying to load
> </lib64/kamailio/modules/presence_dialoginfo.so>
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/cfg.lex:1796]:
> pp_define(): defining id: MOD_presence_dialoginfo
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence' matches module 'presence'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <db_url> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <db_url> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence' matches module 'presence'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <db_update_period> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <db_update_period> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence' matches module 'presence'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <clean_period> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <clean_period> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence' matches module 'presence'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <local_log_facility> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <local_log_facility> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence' matches module 'presence'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <max_expires> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <max_expires> in module presence
> [/lib64/kamailio/modules/presence.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence_xml' matches module 'presence_xml'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <db_url> in module presence_xml
> [/lib64/kamailio/modules/presence_xml.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <db_url> in module presence_xml
> [/lib64/kamailio/modules/presence_xml.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:107]:
> set_mod_param_regex(): 'presence_xml' matches module 'presence_xml'
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/sr_module.c:744]:
> find_param_export(): found <force_active> in module presence_xml
> [/lib64/kamailio/modules/presence_xml.so]
> May 10 12:44:41 kamailio kamailio: DEBUG: <core> [core/modparam.c:123]:
> set_mod_param_regex(): found <force_active> in module presence_xml
> [/lib64/kamailio/modules/presence_xml.so]
> May 10 12:44:43 kamailio kamailio: DEBUG: <core> [core/sr_module.c:652]:
> find_mod_export_record(): found export of <handle_publish> in module
> presence [/lib64/kamailio/modules/presence.so]
> May 10 12:44:43 kamailio kamailio: DEBUG: <core> [core/sr_module.c:652]:
> find_mod_export_record(): found export of <handle_subscribe> in module
> presence [/lib64/kamailio/modules/presence.so]
> May 10 12:44:43 kamailio kamailio: DEBUG: <core> [core/route.c:129]:
> route_add(): mapping routing block (0x560e73f9a440)[PRESENCE] to 11
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:873]: init_mod(): presence
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [presence.c:293]: mod_init(): db_url=mysql://kamailio:PASSWORD@localhost/kamailio
> (len=50 addr=0x7f3a33d4e288)
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [presence.c:337]: mod_init(): server_address parameter not set in
> configuration file
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [subscribe.c:2529]: restore_db_subs(): loading information from database 0
> records
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:873]: init_mod(): presence_xml
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence_xml
> [presence_xml.c:170]: mod_init():
db_url=mysql://kamailio:PASSWORD@localhost/kamailio
> (len=50 addr=0x7f3a33d4ef00)
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:652]: find_mod_export_record(): found export of
> <bind_presence> in module presence [/lib64/kamailio/modules/presence.so]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [presence/1]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [presence.winfo/2]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:239]: add_event(): successfully added event: presence - len= 8
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence_xml
> [add_events.c:75]: xml_add_events(): added 'presence' event to presence
> module
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [presence.winfo/2]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [presence/1]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:188]: add_event(): Found wipeer event [presence] for event
> [presence.winfo]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:239]: add_event(): successfully added event: presence.winfo -
> len= 14
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence_xml
> [add_events.c:94]: xml_add_events(): added 'presence.winfo' event to
> presence module
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [xcap-diff/0]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [xcap-diff.winfo/0]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:239]: add_event(): successfully added event: xcap-diff - len=
> 9
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence_xml
> [add_events.c:132]: xml_add_events(): added 'xcap-diff' event to presence
> module
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:873]: init_mod(): presence_mwi
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:652]: find_mod_export_record(): found export of
> <bind_presence> in module presence [/lib64/kamailio/modules/presence.so]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [message-summary/6]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [message-summary.winfo/0]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:239]: add_event(): successfully added event: message-summary
> - len= 15
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:873]: init_mod(): presence_dialoginfo
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: <core>
> [core/sr_module.c:652]: find_mod_export_record(): found export of
> <bind_presence> in module presence [/lib64/kamailio/modules/presence.so]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [dialog/5]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:324]: search_event(): start event= [dialog.winfo/0]
> May 10 12:44:45 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [event_list.c:239]: add_event(): successfully added event: dialog - len= 6
> May 10 12:44:47 kamailio /sbin/kamailio[23830]: ERROR: presence
> [presence.c:656]: fixup_presence(): Bad config - you can not call
> 'handle_publish' function (db_url not set)
> May 10 12:44:47 kamailio /sbin/kamailio[23830]: DEBUG: presence_xml
> [presence_xml.c:295]: destroy(): start
> May 10 12:44:47 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [subscribe.c:2433]: timer_db_update(): db_update timer
> May 10 12:44:47 kamailio /sbin/kamailio[23830]: DEBUG: presence
> [subscribe.c:2137]: update_db_subs_timer(): update_db_subs_timer: start
>
>
>
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> * sr-users(a)lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
> *
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla --
www.asipto.comwww.twitter.com/miconda --
www.linkedin.com/in/miconda
> Kamailio Advanced Training - Online
> May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
> *
https://www.asipto.com/sw/kamailio-advanced-training-online/
>
>