Headscale 0.24.0.ynh1 does not start

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.11 stable
What app is this about: Headscale

Describe your issue

Head scale fails to start since latest update 0.24.0.ynh1

Share relevant logs or error messages

2025-01-13T22:55:14Z FTL …/…/…/home/runner/work/headscale/headscale/cmd/headscale/cli/serve.go:24 > Error initializing error=“creating OIDC provider from issuer config: Get "https://dexserver.xxxxx/.well-known/openid-configuration\”: dial tcp [::1]:443: connect: connection refused"
2025-01-13T22:59:55Z WRN
WARN: The “dns.use_username_in_magic_dns” configuration key is deprecated and has been removed. Please see the changelog for more details.

2025-01-13T22:59:58Z WRN Listening without TLS but ServerURL does not start with http://
2025-01-19T11:22:33Z ERR …/…/…/home/runner/work/headscale/headscale/hscontrol/noise.go:199 > Cannot parse MapRequest error=“unexpected end of JSON input”
2025-01-22T07:14:31Z FTL
FATAL: The “dns.use_username_in_magic_dns” configuration key has been removed. Please see the changelog for more details.

2025-01-22T07:38:13Z FTL
FATAL: The “dns.use_username_in_magic_dns” configuration key has been removed. Please see the changelog for more details.

2025-01-22T07:38:23Z FTL
FATAL: The “dns.use_username_in_magic_dns” configuration key has been removed. Please see the changelog for more details.

2025-01-22T07:39:49Z FTL
FATAL: The “dns.use_username_in_magic_dns” configuration key has been removed. Please see the changelog for more details.

2025-01-22T07:42:24Z FTL
FATAL: The “dns.use_username_in_magic_dns” configuration key has been removed. Please see the changelog for more details.

Hi, to solve this problem you can run the following commands :
As root : yunohost app shell headscale
when you are in the shell (headscale@domain.tld), run
nano config.yaml
then find inside the file the use_username param under the magicDNS section and comment it. Even if you set it as false it doesn’t work. You have to comment the line. Save the file (ctrl+o with nano then ctrl+x to leave the editor)
Then restart headscale after leaving the shell :
logout
systemctl restart headscale (as root user)

Hope it works for you

1 Like

Thank you. This fixed the deprecated warning, but head scale still refuses to start (it was working before the upgrade)

Here are the error logs after I commented the magic dns parameters in the shell and rebooted the yunohost server

-- Boot 489b55da260b4161a41eb8b067dbee1c --
janv. 22 21:24:00 systemd[1]: Starting headscale.service - Control server for the WireGuard-based VPN...
janv. 22 21:24:01 systemd[1]: Started headscale.service - Control server for the WireGuard-based VPN.
janv. 22 21:24:02 systemd[1]: headscale.service: Main process exited, code=exited, status=1/FAILURE
janv. 22 21:24:02 systemd[1]: headscale.service: Failed with result 'exit-code'.

and

2025-01-22T21:21:11Z WRN Listening without TLS but ServerURL does not start with http://
2025-01-22T21:21:11Z FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/serve.go:29 > Headscale ran into an error and had to shut down. error="failed to bind to TCP address: listen tcp 127.0.0.1:9090: bind: address already in use"
2025-01-22T21:22:32Z WRN Listening without TLS but ServerURL does not start with http://
2025-01-22T21:22:32Z FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/serve.go:29 > Headscale ran into an error and had to shut down. error="failed to bind to TCP address: listen tcp 127.0.0.1:9090: bind: address already in use"
2025-01-22T21:24:02Z FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/serve.go:24 > Error initializing error="creating OIDC provider from issuer config: Get \"https://dexserver.xxxxxx/.well-known/openid-configuration\": dial tcp [::1]:443: connect: connection refused"

Thanks for help

Hello,
it seems that the 9090 port is already used by an other service, my headscale instance uses these ports (in config.yaml) :
listen_addr: 127.0.0.1:8081
metrics_listen_addr: 127.0.0.1:9091
grpc_listen_addr: 127.0.0.1:50443
Try to change the port 9090 by an other one.
For the openid error, I don’t have any idea currently, maybe solving the port problem while solve the dex connection problem. Don’t forget to restart the service headscale after modifying config.yaml
Hope it works

Many thanks, it now works! The port thing fixed the dex problem. No idea why upgrading from head scale 0.23 to 0.24 changed the port, but well it works…
Almost perfectly, in the sense that if I reboot my server, head scale will fail to start. However if I wait enough and start head scale it will work. Would you know how to fix that? Maybe make sure that head scale starts last ?

Thanks in any case, big relief

Hello,
Does it failed to start, or does it not start at all (like it is not enabled). If it fails to start can you provide the error logs?
Thanks

It automatically starts but then fails.

Here is what’s in journalctl


janv. 24 08:32:04 systemd[1]: Starting headscale.service - Control server for the WireGuard-based VPN...
janv. 24 08:32:05 systemd[1]: Started headscale.service - Control server for the WireGuard-based VPN.
janv. 24 08:32:06 systemd[1]: headscale.service: Main process exited, code=exited, status=1/FAILURE
janv. 24 08:32:06 systemd[1]: headscale.service: Failed with result 'exit-code'.

And here is what’s in headscale log

2025-01-24T08:32:06Z FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/serve.go:24 > Error initializing error="creating OIDC provider from issuer config: Get \"https://dexserver.exxxxwt/.well-known/openid-configuration\": dial tcp [::1]:443: connect: connection refused"

So maybe headscale tries to connect to the dex server before it’s ready ?
If I start manually headscale after the whole start process is over it works.

Hello,
Maybe you should try to edit headscale.service:
under root:
cd /etc/systemd/system
nano headscale.service
Under the [Unit] section on the line After= add
dex.service.
The line should be like
After=network.target nginx.service dex.service

It’s just a workaround because at the next update the config file might be overwritted.
At the moment I don’t know why headscale is trying to start before headscale on your server.
Hope it works
ps: headscale.service is maybe write only, you should have to modify the properties of the file before modifying it and the reverse to the old properties.

1 Like

That did the trick!

I’m very thankful for your time and guidance

Great, have a good day!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.