juanfont / headscale

An open source, self-hosted implementation of the Tailscale control server
BSD 3-Clause "New" or "Revised" License
23.51k stars 1.29k forks source link

[Bug] Fatal Error: Did not find expected key #2084

Closed xopherKPMG closed 2 months ago

xopherKPMG commented 2 months ago

Is this a support request?

Is there an existing issue for this?

Current Behavior

I attempted to update my Headscale configuration with a newer version. When I attempted to start headscale I received the error:

● headscale.service - headscale coordination server for Tailscale
     Loaded: loaded (/usr/lib/systemd/system/headscale.service; enabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2024-08-29 13:42:45 UTC; 76ms ago
    Process: 2624 ExecStart=/usr/bin/headscale serve (code=exited, status=1/FAILURE)
   Main PID: 2624 (code=exited, status=1/FAILURE)
        CPU: 43ms
2024-08-29T13:43:20Z WRN Failed to read configuration from disk error="While parsing config: yaml: line 12: did not find expected key"
2024-08-29T13:43:20Z FTL ../runner/work/headscale/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: While parsing config: yaml: line 12: did not find expected key"

I tried to do a fresh install on a different machine. I am seeing the exact same error. This makes no sense to me as I had everything working earlier today.

Expected Behavior

Headscale should start up normally.

Steps To Reproduce

  1. Perform a fresh install of headscale - download latest release from here: https://github.com/juanfont/headscale/releases/download/v0.22.3/headscale_0.22.3_linux_amd64.deb
  2. follow the instructions for configuring and enabling headscale
  3. sudo systemctl start headscale

Environment

- OS:Ubuntu 24.04 LTS 
- Headscale version: v0.22.3

Runtime environment

Anything else?

No response

kradalby commented 2 months ago

can you please post the failing yaml? I suspect you have a tab character in it or something, 0.22.3 has been out for a while, so this is likely a user error and you should ask in Discord.

xopherKPMG commented 2 months ago

After some debugging it does appear that there was a tab character out of place. After formatting the config file it works as normal