whosgonna created an issue (kamailio/kamailio#4605)
### Description
Kamailio fails to start using the Deb 13/Trixie package for `app_python3s` with
the following:
```
0(68) ERROR: <core> [core/sr_module.c:613]: ksr_load_module(): could not open
module </usr/lib/x86_64-linux-gnu/kamailio/modules/app_python3s.so>:
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_python3s.so: undefined symbol:
PyExc_SystemExit
0(68) CRITICAL: <core> [core/cfg.y:4105]: yyerror_at(): parse error in config
file /etc/kamailio/kamailio.cfg, line 3, column 12-25: failed to load module
```
### Troubleshooting
The problem seems limited to `app_python3s` (`app_python3` loads cleanly), and
with the 6.1.0 packages: The same failure occurs in Debian 12 (Bookworm), and
the problem does not occur with the current 6.0 packages (works in both
Bookworm and Trixie)
#### Reproduction
I've created a container image showing the problem. Project is at
https://github.com/whosgonna/kampy_example
Container image: `whosgonna/kampy:deb13-slim_kam61`
```
docker run --rm -it whosgonna/kampy:deb13-slim_kam61
```
Since the file set is pretty small to reproduce, these are the relevant files:
##### Dockerfile:
```
FROM debian:13-slim
RUN apt update \
&& apt install -y --no-install-recommends wget gpg \
&& wget -O- http://deb.kamailio.org/kamailiodebkey.gpg | gpg --dearmor >
/usr/share/keyrings/kamailio.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/kamailio.gpg]
http://deb.kamailio.org/kamailio61 trixie main" >
/etc/apt/sources.list.d/kamailio.list \
&& echo "deb-src [signed-by=/usr/share/keyrings/kamailio.gpg]
http://deb.kamailio.org/kamailio61 trixie main" >>
/etc/apt/sources.list.d/kamailio.list \
&& apt update \
&& apt install -y kamailio kamailio-python3-modules
COPY etc/kamailio /etc/kamailio
ENTRYPOINT ["kamailio", "-dDDE", "-u", "kamailio", "-g", "kamailio"]
```
##### /etc/kamailio/kamailio.cfg:
```
#!KAMAILIO
loadmodule "app_python3s"
modparam("app_python3s", "load", "/etc/kamailio/kamailio.py")
modparam("app_python3s", "script_init", "ksr_script_init")
request_route {
;
}
```
##### /etc/kamailio/kamailio.py
```
import KSR as KSR
def ksr_script_init():
KSR.info("init python script\n")
return 1
```
#### Log Messages
Starting kamailio at debug level:
```
# kamailio -dddDDeE
0(11) INFO: <core> [main.c:2400]: main(): private (per process) memory:
8388608 bytes
0(11) DEBUG: <core> [core/mem/q_malloc.c:217]: qm_malloc_init():
QM_OPTIMIZE=32768, QM_OPTIMIZE/ROUNDTO=2048, ROUNDTO=16
0(11) DEBUG: <core> [core/mem/q_malloc.c:219]: qm_malloc_init():
QM_HASH_SIZE=2098, qm_block_size=268608, qm_block_size % ROUNDTO=0
0(11) DEBUG: <core> [core/mem/q_malloc.c:223]: qm_malloc_init():
qm_malloc_init(0x7971701b6010, 8388608), start=0x7971701b6010
0(11) DEBUG: <core> [core/mem/q_malloc.c:234]: qm_malloc_init(): size=
8388608, init_overhead=268720
0(11) DEBUG: <core> [core/pvapi.c:2069]: pv_init_buffer(): PV print buffer
initialized to [40][32768]
0(11) DEBUG: <core> [core/cfg.lex:2121]: pp_define(): defining id: KAMAILIO_6
0(11) DEBUG: <core> [core/cfg.lex:2121]: pp_define(): defining id: KAMAILIO_6_1
0(11) DEBUG: <core> [core/cfg.lex:2121]: pp_define(): defining id:
KAMAILIO_6_1_0
0(11) DEBUG: <core> [core/cfg.lex:2121]: pp_define(): defining id:
KAMAILIO_VERSION
0(11) DEBUG: <core> [core/cfg.lex:2236]: pp_define_set(): ### setting define
ID [KAMAILIO_VERSION] value [6001000] (mode: 0)
0(11) DEBUG: <core> [core/cfg.lex:2121]: pp_define(): defining id: OS_NAME
0(11) DEBUG: <core> [core/cfg.lex:2236]: pp_define_set(): ### setting define
ID [OS_NAME] value [Linux] (mode: 0)
0(11) DEBUG: <core> [core/route.c:131]: route_add(): mapping routing block
(0x654c1de57bc0)[0] to 0
0(11) DEBUG: <core> [core/route.c:131]: route_add(): mapping routing block
(0x654c1de57ba0)[0] to 0
0(11) DEBUG: <core> [core/route.c:131]: route_add(): mapping routing block
(0x654c1de57b80)[0] to 0
0(11) DEBUG: <core> [core/route.c:131]: route_add(): mapping routing block
(0x654c1de57b60)[0] to 0
0(11) DEBUG: <core> [core/route.c:131]: route_add(): mapping routing block
(0x654c1de57b40)[0] to 0
0(11) DEBUG: <core> [core/route.c:131]: route_add(): mapping routing block
(0x654c1de57b20)[0] to 0
0(11) DEBUG: <core> [core/rand/fortuna/random.c:166]: system_seed():
cryptographic PRNG seed done with 32 bytes
0(11) DEBUG: <core> [core/cfg.y:2254]: yyparse(): loading module app_python3s
0(11) DEBUG: <core> [core/sr_module.c:537]: ksr_locate_module(): found module
to load </usr/lib/x86_64-linux-gnu/kamailio/modules/app_python3s.so>
0(11) DEBUG: <core> [core/sr_module.c:592]: ksr_load_module(): trying to load
</usr/lib/x86_64-linux-gnu/kamailio/modules/app_python3s.so>
0(11) ERROR: <core> [core/sr_module.c:613]: ksr_load_module(): could not open
module </usr/lib/x86_64-linux-gnu/kamailio/modules/app_python3s.so>:
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_python3s.so: undefined symbol:
PyExc_SystemExit
0(11) CRITICAL: <core> [core/cfg.y:4105]: yyerror_at(): parse error in config
file /etc/kamailio/kamailio.cfg, line 3, column 12-25: failed to load module
```
### Possible Solutions
Missing library link?
### Additional Information
* **Kamailio Version**
```
version: kamailio 6.1.0 (x86_64/Linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC,
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, DBG_QM_MALLOC, DBG_F_MALLOC,
DBG_TLSF_MALLOC, USE_FUTEX, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll.
id: unknown
compiled with gcc 14.2.0
```
* **Operating System**:
```
# uname -a
Linux 2cc27a3e0933 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu
Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.3
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4605
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/[email protected]>_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the
sender!