Turn Server is crashing

For some reason turn server keeps crashing, not able to figure out what is the root cause from the logs.

/etc/init.d/coturn status

● coturn.service - LSB: coturn TURN Server
Loaded: loaded (/etc/init.d/coturn; generated; vendor preset: enabled)
Active: active (exited) since Thu 2021-04-01 12:04:04 UTC; 4 days ago

Using the below version :

dpkg -s jitsi-meet-turnserver | grep Version

Version: 1.0.4869-1

Is there any reason you’re aware of might be causing this issue ? usually it will work for few days or weeks then it will just excit as showen above.

This may be a resource problem, especially RAM…

Paste the logs please.

Below you can see the last log file written :

-rw-r–r-- 1 root root 1.6K Apr 6 10:24 turn_474_2021-04-06.log
-rw-r–r-- 1 root root 1.6K Apr 6 10:36 turn_505_2021-04-06.log

0: log file opened: /var/log/turn_505_2021-04-06.log
0: 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.0.5 'dan Eider'
0: 
Max number of open files/sockets allowed for this process: 65000
0: 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 32500 (approximately)
0: 

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 supported
0: TURN/STUN ALPN supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.1.0l  10 Sep 2019 (0x101000cf)
0: 
0: SQLite supported, default database location is /var/lib/turn/turndb
0: Redis supported
0: PostgreSQL supported
0: MySQL supported
0: MongoDB is not supported
0: 
0: Default Net Engine version: 3 (UDP thread per CPU core)

=====================================================

0: Bad configuration format: keep-address-family
0: Black listing: 0.0.0.0-0.255.255.255
0: Black listing: 10.0.0.0-10.255.255.255
0: Black listing: 100.64.0.0-100.127.255.255
0: Black listing: 127.0.0.0-127.255.255.255
0: Black listing: 169.254.0.0-169.254.255.255
0: Black listing: 127.0.0.0-127.255.255.255
0: Black listing: 172.16.0.0-172.31.255.255
0: Black listing: 192.0.0.0-192.0.0.255
0: Black listing: 192.0.2.0-192.0.2.255
0: Black listing: 192.88.99.0-192.88.99.255
0: Black listing: 192.168.0.0-192.168.255.255
0: Black listing: 198.18.0.0-198.19.255.255
0: Black listing: 198.51.100.0-198.51.100.255
0: Black listing: 203.0.113.0-203.0.113.255
0: Black listing: 240.0.0.0-255.255.255.255

Is there a way to enable debug mode ? I can’t see any errors in the log file

You may need to check the coturn documentation. Also check syslog and sysctl -xe right after you start it, to see why it may have failed.

Apparently there’s the Verbose option, but I’ve never tried it.

On top of that, I believe you can also redirect logs that typically go to syslog to a specific log file. This gives you a lot more details than the logs you typically see in /var/log/turnserver/turn_<pid>_<date>.log files.

E.g.

simple-log
log-file=/var/log/turnserver/turnserver.log

This is what I am getting in the logs when it crashes :

Apr 9 08:42:40 TURNServer kernel: [252318.145277] turnserver[10065]: segfault at 7ff0d0000078 ip 00007ff0d0000078 sp 00007ff0d5999958 error 15

Right, a segmentation fault. That’s a bug in coturn itself, please report it to their bugtracker.