[Bug] 0.24.0 immediately panics on time.NewTicker() with derp disabled #919

Closed
opened 2025-12-29 02:25:59 +01:00 by adam · 1 comment
Owner

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

0.23.0:

2025-01-22T20:28:08Z INF Opening database database=sqlite3 path=/var/lib/headscale/db.sqlite
2025-01-22T20:28:09Z INF listening and serving HTTP on: 0.0.0.0:8080
2025-01-22T20:28:09Z INF listening and serving debug and metrics on: 0.0.0.0:9090
2025-01-22T20:28:09Z INF home/runner/work/headscale/headscale/hscontrol/poll.go:705 > node has connected, [...]

0.24.0:

2025-01-22T20:25:43Z INF Opening database database=sqlite3 path=/var/lib/headscale/db.sqlite
panic: non-positive interval for NewTicker

goroutine 54 [running]:
time.NewTicker(0x12a05f200?)
	/nix/store/jfv85qbj4vb1dafcg6kncg4vrbq2bbxv-go-1.23.4/share/go/src/time/tick.go:38 +0xbb
github.com/juanfont/headscale/hscontrol.(*Headscale).scheduledTasks(0xc000473900, {0x2548310, 0xc00028c2d0})
	/home/runner/work/headscale/headscale/hscontrol/app.go:248 +0xd4
created by github.com/juanfont/headscale/hscontrol.(*Headscale).Serve in goroutine 1
	/home/runner/work/headscale/headscale/hscontrol/app.go:616 +0xa65

Expected Behavior

???

Steps To Reproduce

  1. Upgrade docker image from ghcr.io/juanfont/headscale:0.23.0 to ghcr.io/juanfont/headscale:0.24.0
  2. Have a derp config like this:
derp:
  server:
    enabled: false
    ipv4: ${local.ip-ext-v4}
    ipv6: ${local.ip-ext-v6}
  urls:
  - https://controlplane.tailscale.com/derpmap/default

Environment

- OS: Debian 12.9 (Docker 20.10)
- Headscale version: 0.24.0
- Tailscale version: n/a

Runtime environment

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

Anything else?

The stacktrace shows that it's this line:

	derpTicker := time.NewTicker(h.cfg.DERP.UpdateFrequency)
	defer derpTicker.Stop()

In my case I have derp.server.enabled: false (see config snippet above) so it probably shouldn't be starting that ticker to begin with?

Originally created by @nickbp on GitHub (Jan 22, 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 0.23.0: ``` 2025-01-22T20:28:08Z INF Opening database database=sqlite3 path=/var/lib/headscale/db.sqlite 2025-01-22T20:28:09Z INF listening and serving HTTP on: 0.0.0.0:8080 2025-01-22T20:28:09Z INF listening and serving debug and metrics on: 0.0.0.0:9090 2025-01-22T20:28:09Z INF home/runner/work/headscale/headscale/hscontrol/poll.go:705 > node has connected, [...] ``` 0.24.0: ``` 2025-01-22T20:25:43Z INF Opening database database=sqlite3 path=/var/lib/headscale/db.sqlite panic: non-positive interval for NewTicker goroutine 54 [running]: time.NewTicker(0x12a05f200?) /nix/store/jfv85qbj4vb1dafcg6kncg4vrbq2bbxv-go-1.23.4/share/go/src/time/tick.go:38 +0xbb github.com/juanfont/headscale/hscontrol.(*Headscale).scheduledTasks(0xc000473900, {0x2548310, 0xc00028c2d0}) /home/runner/work/headscale/headscale/hscontrol/app.go:248 +0xd4 created by github.com/juanfont/headscale/hscontrol.(*Headscale).Serve in goroutine 1 /home/runner/work/headscale/headscale/hscontrol/app.go:616 +0xa65 ``` ### Expected Behavior ??? ### Steps To Reproduce 1. Upgrade docker image from `ghcr.io/juanfont/headscale:0.23.0` to `ghcr.io/juanfont/headscale:0.24.0` 2. Have a derp config like this: ``` derp: server: enabled: false ipv4: ${local.ip-ext-v4} ipv6: ${local.ip-ext-v6} urls: - https://controlplane.tailscale.com/derpmap/default ``` ### Environment ```markdown - OS: Debian 12.9 (Docker 20.10) - Headscale version: 0.24.0 - Tailscale version: n/a ``` ### Runtime environment - [x] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Anything else? The stacktrace shows that it's this line: ``` derpTicker := time.NewTicker(h.cfg.DERP.UpdateFrequency) defer derpTicker.Stop() ``` In my case I have `derp.server.enabled: false` (see config snippet above) so it probably shouldn't be starting that ticker to begin with?
adam added the bug label 2025-12-29 02:25:59 +01:00
adam closed this issue 2025-12-29 02:26:00 +01:00
Author
Owner

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

Duplicate of #2359, fixed in #2368

@kradalby commented on GitHub (Jan 23, 2025): Duplicate of #2359, fixed in #2368
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#919