You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @rahadiangg! I was able to reproduce this but it looks like it's intentional, although perhaps for an unfortunate reason. As far as the server is concerned, it's sending a Permission Denied error with a 403 error code:
But the api package that the CLI uses is then taking that value and mangling it. This is specifically to support the Peek API used by consul-template as described here https://github.com/hashicorp/nomad/blob/v1.9.3/api/variables.go#L225. But it looks like this internal function is not quite correct for all consumers. It would be a minor breaking API change to correct the exit code at this point. I'll mark this for fixing in the next LTS release... hopefully we can land this as a quick fix in Nomad 1.10.0.
Marking for roadmapping.
tgross
changed the title
Nomad CLI return not found when get variables with wrong token
variables Go API should not "not found" for permission denied except for Peek
Dec 17, 2024
tgross
changed the title
variables Go API should not "not found" for permission denied except for Peek
variables Go API should not return "not found" for permission denied except for Peek
Dec 17, 2024
Nomad version
Nomad v1.9.1
BuildDate 2024-10-21T09:00:50Z
Revision d9ec23f
Operating system and Environment details
Nomad CLI on MacOS M1
Issue
the
nomad var
command returns misleading error when getting variable with wrong nomad tokenReproduction steps
Variable not found
Expected Result
Return 403 Permission denied like when do
nomad var list
Actual Result
Error
Variable not found
The text was updated successfully, but these errors were encountered: