Advertising and existing pre-authorised route does not enable it #598

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

Originally created by @tomtom5152 on GitHub (Dec 15, 2023).

Context

This was discovered using the k3s tailscale integration, however I have manually replicated it using native tailscale commands.

Bug description

When a route that is preauthorised by ACL autoApprovers it automatically get enabled as would be expected.

If the node then stops advertising it, the appropriate flags in the DB get set to false.

If the node starts advertising again, Route.Advertised correctly get set to true, however Route.Enabled remains false unless tailscale itself is restarted.

Sample routes table entries

These are abbreviated database entries for what I am witnessing. I have omitted irrelevant information as it either does not change, or is of minimal significance (timestamps etc). All IP ranges fall within the ranges for autoApprovers on the node.

Event ID prefix advertised enabled is_primary
Node first advertises 1 198.51.100.0/24 true true true
Node stops advertising 1 198.51.100.0/24 false false true
Node resumes advertising 1 198.51.100.0/24 true false true
Tailscaled is restart 1 198.51.100.0/24 true true true

Environment

Headscale host

  • OS: Ubuntu 23.04 LTS arm64
  • Headscale version: v0.23.0-alpha2
  • Database: CockroachDB (also confirmed on Postgres and SQLite, just happen to be using CRDB)
  • Confirmed with and without docker
  • Confirmed with and without reverse proxy

Tailscale hosts

OS Tailscale version
Ubuntu 23.04 LTS arm64 1.56.0
OPNsense 23.7.8_1-amd64 1.54.0
Unraid 6.12.6 1.54.0

To Reproduce

On a node appropriately labelled and in autoApprovers

tailscale set --advertise-routes=198.51.100.0/24
tailscale set --advertise-routes=
tailscale set --advertise-routes=198.51.100.0/24

To reenable the route (systemd)

systemctl restart tailscaled

Originally created by @tomtom5152 on GitHub (Dec 15, 2023). ## Context This was discovered using the `k3s` tailscale integration, however I have manually replicated it using native tailscale commands. ## Bug description When a route that is preauthorised by ACL `autoApprovers` it automatically get enabled as would be expected. If the node then stops advertising it, the appropriate flags in the DB get set to `false`. If the node starts advertising again, `Route.Advertised` correctly get set to true, however `Route.Enabled` remains false unless tailscale itself is restarted. ### Sample routes table entries These are abbreviated database entries for what I am witnessing. I have omitted irrelevant information as it either does not change, or is of minimal significance (timestamps etc). All IP ranges fall within the ranges for `autoApprovers` on the node. Event | ID | prefix | advertised | enabled | is_primary ---|---|---|---|---|--- Node first advertises | 1 | 198.51.100.0/24 | true | true | true Node stops advertising | 1 | 198.51.100.0/24 | false | false | true Node resumes advertising | 1 | 198.51.100.0/24 | true | false | true Tailscaled is restart | 1 | 198.51.100.0/24 | true | true | true ## Environment ### Headscale host - OS: Ubuntu 23.04 LTS arm64 - Headscale version: v0.23.0-alpha2 - Database: CockroachDB (also confirmed on Postgres and SQLite, just happen to be using CRDB) - Confirmed with and without docker - Confirmed with and without reverse proxy ### Tailscale hosts OS | Tailscale version ----|---- Ubuntu 23.04 LTS arm64 | 1.56.0 OPNsense 23.7.8_1-amd64 | 1.54.0 Unraid 6.12.6 | 1.54.0 ## To Reproduce On a node appropriately labelled and in `autoApprovers` `tailscale set --advertise-routes=198.51.100.0/24` `tailscale set --advertise-routes=` `tailscale set --advertise-routes=198.51.100.0/24` To reenable the route (systemd) `systemctl restart tailscaled`
adam added the bug label 2025-12-29 02:21:01 +01:00
adam closed this issue 2025-12-29 02:21:01 +01:00
Author
Owner

@Apoorva64 commented on GitHub (Dec 18, 2023):

