Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.5.2 starting up got stuck #683

Closed
tengg opened this issue Jan 12, 2021 · 6 comments
Closed

4.5.2 starting up got stuck #683

tengg opened this issue Jan 12, 2021 · 6 comments
Labels

Comments

@tengg
Copy link

tengg commented Jan 12, 2021

Build on a new Ubuntu machine, all dependencies were installed via apt.
When starting up, each log line was printed twice, and got stuck somewhere reading redis socket:

# bin/turnserver -v -c ~/t.conf
0: : White listing: 0.0.0.0-255.255.255.255
0: : White listing: 0.0.0.0-255.255.255.255
0: :
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: :
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: :
Max number of open files/sockets allowed for this process: 1048576
0: :
Max number of open files/sockets allowed for this process: 1048576
0: :
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: :
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: :

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

0: :

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

0: : TLS supported
0: : TLS supported
0: : DTLS supported
0: : DTLS supported
0: : DTLS 1.2 supported
0: : DTLS 1.2 supported
0: : TURN/STUN ALPN supported
0: : TURN/STUN ALPN supported
0: : Third-party authorization (oAuth) supported
0: : Third-party authorization (oAuth) supported
0: : GCM (AEAD) supported
0: : GCM (AEAD) supported
0: : OpenSSL compile-time version: OpenSSL 1.0.2n  7 Dec 2017 (0x100020ef)
0: : OpenSSL compile-time version: OpenSSL 1.0.2n  7 Dec 2017 (0x100020ef)
0: :
0: :
0: : SQLite is not supported
0: : SQLite is not supported
0: : Redis supported
0: : Redis supported
0: : PostgreSQL is not supported
0: : PostgreSQL is not supported
0: : MySQL is not supported
0: : MySQL is not supported
0: : MongoDB is not supported
0: : MongoDB is not supported
0: :
0: :
0: : Default Net Engine version: 3 (UDP thread per CPU core)

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

0: : Default Net Engine version: 3 (UDP thread per CPU core)

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

0: : Domain name:
0: : Domain name:
0: : Default realm: test
0: : Default realm: test
0: :
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methods.
Shared secret overrides username/password based auth method. Check your configuration!
0: :
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methods.
Shared secret overrides username/password based auth method. Check your configuration!
0: : WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: : WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: : WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: : WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: : WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: : WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: : WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: : WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering listener addresses: =========
0: : ===========Discovering listener addresses: =========
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 172.31.3.187
0: : Listener address to use: 172.31.3.187
0: : Listener address to use: ::1
0: : Listener address to use: ::1
0: : =====================================================
0: : =====================================================
0: : Total: 1 'real' addresses discovered
0: : Total: 1 'real' addresses discovered
0: : =====================================================
0: : =====================================================
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering relay addresses: =============
0: : ===========Discovering relay addresses: =============
0: : Relay address to use: 172.31.3.187
0: : Relay address to use: 172.31.3.187
0: : Relay address to use: ::1
0: : Relay address to use: ::1
0: : =====================================================
0: : =====================================================
0: : Total: 2 relay addresses discovered
0: : Total: 2 relay addresses discovered
0: : =====================================================
0: : =====================================================
Cannot create pid file: /var/shared/log/turnserver.pid: No such file or directory
0: : Cannot create pid file: /var/shared/log/turnserver.pid
0: : Cannot create pid file: /var/shared/log/turnserver.pid
0: : pid file created: /var/tmp/turnserver.pid
0: : pid file created: /var/tmp/turnserver.pid
0: : IO method (main listener thread): epoll (with changelist)
0: : IO method (main listener thread): epoll (with changelist)
0: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
0: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
@tengg
Copy link
Author

tengg commented Jan 12, 2021

It's stuck here looks like some deadlock. No error reported.
Config file:

listening-port=3478
fingerprint
lt-cred-mech
static-auth-secret=lol
redis-userdb=ip=127.0.0.1 port=6379 dbname=1 connect_timeout=5
redis-statsdb=ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
realm=test
log-file=stdout
no-multicast-peers
max-allocate-timeout=60
pidfile=/tmp/turnserver.pid
cli-password=haha
no-tls
no-tcp

@tengg
Copy link
Author

tengg commented Jan 12, 2021

strace showed stuck at:

