[Bug] Headscale crashes when derp.update_interval is not set #915

Closed
opened 2025-12-29 02:25:54 +01:00 by adam · 2 comments
Owner

Originally created by @foosinn on GitHub (Jan 21, 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

Headscale seems to crash when derp.urls is set but not update_frequency.

It seems to load a 0 as the default for update interval, which seems to lead to a panic.

With headscale 0.23.0 this worked fine.

panic: non-positive interval for NewTicker
/home/runner/work/headscale/headscale/hscontrol/app.go:616 +0xa65
created by github.com/juanfont/headscale/hscontrol.(*Headscale).Serve in goroutine 1
/home/runner/work/headscale/headscale/hscontrol/app.go:248 +0xd4
github.com/juanfont/headscale/hscontrol.(*Headscale).scheduledTasks(0xc00065f4a0, {0x2548310, 0xc0003fe370})
/nix/store/jfv85qbj4vb1dafcg6kncg4vrbq2bbxv-go-1.23.4/share/go/src/time/tick.go:38 +0xbb
time.NewTicker(0x12a05f200?)

Expected Behavior

Run with default update_frequency

Steps To Reproduce

Run headscale with this config:

    server_url: https://*****
    listen_addr: 0.0.0.0:8080
    metrics_listen_addr: 0.0.0.0:9090

    noise:
      private_key_path: /var/lib/headscale/noise_private.key

    prefixes:
      allocation: random

      v4: 100.64.0.0/10
      v6: fd7a:115c:a1e0:f00::/64

    database:
      type: sqlite
      sqlite:
        path: /var/lib/headscale/db.sqlite

    derp:
      urls:
        - https://controlplane.tailscale.com/derpmap/default

    dns:
      base_domain: int.vpn

Environment

Official 0.24.0 Container

Runtime environment

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

Anything else?

No response

Originally created by @foosinn on GitHub (Jan 21, 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 Headscale seems to crash when `derp.urls` is set but not `update_frequency`. It seems to load a `0` as the default for update interval, which seems to lead to a panic. With headscale 0.23.0 this worked fine. ``` panic: non-positive interval for NewTicker /home/runner/work/headscale/headscale/hscontrol/app.go:616 +0xa65 created by github.com/juanfont/headscale/hscontrol.(*Headscale).Serve in goroutine 1 /home/runner/work/headscale/headscale/hscontrol/app.go:248 +0xd4 github.com/juanfont/headscale/hscontrol.(*Headscale).scheduledTasks(0xc00065f4a0, {0x2548310, 0xc0003fe370}) /nix/store/jfv85qbj4vb1dafcg6kncg4vrbq2bbxv-go-1.23.4/share/go/src/time/tick.go:38 +0xbb time.NewTicker(0x12a05f200?) ``` ### Expected Behavior Run with default `update_frequency` ### Steps To Reproduce Run headscale with this config: ``` server_url: https://***** listen_addr: 0.0.0.0:8080 metrics_listen_addr: 0.0.0.0:9090 noise: private_key_path: /var/lib/headscale/noise_private.key prefixes: allocation: random v4: 100.64.0.0/10 v6: fd7a:115c:a1e0:f00::/64 database: type: sqlite sqlite: path: /var/lib/headscale/db.sqlite derp: urls: - https://controlplane.tailscale.com/derpmap/default dns: base_domain: int.vpn ``` ### Environment ```markdown Official 0.24.0 Container ``` ### Runtime environment - [x] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Anything else? _No response_
adam added the bug label 2025-12-29 02:25:54 +01:00
adam closed this issue 2025-12-29 02:25:54 +01:00
Author
Owner

@kradalby commented on GitHub (Jan 23, 2025):

Duplicate of https://github.com/juanfont/headscale/issues/2359, fixed in https://github.com/juanfont/headscale/pull/2368

@kradalby commented on GitHub (Jan 23, 2025): Duplicate of https://github.com/juanfont/headscale/issues/2359, fixed in https://github.com/juanfont/headscale/pull/2368
Author
Owner

@foosinn commented on GitHub (Jan 23, 2025):

Thanks so much 👍

@foosinn commented on GitHub (Jan 23, 2025): Thanks so much 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#915