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

Not working after reboot #438

Closed
jookk opened this issue Sep 15, 2019 · 17 comments
Closed

Not working after reboot #438

jookk opened this issue Sep 15, 2019 · 17 comments

Comments

@jookk
Copy link

jookk commented Sep 15, 2019

Im using coturn 4.5.1.1 on debian buster with webrtc app.
I have problem with coturn, because after server reboot cant successfully call to other party behind nat.
I must restart coturn and after that calls working fine.
Can you help me?

My turnserver.conf:

tls-listening-port=5349
external-ip=2xx.xxx.xxx.xxx/192.168.x.x
verbose
fingerprint
use-auth-secret
static-auth-secret=3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
realm=xxx.xxxxxxx.xx
total-quota=100
cert=/etc/fullchain.pem
pkey=/etc/key.pem
dh-file=/etc/dhparam.pem
no-stdout-log
log-file=/var/log/turnserver/turn.log
simple-log
no-multicast-peers

@cameronelliott
Copy link

cameronelliott commented Sep 20, 2019

@jookk turnserver.conf will have no impact on whether turnserver gets restarted after boot, you will probably need to learn about systemd (depending on your platform), and figure out whether scripts were installed depending on your method of installation.
I don't know your platform, but you might try this command: '$ ls /lib/systemd/system/*coturn*'
and try reading up on systemd.

@jookk
Copy link
Author

jookk commented Sep 20, 2019 via email

@jookk
Copy link
Author

jookk commented Sep 20, 2019 via email

@misi
Copy link
Contributor

misi commented Oct 24, 2019

For me it seems issue solved, though I couldn't fully understood the issue from this limited info.
If you need further help please comment and let me know and I will reopen it.

@misi misi closed this as completed Oct 24, 2019
@jookk
Copy link
Author

jookk commented Oct 24, 2019 via email

@misi misi reopened this Oct 24, 2019
@misi
Copy link
Contributor

misi commented Oct 24, 2019

What is in the syslog and coturn log?
This info is not enough to help.

@berho
Copy link

berho commented Nov 11, 2019

Same here after upgrading from Debian 9 to 10!

boot.log:

[FAILED] Failed to start coTURN STUN/TURN Server.
See 'systemctl status coturn.service' for details.
# systemctl status coturn.service
● coturn.service - coTURN STUN/TURN Server
   Loaded: loaded (/etc/systemd/system/coturn.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-11-11 09:24:02 CET; 3min 27s ago
     Docs: man:coturn(1)
           man:turnadmin(1)
           man:turnserver(1)
  Process: 815 ExecStart=/usr/bin/turnserver --daemon -c /etc/turnserver.conf --pidfile /run/turnserver/turnserver.pid (code=exited, s

Nov 11 09:24:02 myserver systemd[1]: coturn.service: Service RestartSec=100ms expired, scheduling restart.
Nov 11 09:24:02 myserver systemd[1]: coturn.service: Scheduled restart job, restart counter is at 5.
Nov 11 09:24:02 myserver systemd[1]: Stopped coTURN STUN/TURN Server.
Nov 11 09:24:02 myserver systemd[1]: coturn.service: Start request repeated too quickly.
Nov 11 09:24:02 myserver systemd[1]: coturn.service: Failed with result 'exit-code'.
Nov 11 09:24:02 myserver systemd[1]: Failed to start coTURN STUN/TURN Server.

syslog:

Nov 11 09:24:00 myserver turnserver[688]: Usage: turnserver [options]
Nov 11 09:24:00 myserver turnserver[688]: Options:
Nov 11 09:24:00 myserver turnserver[688]:  -d, --listening-device#011<device-name>#011#011Listener interface device (NOT RECOMMENDED. Optional, Linux only).
Nov 11 09:24:00 myserver turnserver[688]:  -p, --listening-port#011#011<port>#011#011TURN listener port (Default: 3478).
Nov 11 09:24:00 myserver turnserver[688]: #011#011#011#011#011#011Note: actually, TLS & DTLS sessions can connect to the "plain" TCP & UDP port(s), too,
Nov 11 09:24:00 myserver turnserver[688]: #011#011#011#011#011#011if allowed by configuration.
Nov 11 09:24:00 myserver turnserver[688]:  --tls-listening-port#011#011<port>#011#011TURN listener port for TLS & DTLS listeners
Nov 11 09:24:00 myserver turnserver[688]: #011#011#011#011#011#011(Default: 5349).
:
:
Nov 11 09:24:01 myserver turnserver[688]: 0: ERROR:
Nov 11 09:24:01 myserver turnserver[688]: CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
Nov 11 09:24:01 myserver turnserver[688]: 0: WARNING: cannot find certificate file: turn_server_cert.pem (1)
Nov 11 09:24:01 myserver turnserver[688]: 0: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
Nov 11 09:24:01 myserver turnserver[688]: 0: WARNING: cannot find private key file: turn_server_pkey.pem (1)
Nov 11 09:24:01 myserver turnserver[688]: 0: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
Nov 11 09:24:01 myserver turnserver[688]: 0: NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
Nov 11 09:24:01 myserver turnserver[688]: 0: ===========Discovering listener addresses: =========
Nov 11 09:24:01 myserver turnserver[688]: 0: Listener address to use: 127.0.0.1
Nov 11 09:24:01 myserver turnserver[688]: 0: Listener address to use: ::1
Nov 11 09:24:01 myserver turnserver[688]: 0: ERROR: main: Cannot configure any meaningful IP listener address

but when I start the service manually coturn is working:

# systemctl start coturn
# systemctl status coturn
● coturn.service - coTURN STUN/TURN Server
   Loaded: loaded (/etc/systemd/system/coturn.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-11-11 09:53:04 CET; 9s ago
     Docs: man:coturn(1)
           man:turnadmin(1)
           man:turnserver(1)
  Process: 1676 ExecStart=/usr/bin/turnserver --daemon -c /etc/turnserver.conf --pidfile /run/turnserver/turnserver.pid (code=exited,
  Process: 1678 ExecStartPost=/bin/sleep 10 (code=exited, status=0/SUCCESS)
 Main PID: 1677 (turnserver)
    Tasks: 9 (limit: 4518)
   Memory: 5.6M
   CGroup: /system.slice/coturn.service
           └─1677 /usr/bin/turnserver --daemon -c /etc/turnserver.conf --pidfile /run/turnserver/turnserver.pid

Nov 11 09:52:54 myserver systemd[1]: Starting coTURN STUN/TURN Server...
Nov 11 09:53:04 myserver systemd[1]: Started coTURN STUN/TURN Server.

@jookk jookk closed this as completed Dec 9, 2019
@paulmenzel
Copy link
Contributor

If you paste the logs from the working manual start, you could compare.

Judging from the failure log

Nov 11 09:24:01 myserver turnserver[688]: 0: ===========Discovering listener addresses: =========
Nov 11 09:24:01 myserver turnserver[688]: 0: Listener address to use: 127.0.0.1
Nov 11 09:24:01 myserver turnserver[688]: 0: Listener address to use: ::1
Nov 11 09:24:01 myserver turnserver[688]: 0: ERROR: main: Cannot configure any meaningful IP listener address

you hit

if (!turn_params.listener.addrs_number) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_WARNING, "NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED\n");
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "===========Discovering listener addresses: =========\n");
int maddrs = make_local_listeners_list();
if((maddrs<1) || !turn_params.listener.addrs_number) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "%s: Cannot configure any meaningful IP listener address\n", __FUNCTION__);
fprintf(stderr,"\n%s\n", Usage);
exit(-1);
}

As it is working when manually running systemctl start coturn, I guess, that the interface has not been assigned an IP address yet, despite being ordered after network.target. I guess it needs to be ordered after netwerk-online.target.

@berho
Copy link

berho commented Mar 25, 2020

Thank's for your recommendation. I have changed /etc/systemd/system/coturn.service and on next reboot service was running fine :)

@ruedigerkupper
Copy link

See also #558

@Neustradamus
Copy link

@jookk: Why this ticket is closed?

@damnms
Copy link

damnms commented Dec 19, 2020

just hit the same problem

i edited now /etc/systemd/multi-user.target.wants/coturn.service and replaced
After=network.target
with
After=network-online.target

hope that fixes it

@Sooyka
Copy link

Sooyka commented Jun 22, 2021

Nothing worked for me, exept this solution, that I am not very proud of:

ExecStartPre=/bin/sleep 30

added before ExecStart in the [Service] part of /usr/lib/systemd/system/coturn.service

@damnms
Copy link

damnms commented Jun 22, 2021

same here, thought my first solution worked but somehow it did not. maybe was just some "luck" when it was working.

@newmediacrew
Copy link

Running
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.4.0-88-generic
Architecture: x86-64

This problem also occurred at a transip europe vps reboot. After changing the stuff inside the service daemon what @damnms is mentioning the problem was solved.

@skaynetmen
Copy link

Fixed by adding option -L 0.0.0.0

@reos-rcrozier
Copy link

reos-rcrozier commented Jan 16, 2022

I had this issue and, as others, did systemctl edit notify_push.service which creates an override file for the unit, in this file I put the following:

[Unit]
After=network-online.target

Which resolved the issue for me

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

No branches or pull requests