write(1, "0: : IO method (main listener th"..., 630: : IO method (main listener thread): epoll (with changelist)
) = 63
write(1, "0: : IO method (main listener th"..., 630: : IO method (main listener thread): epoll (with changelist)
) = 63
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 7
fcntl(7, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(7, {sa_family=AF_INET, sin_port=htons(6379), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
write(1, "0: : Redis DB async connection t"..., 930: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
) = 93
write(1, "0: : Redis DB async connection t"..., 930: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
) = 93
getpid()                                = 28959
getpid()                                = 28959
openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 8
fstat(8, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
poll([{fd=8, events=POLLIN}], 1, 10)    = 1 ([{fd=8, revents=POLLIN}])
read(8, "8.\246\334\2357\247\276\25\365ux\26\361\215\22\273\225Pa*\332\356\7\10i9\202 z\22L", 32) = 32
close(8)                                = 0
futex(0x55a4dddc3f90, FUTEX_WAIT_PRIVATE, 2, NULL^C) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)

@misi
Copy link
Contributor

misi commented Jan 12, 2021

  • Don't use log-file=stdout, it logs by default to stdout.. So it is duplicate
  • Don't use lt-cred-mech
    see in your log:
    CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
    Be aware that you could not mix the username/password and the shared secret based auth methods.
    Shared secret overrides username/password based auth method. Check your configuration!
    

I checked on debian unstable with your config and it seems it works for me.

root@test# cat /tmp/2; ./bin/turnserver -v -c /tmp/2 
listening-port=3478
fingerprint
lt-cred-mech
static-auth-secret=lol
redis-userdb=ip=127.0.0.1 port=6379 dbname=1 connect_timeout=5
redis-statsdb=ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
realm=test
log-file=stdout
no-multicast-peers
max-allocate-timeout=60
pidfile=/tmp/turnserver.pid
cli-password=haha
no-tls
no-tcp
0: : 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: : 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: : 
Max number of open files/sockets allowed for this process: 1048576
0: : 
Max number of open files/sockets allowed for this process: 1048576
0: : 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: : 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: : 

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

0: : 

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

0: : TLS supported
0: : TLS supported
0: : DTLS supported
0: : DTLS supported
0: : DTLS 1.2 supported
0: : DTLS 1.2 supported
0: : TURN/STUN ALPN supported
0: : TURN/STUN ALPN supported
0: : Third-party authorization (oAuth) supported
0: : Third-party authorization (oAuth) supported
0: : GCM (AEAD) supported
0: : GCM (AEAD) supported
0: : OpenSSL compile-time version: OpenSSL 1.1.1i  8 Dec 2020 (0x1010109f)
0: : OpenSSL compile-time version: OpenSSL 1.1.1i  8 Dec 2020 (0x1010109f)
0: : 
0: : 
0: : SQLite supported, default database location is /var/lib/turn/turndb
0: : SQLite supported, default database location is /var/lib/turn/turndb
0: : Redis supported
0: : Redis supported
0: : PostgreSQL supported
0: : PostgreSQL supported
0: : MySQL supported
0: : MySQL supported
0: : MongoDB is not supported
0: : MongoDB is not supported
0: : 
0: : 
0: : Default Net Engine version: 3 (UDP thread per CPU core)

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

0: : Default Net Engine version: 3 (UDP thread per CPU core)

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

0: : Domain name: 
0: : Domain name: 
0: : Default realm: test
0: : Default realm: test
0: : 
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methods. 
Shared secret overrides username/password based auth method. Check your configuration!
0: : 
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methods. 
Shared secret overrides username/password based auth method. Check your configuration!
0: : WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: : WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: : WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: : WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: : WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: : WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: : WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: : WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering listener addresses: =========
0: : ===========Discovering listener addresses: =========
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 10.0.3.148
0: : Listener address to use: 10.0.3.148
0: : Listener address to use: ::1
0: : Listener address to use: ::1
0: : =====================================================
0: : =====================================================
0: : Total: 1 'real' addresses discovered
0: : Total: 1 'real' addresses discovered
0: : =====================================================
0: : =====================================================
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering relay addresses: =============
0: : ===========Discovering relay addresses: =============
0: : Relay address to use: 10.0.3.148
0: : Relay address to use: 10.0.3.148
0: : Relay address to use: ::1
0: : Relay address to use: ::1
0: : =====================================================
0: : =====================================================
0: : Total: 2 relay addresses discovered
0: : Total: 2 relay addresses discovered
0: : =====================================================
0: : =====================================================
0: : pid file created: /tmp/turnserver.pid
0: : pid file created: /tmp/turnserver.pid
0: : IO method (main listener thread): epoll (with changelist)
0: : IO method (main listener thread): epoll (with changelist)
0: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
0: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
0: : Wait for relay ports initialization...
0: : Wait for relay ports initialization...
0: :   relay 10.0.3.148 initialization...
0: :   relay 10.0.3.148 initialization...
0: :   relay 10.0.3.148 initialization done
0: :   relay 10.0.3.148 initialization done
0: :   relay ::1 initialization...
0: :   relay ::1 initialization...
0: :   relay ::1 initialization done
0: :   relay ::1 initialization done
0: : Relay ports initialization done
0: : Relay ports initialization done
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : turn server id=1 created
0: : turn server id=1 created
0: : turn server id=0 created
0: : turn server id=0 created
0: : turn server id=2 created
0: : turn server id=2 created
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : turn server id=4 created
0: : turn server id=4 created
0: : turn server id=3 created
0: : turn server id=3 created
0: : turn server id=5 created
0: : turn server id=5 created
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : turn server id=7 created
0: : turn server id=6 created
0: : turn server id=7 created
0: : turn server id=6 created
0: : turn server id=8 created
0: : turn server id=8 created
0: : turn server id=9 created
0: : turn server id=9 created
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : turn server id=10 created
0: : turn server id=10 created
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : turn server id=13 created
0: : turn server id=13 created
0: : IO method (general relay thread): epoll (with changelist)
0: : IO method (general relay thread): epoll (with changelist)
0: : turn server id=11 created
0: : turn server id=11 created
0: : turn server id=14 created
0: : turn server id=14 created
0: : turn server id=12 created
0: : turn server id=12 created
0: : turn server id=15 created
0: : turn server id=15 created
0: : IPv4. UDP listener opened on: 127.0.0.1:3478
0: : IPv4. UDP listener opened on: 127.0.0.1:3478
0: : IPv4. UDP listener opened on: 127.0.0.1:3479
0: : IPv4. UDP listener opened on: 127.0.0.1:3479
0: : IPv4. UDP listener opened on: 10.0.3.148:3478
0: : IPv4. UDP listener opened on: 10.0.3.148:3478
0: : IPv4. UDP listener opened on: 10.0.3.148:3479
0: : IPv4. UDP listener opened on: 10.0.3.148:3479
0: : IPv6. UDP listener opened on: ::1:3478
0: : IPv6. UDP listener opened on: ::1:3478
0: : IPv6. UDP listener opened on: ::1:3479
0: : IPv6. UDP listener opened on: ::1:3479
0: : Total General servers: 16
0: : Total General servers: 16
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (admin thread): epoll (with changelist)
0: : IO method (admin thread): epoll (with changelist)
0: : IPv4. CLI listener opened on : 127.0.0.1:5766
0: : IPv4. CLI listener opened on : 127.0.0.1:5766

@misi misi added the question label Jan 12, 2021
@tengg
Copy link
Author

tengg commented Jan 13, 2021

Config simplified to:

listening-port=3478
fingerprint
static-auth-secret=lol
redis-userdb=ip=127.0.0.1 port=6379 dbname=1 connect_timeout=5
redis-statsdb=ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
realm=test
no-tls
no-tcp

The output is corrected now.. but it's still stuck:

$ bin/turnserver -v -c ~/t.conf
0: :
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: : log file opened: /var/tmp/turn_30622_2021-01-13.log
0: :
Max number of open files/sockets allowed for this process: 1048576
0: :
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (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.0.2n  7 Dec 2017 (0x100020ef)
0: :
0: : SQLite is not supported
0: : Redis supported
0: : PostgreSQL is not supported
0: : MySQL is not supported
0: : MongoDB is not supported
0: :
0: : Default Net Engine version: 3 (UDP thread per CPU core)

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

0: : Domain name:
0: : Default realm: test
0: : ERROR:
CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
0: : WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: : WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: : WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: : WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering listener addresses: =========
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 172.31.3.187
0: : Listener address to use: ::1
0: : =====================================================
0: : Total: 1 'real' addresses discovered
0: : =====================================================
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering relay addresses: =============
0: : Relay address to use: 172.31.3.187
0: : Relay address to use: ::1
0: : =====================================================
0: : Total: 2 relay addresses discovered
0: : =====================================================
Cannot create pid file: /var/run/turnserver.pid: Permission denied
0: : Cannot create pid file: /var/run/turnserver.pid
0: : pid file created: /var/tmp/turnserver.pid
0: : IO method (main listener thread): epoll (with changelist)
0: : Redis DB async connection to be used: ip=127.0.0.1 port=6379 dbname=2 connect_timeout=5
^C

Redis server works fine with redis-cli..

@tengg
Copy link
Author

tengg commented Jan 13, 2021

Ok I think I found the problem.
Removed libssl-1.0-dev and installed llibssl-dev (1.1.1), it works good!

I'll check why..

@misi
Copy link
Contributor

misi commented Jan 13, 2021

See PR #684

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants