jookies / jasmin

Jasmin - Open source SMS gateway
http://jasminsms.com
Other
1.04k stars 556 forks source link

InterceptorPB not connected when using docker container #969

Closed janari-p closed 2 years ago

janari-p commented 3 years ago

Shutting docker down (not killing it, a proper shutdown) will not clean up interceptord.py lock /tmp/interceptord.lock

Next time docker is started I get

2021-03-01 16:18:08 DEBUG    1 RouterPB selected StaticMTInterceptor/<MTIS (pyCode=# Jasmin package is installed  ..)> interceptor for this SubmitSmPDU
2021-03-01 16:18:08 ERROR    1 InterceptorPB not connected !
2021-03-01 16:18:08 ERROR    1 Error: 503: InterceptorNotConnectedError (InterceptorPB not connected !)
2021-03-01 16:18:08 DEBUG    1 Returning {'return': 'InterceptorPB not connected !', 'status': 503} to 172.18.0.1.

Inside the container I see

root@a8993aed657b:/usr/jasmin# ps aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.2  2.8 677488 56956 ?        Ssl  16:17   0:00 /usr/local/bin/python /usr/local/bin/jasmind.py --enable-interceptor-client --enable-dlr-thrower --enable-dlr-lookup -u jcliadmin -p jclipwd
root           6  0.1  0.0      0     0 ?        Z    16:17   0:00 [interceptord.py] <defunct>

meaning the interceptord.py is dead (has zombie state)

Fix is to remove /tmp/interceptord.lock on docker startup, please update the startup script or modify the code so that it would delete the lock file on shutdown https://github.com/jookies/jasmin/blob/master/docker/docker-entrypoint.sh#L6

#!/bin/bash
set -e

if [ "$2" = "--enable-interceptor-client" ]; then
  echo 'Starting interceptord'
  rm -rf /tmp/interceptord.lock
  interceptord.py &
fi

echo 'Starting jasmind'
exec "$@"

Here are some more details https://groups.google.com/u/0/g/jasmin-sms-gateway/c/sQirNiWv3M0

kimseasok commented 3 years ago

remove everything in /tmp

docker exec -it jasmin rm -rf /tmp/*

then restart container

github-actions[bot] commented 2 years ago

Stale issue detected, remove stale label or comment or this will be closed soon.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled more than a year with no activity.