[Bug] Nodes Reported as Offline when Updating Routes #1039

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

Originally created by @GoodiesHQ on GitHub (May 30, 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

When sending a POST request to /api/v1/node/<NodeID>/approved_routes, the response is the node object

    "v1SetApprovedRoutesResponse": {
      "type": "object",
      "properties": {
        "node": {
          "$ref": "#/definitions/v1Node"
        }
      }
    },

However, it seems like no matter what the status is of the node before-hand, it will always be reported as online: false within the response's node object.

The node is online, then approve_routes displays the status as offline, then immediately shows online again.

Expected Behavior

The status of the node should not change.

Steps To Reproduce

Forgive me for using the annoying escape mechanics of windows powershell, but I can run this compound command. It checks a node and uses jq to parse the ".node.online" value. It returns true. Then it updates the node's approved routes, and prints out the same ".node.online" value. Finally, it performs the first request again just to check the node's true online status.

PS C:\> 
>> curl.exe -s -H "Authorization: Bearer ${TOKEN}" https://headscale.example.com/api/v1/node/8 | jq .node.online;
>> curl.exe -s -H "Authorization: Bearer ${TOKEN}" -X POST -d "{\`"routes\`":[\`"192.168.0.0/16\`"]}" https://headscale.example.com/api/v1/node/8/approve_routes | jq .node.online;
>> curl.exe -s -H "Authorization: Bearer ${TOKEN}" https://headscale.example.com/api/v1/node/8 | jq .node.online;

true
false
true

Environment

- OS: Ubuntu 22.04
- Headscale version: 0.26
- Tailscale version: N/A

Runtime environment

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

Debug information

Just the above command output is sufficient.

Originally created by @GoodiesHQ on GitHub (May 30, 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 When sending a POST request to `/api/v1/node/<NodeID>/approved_routes`, the response is the node object ``` "v1SetApprovedRoutesResponse": { "type": "object", "properties": { "node": { "$ref": "#/definitions/v1Node" } } }, ``` However, it seems like no matter what the status is of the node before-hand, it will always be reported as `online: false` within the response's node object. The node is online, then approve_routes displays the status as offline, then immediately shows online again. ### Expected Behavior The status of the node should not change. ### Steps To Reproduce Forgive me for using the annoying escape mechanics of windows powershell, but I can run this compound command. It checks a node and uses jq to parse the ".node.online" value. It returns true. Then it updates the node's approved routes, and prints out the same ".node.online" value. Finally, it performs the first request again just to check the node's true online status. ``` PS C:\> >> curl.exe -s -H "Authorization: Bearer ${TOKEN}" https://headscale.example.com/api/v1/node/8 | jq .node.online; >> curl.exe -s -H "Authorization: Bearer ${TOKEN}" -X POST -d "{\`"routes\`":[\`"192.168.0.0/16\`"]}" https://headscale.example.com/api/v1/node/8/approve_routes | jq .node.online; >> curl.exe -s -H "Authorization: Bearer ${TOKEN}" https://headscale.example.com/api/v1/node/8 | jq .node.online; true false true ``` ### Environment ```markdown - OS: Ubuntu 22.04 - Headscale version: 0.26 - Tailscale version: N/A ``` ### Runtime environment - [x] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Debug information Just the above command output is sufficient.
adam added the bugno-stale-botroutes labels 2025-12-29 02:27:53 +01:00
adam closed this issue 2025-12-29 02:27:53 +01:00
Author
Owner

@kradalby commented on GitHub (Sep 9, 2025):

Could you try the current HEAD of the main branch?

@kradalby commented on GitHub (Sep 9, 2025): Could you try the current HEAD of the main branch?
Author
Owner

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

This should be fixed in HEAD, please test and reopen if not fixed in the next release.

@kradalby commented on GitHub (Sep 12, 2025): This should be fixed in HEAD, please test and reopen if not fixed in the next release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1039