<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">using<br>
kamailio 5.6.0<br>
python: 3.8.10<br>
OS : ubuntu 20.0.4</p>
<p dir="auto">When trying to use kemi with the default configuration I get on startup.</p>
<p dir="auto"><code class="notranslate">Fatal Python error: failed releasing import lock after fork</code></p>
<h4 dir="auto">Reproduction</h4>
<p dir="auto">Using The configuration described here :<br>
<a href="https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemi/#basic-kemi-python-scripting-example" rel="nofollow">https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemi/#basic-kemi-python-scripting-example</a></p>
<h4 dir="auto">Debugging Data</h4>
<pre class="notranslate"><code class="notranslate"> 0(1) INFO: <core> [core/kemi.c:106]: sr_kemi_core_info(): ===== kamailio.child_init(1)
kamailio             |  0(1) DEBUG: <core> [core/sr_module.c:923]: init_child(): initializing PROC_POSTCHILDINIT with rank -126
kamailio             |  0(1) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 0 rank -126: app_python3 [stand-alone receiver @ 10.10.0.4:5060]
kamailio             | Fatal Python error: failed releasing import lock after fork
kamailio             | Python runtime state: initialized
kamailio             | 
kamailio             | Current thread 0x00007f3faa857180 (most recent call first):
kamailio             | <no Python frame>
kamailio             |  7(14) DEBUG: <core> [core/pt.c:308]: fork_process(): seeding PRNG with 1232772928
kamailio             |  7(14) DEBUG: <core> [core/rand/cryptorand.c:36]: cryptorand_seed(): seeding cryptorand generator with 1232772928
kamailio             |  7(14) DEBUG: <core> [core/rand/fortuna/random.c:175]: sr_add_entropy(): additional 4 bytes entropy added to cryptographic PRNG
kamailio             |  7(14) DEBUG: <core> [core/pt.c:313]: fork_process(): test random numbers 987270226 561754816 1532392054 1162699744
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:923]: init_child(): initializing PROC_RPC with rank -2
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: corex [ctl handler]
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: usrloc [ctl handler]
kamailio             |  7(14) DEBUG: <core> [core/utils/sruid.c:121]: sruid_init(): root for sruid is [ulcx-62931156-e-] (0 / 16)
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: registrar [ctl handler]
kamailio             |  7(14) DEBUG: <core> [core/utils/sruid.c:121]: sruid_init(): root for sruid is [uloc-62931156-e-] (0 / 16)
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: jsonrpcs [ctl handler]
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: kex [ctl handler]
kamailio             |  7(14) DEBUG: kex [kex_mod.c:155]: child_init(): rank is (-2)
kamailio             |  7(14) DEBUG: <core> [core/utils/sruid.c:121]: sruid_init(): root for sruid is [srid-62931156-e-] (0 / 16)
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: tm [ctl handler]
kamailio             |  7(14) DEBUG: tm [callid.c:136]: child_init_callid(): callid: '2ef035de7699493f-14@10.10.0.4'
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: tmx [ctl handler]
kamailio             |  7(14) DEBUG: tmx [tmx_mod.c:262]: child_init(): rank is (-2)
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: sl [ctl handler]
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: ctl [ctl handler]
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: debugger [ctl handler]
kamailio             |  7(14) DEBUG: debugger [debugger_mod.c:224]: child_init(): rank is (-2)
kamailio             |  7(14) DEBUG: <core> [core/sr_module.c:875]: init_mod_child(): idx 7 rank -2: app_python3 [ctl handler]
kamailio             |  7(14) DEBUG: app_python3 [apy_kemi.c:234]: sr_apy_kemi_exec_func_ex(): execution of method: .info
kamailio             |  7(14) DEBUG: app_python3 [apy_kemi.c:266]: sr_apy_kemi_exec_func_ex(): param[1] for: info is str: ===== kamailio.child_init(-2)
kamailio             | 
kamailio             |  7(14) INFO: <core> [core/kemi.c:106]: sr_kemi_core_info(): ===== kamailio.child_init(-2)
kamailio             |  7(14) DEBUG: ctl [ctl.c:329]: mod_child(): ctl: mod_child(0), fork_process=0, csl=0x56186255e180
kamailio             |  7(14) DEBUG: ctl [ctl.c:336]: mod_child(): ctl: 0 io_listen_loop(1, 0x56186255e180)
kamailio             |  7(14) INFO: ctl [io_listener.c:213]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)
kamailio             |  7(14) DEBUG: ctl [io_listener.c:245]: io_listen_loop(): io_listen_loop: adding socket 8, type 2, transport 3 (/var/run/kamailio//kamailio_ctl)
kamailio             |  7(14) DEBUG: ctl [../../core/io_wait.h:374]: io_watch_add(): processing io_watch_add(0x7f3fa8aa2380, 8, 2, 0x56186255e180) - fd_no=0
kamailio exited with code 139

</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3125">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZKHT4VUJFW7OSEWQF3VMMFBXANCNFSM5XHWESZA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZN7IPCBUQCSLLXU3ZDVMMFBXA5CNFSM5XHWESZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4SU47KWA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3125</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3125",
"url": "https://github.com/kamailio/kamailio/issues/3125",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>