[Bug] Headscale hangs on SIGINT #1093

Closed
opened 2025-12-29 02:28:14 +01:00 by adam · 0 comments
Owner

Originally created by @nblock on GitHub (Aug 29, 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

The headscale process hangs during shutdown when at least one node is connected and a SIGINT signal is sent to it: ctrl-c, or kill -INT $(pidof headscale).

Output:

2025-08-29T15:49:01+02:00 INF Received signal to stop, shutting down gracefully signal=interrupt
2025-08-29T15:49:01+02:00 INF hscontrol/app.go:268 > scheduled task worker is shutting down.
2025-08-29T15:49:01+02:00 INF shutting down debug http server
2025-08-29T15:49:01+02:00 INF shutting down main http server
2025-08-29T15:49:01+02:00 INF closing node notifier
2025-08-29T15:49:01+02:00 INF waiting for netmap stream to close

Expected Behavior

Shutdown properly.

Steps To Reproduce

  1. Build headscale main (tested with: 8e25f7f9dd)
  2. Configure: server_url, tls_cert_path, tls_key_path
  3. Create a user: headscale user create alice
  4. Connect node: tailscale up --login-server https://testing.internal:8443
  5. Register node: headscale nodes register --user alice --key KEY
  6. Request stop with ctrl-c/signal: kill -INT $(pidof headscale)

Environment

- OS: Debian 13
- Headscale version: 8e25f7f9dd12421a805f82f09676b592a39c61b9 (have not seen this in 0.26.1)
- Tailscale version: 1.86.2

Runtime environment

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

Debug information

The log output with log.level: trace does not reveal more information.

Originally created by @nblock on GitHub (Aug 29, 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 The headscale process hangs during shutdown when at least one node is connected and a SIGINT signal is sent to it: `ctrl-c`, or `kill -INT $(pidof headscale)`. Output: ``` 2025-08-29T15:49:01+02:00 INF Received signal to stop, shutting down gracefully signal=interrupt 2025-08-29T15:49:01+02:00 INF hscontrol/app.go:268 > scheduled task worker is shutting down. 2025-08-29T15:49:01+02:00 INF shutting down debug http server 2025-08-29T15:49:01+02:00 INF shutting down main http server 2025-08-29T15:49:01+02:00 INF closing node notifier 2025-08-29T15:49:01+02:00 INF waiting for netmap stream to close ``` ### Expected Behavior Shutdown properly. ### Steps To Reproduce 1. Build headscale main (tested with: 8e25f7f9dd12421a805f82f09676b592a39c61b9) 1. Configure: `server_url`, `tls_cert_path`, `tls_key_path` 1. Create a user: `headscale user create alice` 1. Connect node: `tailscale up --login-server https://testing.internal:8443` 1. Register node: `headscale nodes register --user alice --key KEY` 1. Request stop with ctrl-c/signal: `kill -INT $(pidof headscale)` ### Environment ```markdown - OS: Debian 13 - Headscale version: 8e25f7f9dd12421a805f82f09676b592a39c61b9 (have not seen this in 0.26.1) - Tailscale version: 1.86.2 ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Debug information The log output with `log.level: trace` does not reveal more information.
adam added the bugno-stale-bot labels 2025-12-29 02:28:14 +01:00
adam closed this issue 2025-12-29 02:28:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1093