[Bug] Unable to remove routes #1101

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

Originally created by @p3lim on GitHub (Sep 12, 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

I want to remove all routes on a node. According to the help text from `headscale nodes approve-routes" it says this:

-r, --routes strings List of routes that will be approved (... or empty string to remove all approved routes)

When I try to do this however:

> headscale nodes approve-routes -i 2 -r ""
Error: flag needs an argument: 'r' in -r

> headscale nodes approve-rotues -i 2 --routes ""
Error: flag needs an argument: --routes

Expected Behavior

I expect the routes to get removed from the node.

Steps To Reproduce

  1. add route on node tailscale set --advertise-routes=10.42.0.5/32
  2. approve route headscale nodes approve-routes -i 2 -r "10.42.0.5/32"
  3. attempt to remove route headscale nodes approve-routes -i 2 -r ""

Environment

- OS: Ubuntu 24.04
- Headscale version: 0.26.1
- Tailscale version: 1.88.1

Runtime environment

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

Debug information

Debug information should be irrelevant - this is an inconsistency/error in the CLI/API.

Originally created by @p3lim on GitHub (Sep 12, 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 I want to remove all routes on a node. According to the help text from `headscale nodes approve-routes" it says this: > -r, --routes strings List of routes that will be approved (... **or empty string to remove all approved routes**) When I try to do this however: ``` > headscale nodes approve-routes -i 2 -r "" Error: flag needs an argument: 'r' in -r > headscale nodes approve-rotues -i 2 --routes "" Error: flag needs an argument: --routes ``` ### Expected Behavior I expect the routes to get removed from the node. ### Steps To Reproduce 1. add route on node `tailscale set --advertise-routes=10.42.0.5/32` 2. approve route `headscale nodes approve-routes -i 2 -r "10.42.0.5/32"` 3. attempt to remove route `headscale nodes approve-routes -i 2 -r ""` ### Environment ```markdown - OS: Ubuntu 24.04 - Headscale version: 0.26.1 - Tailscale version: 1.88.1 ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Debug information Debug information should be irrelevant - this is an inconsistency/error in the CLI/API.
adam added the bug label 2025-12-29 02:28:16 +01:00
adam closed this issue 2025-12-29 02:28:16 +01:00
Author
Owner

@nblock commented on GitHub (Sep 12, 2025):

Just tested it on 0.26.1 and it works as you posted: headscale nodes approve-routes -i 2 -r "".

Since your headscale is running in a container: did you use pass -it to the docker/podman invocation?

@nblock commented on GitHub (Sep 12, 2025): Just tested it on 0.26.1 and it works as you posted: `headscale nodes approve-routes -i 2 -r ""`. Since your headscale is running in a container: did you use pass `-it` to the docker/podman invocation?
Author
Owner

@p3lim commented on GitHub (Sep 12, 2025):

Yeah I've aliased headscale='docker exec -it headscale-headscale-1 headscale.

@p3lim commented on GitHub (Sep 12, 2025): Yeah I've aliased `headscale='docker exec -it headscale-headscale-1 headscale`.
Author
Owner

@p3lim commented on GitHub (Sep 12, 2025):

Noticed now however that I can just not provide the -r argument at all and it will delete the route.

@p3lim commented on GitHub (Sep 12, 2025): Noticed now however that I can just _not_ provide the `-r` argument at all and it will delete the route.
Author
Owner

@p3lim commented on GitHub (Sep 12, 2025):

The help text should probably be corrected though.

@p3lim commented on GitHub (Sep 12, 2025): The help text should probably be corrected though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1101