[sr-dev] [kamailio/kamailio] SystemError: <built-in function is_present> returned a result with an error set (Issue #3019)

wojciechkopciewicz notifications at github.com
Mon Feb 7 21:42:00 CET 2022


### Description
Intermittently the following error is observed when checking if given header is present in SIP INVITE:
SystemError: <built-in function is_present> returned a result with an error set

The complete stack trace is (some names redacted):
11(28) ERROR: {1 195 INVITE nMHZDN.10nOIDt4ldOwz5cqz0XnMepA9} app_python3 [python_support.c:156]: python_handle_exception(): apy_exec: modify_headers((null)): Unhandled exception in the Python code:
TypeError: an integer is required (got type NoneType)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/etc/kamailio/kamailio.py", line 25, in modify_headers
    self.modify_header("SomeHeader")
  File "/etc/kamailio/kamailio.py", line 29, in modify_header
    present = KSR.hdr.is_present(header_name)
SystemError: <built-in function is_present> returned a result with an error set

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.4.6 (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, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```

* **Operating System**:

<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->

```
Linux kamailio-5c7484c74d-vhhr8 5.4.0-1056-azure #58~18.04.1-Ubuntu SMP Wed Jul 28 23:14:18 UTC 2021 x86_64 GNU/Linux
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3019
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3019 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220207/0a868694/attachment.htm>


More information about the sr-dev mailing list