[Bug] API backfillips call fail #753

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

Originally created by @akelge on GitHub (Jul 26, 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

/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

Expected Behavior

A call to /api/v1/node/backfillips should call the related function in headscale

Steps To Reproduce

Do an API call to /api/v1/node/backfillips and inspect the response

Environment

- OS: docker
- Headscale version: v0.23.0-alpha12

Runtime environment

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

Anything else?

No response

Originally created by @akelge on GitHub (Jul 26, 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 /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 ### Expected Behavior A call to `/api/v1/node/backfillips` should call the related function in headscale ### Steps To Reproduce Do an API call to `/api/v1/node/backfillips` and inspect the response ### Environment ```markdown - OS: docker - Headscale version: v0.23.0-alpha12 ``` ### 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:26 +01:00
adam closed this issue 2025-12-29 02:23:26 +01:00
Author
Owner

@nblock commented on GitHub (Sep 8, 2024):

I could not reproduce this issue on 8a3a0fee3c. It works as expected.

Steps in full to remove a previously assigned IPv6 address:

  • Start headscale using the default prefixes for IPv4 and IPv6
  • Register a node, it gets the IP addresses 100.64.0.1 and fd7a:115c:a1e0::1 assigned
  • Create an API key: headscale apikeys create
  • Stop headscale
  • Remove the configuration key: prefixes.v6
  • Start headscale
  • Send the following request via the headscale API (empty JSON object and confirmed as query parameter):
    $ curl -H 'Authorization: Bearer APIKEY' --json '{}' 'http://localhost:8080/api/v1/node/backfillips?confirmed=true'
    {"changes":["removing IPv6 \"fd7a:115c:a1e0::1\" from Node(1) \"localhost\""]}
    
  • Result: the node's IPv6 address is gone → OK

Actually adding back the IP works as well:

  • Stop headscale
  • Restore the default prefixes for IPv4 and IPv6
  • Start headscale
  • Send the following request via the headscale API (empty JSON object and confirmed as query parameter):
    $ curl -H 'Authorization: Bearer APIKEY' --json '{}' 'http://localhost:8080/api/v1/node/backfillips?confirmed=true'
    {"changes":["assigned IPv6 \"fd7a:115c:a1e0::1\" to Node(1) \"localhost\""]}
    
  • Result: the node's IPv6 address is back → OK

@akelge Can you try again on your installation, please?

@nblock commented on GitHub (Sep 8, 2024): I could not reproduce this issue on 8a3a0fee3ccbca7dd67b0d2965b523c8b6cb5451. It works as expected. Steps in full to remove a previously assigned IPv6 address: * Start `headscale` using the default prefixes for IPv4 and IPv6 * Register a node, it gets the IP addresses `100.64.0.1` and `fd7a:115c:a1e0::1` assigned * Create an API key: `headscale apikeys create` * Stop `headscale` * Remove the configuration key: `prefixes.v6` * Start `headscale` * Send the following request via the headscale API (empty JSON object and `confirmed` as query parameter): ```bash $ curl -H 'Authorization: Bearer APIKEY' --json '{}' 'http://localhost:8080/api/v1/node/backfillips?confirmed=true' {"changes":["removing IPv6 \"fd7a:115c:a1e0::1\" from Node(1) \"localhost\""]} ``` * Result: the node's IPv6 address is gone → OK Actually adding back the IP works as well: * Stop `headscale` * Restore the default prefixes for IPv4 and IPv6 * Start `headscale` * Send the following request via the headscale API (empty JSON object and `confirmed` as query parameter): ```bash $ curl -H 'Authorization: Bearer APIKEY' --json '{}' 'http://localhost:8080/api/v1/node/backfillips?confirmed=true' {"changes":["assigned IPv6 \"fd7a:115c:a1e0::1\" to Node(1) \"localhost\""]} ``` * Result: the node's IPv6 address is back → OK @akelge Can you try again on your installation, please?
Author
Owner

@akelge commented on GitHub (Sep 9, 2024):

I think this was a misunderstanding from my side, I fixed the code of my python API client and now it works.

As a note: I am quite sure I tested it with curl and swagger and it was failing, but most probably it was some kind of typo from my side.

Thanks for spending time investigating this

@akelge commented on GitHub (Sep 9, 2024): I think this was a misunderstanding from my side, I fixed the code of my python API client and now it works. As a note: I am quite sure I tested it with curl and swagger and it was failing, but most probably it was some kind of typo from my side. Thanks for spending time investigating this
Author
Owner

@akelge commented on GitHub (Sep 9, 2024):

All was working, it was an issue with the python API client I am writing

@akelge commented on GitHub (Sep 9, 2024): All was working, it was an issue with the python API client I am writing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#753