+1, I've got the same issue

@Apoorva64 commented on GitHub (Dec 18, 2023): +1, I've got the same issue
Author
Owner

@kradalby commented on GitHub (Jan 2, 2024):

I think this should be fixed in https://github.com/juanfont/headscale/pull/1670, would be great if you give it a try.

@kradalby commented on GitHub (Jan 2, 2024): I think this should be fixed in https://github.com/juanfont/headscale/pull/1670, would be great if you give it a try.
Author
Owner

@tomtom5152 commented on GitHub (Jan 14, 2024):

Tested as it currently is in #1670 with k3s, appears to work perfectly but have only had limited testing.

@tomtom5152 commented on GitHub (Jan 14, 2024): Tested as it currently is in #1670 with k3s, appears to work perfectly but have only had limited testing.
Author
Owner

@kradalby commented on GitHub (Jan 18, 2024):

Could you give 0.23.0-alpha3 a go and report back?

@kradalby commented on GitHub (Jan 18, 2024): Could you give 0.23.0-alpha3 a go and report back?
Author
Owner

@kradalby commented on GitHub (Feb 15, 2024):

https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha4

@kradalby commented on GitHub (Feb 15, 2024): https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha4
Author
Owner

@kradalby commented on GitHub (Feb 19, 2024):

Could you please test if this is still the case with https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha5 ?

@kradalby commented on GitHub (Feb 19, 2024): Could you please test if this is still the case with https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha5 ?
Author
Owner

@ozeliurs commented on GitHub (Mar 13, 2024):

Could you please test if this is still the case with https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha5 ?

I cannot reproduce the problem on headscale v0.23.0-alpha5 and k3s v1.28.3+k3s2 thus I conclude this issue has been fixed.

If you need me to test a specific scenario concerning headscale and k3s do not hesitate to reach out to me.

Thanks a lot.

@Apoorva64

@ozeliurs commented on GitHub (Mar 13, 2024): > Could you please test if this is still the case with https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha5 ? I cannot reproduce the problem on headscale v0.23.0-alpha5 and k3s v1.28.3+k3s2 thus I conclude this issue has been fixed. If you need me to test a specific scenario concerning headscale and k3s do not hesitate to reach out to me. Thanks a lot. @Apoorva64
Author
Owner

@linjanin commented on GitHub (Mar 29, 2024):

#1670 After routes changed, the instance of node doesn't set Routes field with the new routes value. Later, StatePeerChanged event emitted, mapper.tailNode function will retrieve routes from it to determining allowedIPs. It always leads the clients to receive previous advertised routes.

@linjanin commented on GitHub (Mar 29, 2024): #1670 After routes changed, the instance of node doesn't set Routes field with the new routes value. Later, StatePeerChanged event emitted, mapper.tailNode function will retrieve routes from it to determining allowedIPs. It always leads the clients to receive previous advertised routes.
Author
Owner

@kradalby commented on GitHub (Apr 17, 2024):

Could you please try the newest alpha (https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha6) and report back?

@kradalby commented on GitHub (Apr 17, 2024): Could you please try the newest alpha (https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha6) and report back?
Author
Owner

@kradalby commented on GitHub (Apr 30, 2024):

Could you try the newest alpha (https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha10) and report back? If we do not hear back I will assume it has been resolved.

@kradalby commented on GitHub (Apr 30, 2024): Could you try the newest alpha (https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha10) and report back? If we do not hear back I will assume it has been resolved.
Author
Owner

@kradalby commented on GitHub (May 24, 2024):

I believe fixes in https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha12 should resolve this issue, let me now if not and we will reopen it.

@kradalby commented on GitHub (May 24, 2024): I believe fixes in https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha12 should resolve this issue, let me now if not and we will reopen it.
Author
Owner

@Apoorva64 commented on GitHub (Jun 1, 2024):

@kradalby Works for us on alpha12

@Apoorva64 commented on GitHub (Jun 1, 2024): @kradalby Works for us on alpha12
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#598