Pre-auth keys cannot be expired in some scenarios
Description
Internal Server Error when I try to expire a reusable key.
Headplane Version
v0.5.10
Headscale Version
v0.25.1
I need debug logs, or anything that may indicate the cause.
Sorry, I forgot paste it:
ResponseError: Response Error (500): {"code":2, "message":"preauth key does not belong to user", "details":[]}
at ApiClient.post (file:///app/build/server/assets/index-CD2MsUX2.js:234791:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async action (file:///app/build/server/assets/server-build.js:60777:5)
at async callRouteHandler (file:///app/build/server/assets/index-CD2MsUX2.js:10343:16)
at async file:///app/build/server/assets/index-CD2MsUX2.js:7108:19
at async callLoaderOrAction (file:///app/build/server/assets/index-CD2MsUX2.js:7158:16)
at async Promise.all (index 0)
at async defaultDataStrategy (file:///app/build/server/assets/index-CD2MsUX2.js:6943:17)
at async callDataStrategyImpl (file:///app/build/server/assets/index-CD2MsUX2.js:7068:17)
at async callDataStrategy (file:///app/build/server/assets/index-CD2MsUX2.js:6805:19) {
status: 500,
response: '{"code":2, "message":"preauth key does not belong to user", "details":[]}',
responseObject: {
code: 2,
message: 'preauth key does not belong to user',
details: []
}
}
I can understand the error, but my user has owner role, so I think that I its enough. However, in this case, user matches.
Oh yes, this is actually unrelated to permissions, Headscale's API expects a pre-auth key to be bound to a user so when you make the request it wants both fields. Either way, this doesn't seem like a complicated fix.
@losthorizon84 Please test with the ghcr.io/tale/headplane:next image.
Interested in beta testing? Subscribe to the Pre-release Testing discussion to be notified about future testing release. As always, pre-release versions are accessible on Docker via
ghcr.io/tale/headplane:nextor thenexttag on Git.
It’s working now with next tag. Thank you!