headscale icon indicating copy to clipboard operation
headscale copied to clipboard

[Bug] Nodes Reported as Offline when Updating Routes

Open GoodiesHQ opened this issue 7 months ago • 0 comments

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

- 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.

GoodiesHQ avatar May 30 '25 08:05 GoodiesHQ