Repository navigation
Description
After a node restart, if name resolution (DNS) is not yet available, the Janus service of NethVoice fails to start and never starts again by itself, even when the network is back. Calls from the browser in NethVoice CTI and from NethLink do not work until someone starts the service by hand.
Steps to reproduce
- Make the name of the STUN server (by default
stun1.l.google.com) impossible to resolve from the node, for example by blocking DNS requests - Restart the node, or restart Janus with
systemctl --user restart janusfrom the NethVoice module shell - Wait a few minutes, then make DNS work again
- Check the service with
systemctl --user status janus
Expected behavior
Janus keeps trying to start and comes up by itself as soon as DNS works again.
Actual behavior
Janus stops at startup because it cannot resolve the STUN server name. The system restarts it right away and, after five failed starts within 10 seconds, it gives up. Each start takes about two seconds, so on a slow machine the limit may not be reached and the problem does not show up. The service stays down until it is started by hand.
[ERR] [ice.c:janus_ice_set_stun_server:1225] Could not resolve stun1.l.google.com...
[FATAL] [janus.c:main:5323] Invalid STUN address stun1.l.google.com:19302
janus.service: Scheduled restart job, restart counter is at 5.
janus.service: Start request repeated too quickly.
janus.service: Failed with result 'exit-code'.
Failed to start janus server.
While Janus is down, requests to the /janus web address answer with error 502 and WebRTC phones (NethVoice CTI, NethLink) cannot register or make calls. On the system where this was seen, after a power loss, the service stayed down for almost 22 hours.
Workaround
From the NethVoice module shell (runagent -m nethvoiceX), run systemctl --user reset-failed janus && systemctl --user start janus, then check that systemctl --user is-active janus answers active.
Components
NethVoice 1.8.6
See also
Activity
fix(janus): keep retrying when startup fails (#1347)
edospadoni commentedon Nov 30, 2026
Test
PRs: nethesis/ns8-nethvoice#1347
Setup: a NethVoice test instance updated to the testing release. Commands run in the module shell (
runagent -m nethvoiceX bash). To simulate the missing name resolution without touching the network, Janus is given a STUN server name that cannot be resolved (stun.invalid): it fails at startup with the same error.Test Case 1 - New restart settings
systemctl --user show janus -p RestartUSec -p StartLimitIntervalUSecprintsRestartUSec=10sandStartLimitIntervalUSec=0systemctl --user is-active janusprintsactiveTest Case 2 - Janus recovers by itself
systemctl --user status janusshowsactivating (auto-restart)or a start in progress, neverfailedCould not resolve stun.invalidabout every 12 seconds and noStart request repeated too quicklylinerm ~/.config/state/janus-test.env: within about 15 secondssystemctl --user is-active janusprintsactive, with no manual startrm -r ~/.config/systemd/user/janus.service.d && systemctl --user daemon-reloadTesting release: 1.8.8-testing.8 (nethesis/ns8-nethvoice#1347)