[Bug] <title>Error loading config - yaml line12 - not able to find key #991

Closed
opened 2025-12-29 02:27:08 +01:00 by adam · 3 comments
Owner

Originally created by @PaPaTheGMan on GitHub (Apr 5, 2025).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Attemped to setup a fresh install of Headascale. Followed the steps on "https://headscale.net/stable/setup/install/official/". After updating 'config.yaml', start of service and received the following error:
Process: 20956 ExecStart=/usr/bin/headscale serve (code=exited, status=1/FAILURE)
Main PID: 20956 (code=exited, status=1/FAILURE)
CPU: 125ms

headscale[20968]: 2025-04-05T13:29:52-04:00 FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/root.go:49 > Error loading config error="fatal error reading config file: While parsing config: yaml: line 12: did not find expected key"

Expected Behavior

Install should run smoothly

Steps To Reproduce

Ubuntu noble 24.04 x86_64

config.yaml:
server_url: http://mydomain.com:8080

listen_addr: 0.0.0.0:8080
metrics_listen_addr: 127.0.0.1:9090
grpc_listen_addr: 127.0.0.1:50443
grpc_allow_insecure: false
noise:
private_key_path: /var/lib/headscale/noise_private.key
prefixes:
v4: 100.64.0.0/10
v6: fd7a:115c:a1e0::/48

allocation: sequential

derp:
server:
enabled: false
region_id: 999
region_code: "headscale"
region_name: "Headscale Embedded DERP"
stun_listen_addr: "0.0.0.0:3478"
private_key_path: /var/lib/headscale/derp_server_private.key
automatically_add_embedded_derp_region: true
ipv4: 1.2.3.4
ipv6: 2001:db8::1
urls:
- https://controlplane.tailscale.com/derpmap/default
paths: []
auto_update_enabled: true
update_frequency: 24h

disable_check_updates: false
ephemeral_node_inactivity_timeout: 30m

database:
type: sqlite
debug: false
gorm:

Environment

- OS: Ubuntu 24.04
- Headscale version: 0.25.1
- Tailscale version: N/A

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Debug information

Should be a simple install. It appears something is missing in either the procedure or install script.

Originally created by @PaPaTheGMan on GitHub (Apr 5, 2025). ### Is this a support request? - [x] This is not a support request ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current Behavior Attemped to setup a fresh install of Headascale. Followed the steps on "https://headscale.net/stable/setup/install/official/". After updating 'config.yaml', start of service and received the following error: Process: 20956 ExecStart=/usr/bin/headscale serve (code=exited, status=1/FAILURE) Main PID: 20956 (code=exited, status=1/FAILURE) CPU: 125ms headscale[20968]: 2025-04-05T13:29:52-04:00 FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/root.go:49 > Error loading config error="fatal error reading config file: While parsing config: yaml: line 12: did not find expected key" ### Expected Behavior Install should run smoothly ### Steps To Reproduce Ubuntu noble 24.04 x86_64 **config.yaml:** server_url: http://mydomain.com:8080 listen_addr: 0.0.0.0:8080 metrics_listen_addr: 127.0.0.1:9090 grpc_listen_addr: 127.0.0.1:50443 grpc_allow_insecure: false noise: private_key_path: /var/lib/headscale/noise_private.key prefixes: v4: 100.64.0.0/10 v6: fd7a:115c:a1e0::/48 allocation: sequential derp: server: enabled: false region_id: 999 region_code: "headscale" region_name: "Headscale Embedded DERP" stun_listen_addr: "0.0.0.0:3478" private_key_path: /var/lib/headscale/derp_server_private.key automatically_add_embedded_derp_region: true ipv4: 1.2.3.4 ipv6: 2001:db8::1 urls: - https://controlplane.tailscale.com/derpmap/default paths: [] auto_update_enabled: true update_frequency: 24h disable_check_updates: false ephemeral_node_inactivity_timeout: 30m database: type: sqlite debug: false gorm: ### Environment ```markdown - OS: Ubuntu 24.04 - Headscale version: 0.25.1 - Tailscale version: N/A ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Debug information Should be a simple install. It appears something is missing in either the procedure or install script.
adam added the bug label 2025-12-29 02:27:08 +01:00
adam closed this issue 2025-12-29 02:27:08 +01:00
Author
Owner

@nblock commented on GitHub (Apr 5, 2025):

Spacing and indentation is important in a yaml configuration file. Please ensure to preserve the indentation and probably check the configuration file with yamllint or an online yaml validator. The configuration you posted is invalid because all indentation is lost.

@nblock commented on GitHub (Apr 5, 2025): Spacing and indentation is important in a yaml configuration file. Please ensure to preserve the indentation and probably check the configuration file with `yamllint` or an online yaml validator. The configuration you posted is invalid because all indentation is lost.
Author
Owner

@PaPaTheGMan commented on GitHub (Apr 5, 2025):

Thanks, that's a good point. yamllint didn't find anything, but jasonformatter did. A bad indent on the listen_addr line was the culprit. Sorry to have bothered everyone.

@PaPaTheGMan commented on GitHub (Apr 5, 2025): Thanks, that's a good point. yamllint didn't find anything, but jasonformatter did. A bad indent on the listen_addr line was the culprit. Sorry to have bothered everyone.
Author
Owner

@nblock commented on GitHub (Apr 6, 2025):

Glad you figured it out, thx for reporting back.

@nblock commented on GitHub (Apr 6, 2025): Glad you figured it out, thx for reporting back.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#991