headplane icon indicating copy to clipboard operation
headplane copied to clipboard

Disable run as exit node on client does not remove it from admin page

Open alexyao2015 opened this issue 10 months ago • 5 comments

Enabling "run as exit node" immediately enables the node to be able to selected as an exit node on the frontend, however disabling this does not remove the option from the frontend and instead results in an error when turned on.

Reproduction:

  1. Enable "run as exit node" on the client with the frontend open.
  2. Observe the node showing as being able to be an exit node.
  3. Turn on the exit node on the admin page.
  4. Disable "run as exit node" on the client.
  5. Observe the frontend shows "awaiting approval"
  6. Attempt to turn on "use as exit node" on the frontend.
  7. Observe "unexpected server error"

alexyao2015 avatar Jan 15 '25 01:01 alexyao2015

Do you have any logs?

tale avatar Jan 15 '25 05:01 tale

Sure, but are you able to reproduce this? From my testing, it seems to occur reliably, at least on my instance.

HeadscaleError: {"code":2,"message":"route (localhost) is not available on node 0.0.0.0/0: route is not available on node","details":[]}
    at post (file:///app/build/server/index.js:94:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/build/server/index.js:3419:9
    at async Promise.all (index 1)
    at async menuAction (file:///app/build/server/index.js:3418:7)
    at async callRouteAction (file:///app/build/headplane/assets/index-C13YWu_9.js:40424:16)
    at async file:///app/build/headplane/assets/index-C13YWu_9.js:38830:19
    at async callLoaderOrAction (file:///app/build/headplane/assets/index-C13YWu_9.js:38895:16)
    at async Promise.all (index 2)
    at async file:///app/build/headplane/assets/index-C13YWu_9.js:40103:19 {
  status: 500
}

alexyao2015 avatar Jan 15 '25 18:01 alexyao2015

I can reproduce, thanks for raising the issue. I'll fix it.

tale avatar Jan 17 '25 07:01 tale

This probably is an issue with headscale itself based on the fact it doesn't remove the route from the list once it's no longer being advertised.

alexyao2015 avatar Jan 17 '25 10:01 alexyao2015

Yeah, if you could confirm that and open a bug report on Headscale that's probably best. I'd need to see if I can handle this logic on Headplane either way.

tale avatar Jan 17 '25 11:01 tale