[Bug] API inconsistencies #737

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

Originally created by @akelge on GitHub (Jun 27, 2024).

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 am finding some bugs in the API responses, especially:

  • calling /api/v1/node/<nodeId> does not return validTags although tags are present, calling /api/v1/node and getting the node I want, validTags is properly populated
  • registerMethod is always REGISTER_METHOD_UNSPECIFIED even if in the DB the nodes have the correct value for the register method

Expected Behavior

I would expect that a call to /api/v1/node/<nodeid> would return the correct set of tags and that the registerMethod would be set to the correct value

Steps To Reproduce

Do an API call to /api/v1/node/<nodeid> and inspect the response

Environment

- OS: docker
- Headscale version: v0.23.0-alpha12
- Tailscale version: not relevant

Runtime environment

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

Anything else?

No response

Originally created by @akelge on GitHub (Jun 27, 2024). ### 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 am finding some bugs in the API responses, especially: - calling `/api/v1/node/<nodeId>` does not return `validTags` although tags are present, calling `/api/v1/node` and getting the node I want, `validTags` is properly populated - `registerMethod` is always `REGISTER_METHOD_UNSPECIFIED` even if in the DB the nodes have the correct value for the register method ### Expected Behavior I would expect that a call to `/api/v1/node/<nodeid>` would return the correct set of tags and that the `registerMethod` would be set to the correct value ### Steps To Reproduce Do an API call to `/api/v1/node/<nodeid>` and inspect the response ### Environment ```markdown - OS: docker - Headscale version: v0.23.0-alpha12 - Tailscale version: not relevant ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [X] Headscale runs in a container ### Anything else? _No response_
adam added the bug label 2025-12-29 02:23:04 +01:00
adam closed this issue 2025-12-29 02:23:04 +01:00
Author
Owner

@akelge commented on GitHub (Jun 28, 2024):

/api/v1/node/backfillips fails, I think that the route is not matched, so it tries to retrieve info on node with id backfillips, failing, of course

@akelge commented on GitHub (Jun 28, 2024): `/api/v1/node/backfillips` fails, I think that the route is not matched, so it tries to retrieve info on node with id `backfillips`, failing, of course
Author
Owner

@bigbozza commented on GitHub (Jul 17, 2024):

for what it is worth, I've tested this and it worked:
"nodes":[{"id":"1","machineKey":"mkey:1538e343afbf96495e98bf98385c2d14254c682ec71436ed1a294f1f21100c63","nodeKey":"nodekey:f5ab18e3dde949988ec6fdcf31c42ec1440cd96d6d77c7048f725fba2003f869","discoKey":"discokey:16ef4ff594f66440486015c341c64d3b414b922f84e1d1635e31958286bf684b","ipAddresses":["100.64.0.1","fd7a:115c:a1e0::1"],"name":"Veeam","user":{"id":"1","name":"boz","createdAt":"2024-07-17T06:22:27.041754446Z"},"lastSeen":"2024-07-17T06:24:42.982663920Z","expiry":"0001-01-01T00:00:00Z","preAuthKey":null,"createdAt":"2024-07-17T06:24:38.276313596Z","registerMethod":"REGISTER_METHOD_CLI","forcedTags":[],"invalidTags":[],"validTags":[],"givenName":"veeam","online":true}]}

REGISTER_METHOD_CLI

@bigbozza commented on GitHub (Jul 17, 2024): for what it is worth, I've tested [this](https://github.com/juanfont/headscale/compare/main...rubenspeculis:headscale:issues/1996) and it worked: `"nodes":[{"id":"1","machineKey":"mkey:1538e343afbf96495e98bf98385c2d14254c682ec71436ed1a294f1f21100c63","nodeKey":"nodekey:f5ab18e3dde949988ec6fdcf31c42ec1440cd96d6d77c7048f725fba2003f869","discoKey":"discokey:16ef4ff594f66440486015c341c64d3b414b922f84e1d1635e31958286bf684b","ipAddresses":["100.64.0.1","fd7a:115c:a1e0::1"],"name":"Veeam","user":{"id":"1","name":"boz","createdAt":"2024-07-17T06:22:27.041754446Z"},"lastSeen":"2024-07-17T06:24:42.982663920Z","expiry":"0001-01-01T00:00:00Z","preAuthKey":null,"createdAt":"2024-07-17T06:24:38.276313596Z","registerMethod":"REGISTER_METHOD_CLI","forcedTags":[],"invalidTags":[],"validTags":[],"givenName":"veeam","online":true}]}` **REGISTER_METHOD_CLI**
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#737