Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
foosinn opened this issue Jan 21, 2025 · 2 comments · Fixed by #2368
Closed
4 tasks done

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

foosinn opened this issue Jan 21, 2025 · 2 comments · Fixed by #2368
Labels
bug Something isn't working
Milestone

Comments

@foosinn
Copy link
Contributor

foosinn commented 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

@foosinn foosinn added the bug Something isn't working label Jan 21, 2025
kradalby added a commit to kradalby/headscale that referenced this issue Jan 22, 2025
Fixes juanfont#2362

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Jan 22, 2025
Fixes juanfont#2362

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Jan 23, 2025
Fixes juanfont#2362

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby
Copy link
Collaborator

Duplicate of #2359, fixed in #2368

kradalby added a commit to kradalby/headscale that referenced this issue Jan 23, 2025
Fixes juanfont#2362

Signed-off-by: Kristoffer Dalby <[email protected]>
@foosinn
Copy link
Contributor Author

foosinn commented Jan 23, 2025

Thanks so much 👍

kradalby added a commit that referenced this issue Jan 23, 2025
* fix panic if derp update is 0

Fixes #2362

Signed-off-by: Kristoffer Dalby <[email protected]>

* update changelog

Signed-off-by: Kristoffer Dalby <[email protected]>

---------

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Jan 23, 2025
* fix panic if derp update is 0

Fixes juanfont#2362

Signed-off-by: Kristoffer Dalby <[email protected]>

* update changelog

Signed-off-by: Kristoffer Dalby <[email protected]>

---------

Signed-off-by: Kristoffer Dalby <[email protected]>
@nblock nblock added this to the v0.24.1 milestone Jan 27, 2025
socoldkiller pushed a commit to socoldkiller/headscale that referenced this issue Jan 30, 2025
* fix panic if derp update is 0

Fixes juanfont#2362

Signed-off-by: Kristoffer Dalby <[email protected]>

* update changelog

Signed-off-by: Kristoffer Dalby <[email protected]>

---------

Signed-off-by: Kristoffer Dalby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants