Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSI volume API returns invalid/no JSON if volume doesn't exist #13054

Open
rbastiaans-tc opened this issue May 18, 2022 · 1 comment
Open

CSI volume API returns invalid/no JSON if volume doesn't exist #13054

rbastiaans-tc opened this issue May 18, 2022 · 1 comment
Labels
theme/api HTTP API and SDK issues type/bug

Comments

@rbastiaans-tc
Copy link

Nomad version

Nomad v1.3.0 (52e95d64113e01be05d585d8b4c07f6f19efebbc)

Operating system and Environment details

Debian 10 Buster

Issue

The Nomad API for: Read Volume: returns no/invalid JSON for volumes that don't exist

The docs state that it produces: application/json

Reproduction steps

$ curl -H "Accept: application/json" nomad.service.consul:4646/v1/volume/csi/nonexistant
volume not found
$ curl -s -H "Accept: application/json" nomad.service.consul:4646/v1/volume/csi/nonexistant | jq
parse error: Invalid numeric literal at line 1, column 7
$ curl -s -H "Accept: application/json" nomad.service.consul:4646/v1/volume/csi/nonexistant | python -m json.tool
No JSON object could be decoded

Expected Result

Some valid JSON data with the error, something like this:

  • { 'status': 'volume not found' }

Actual Result

Regular text status response:

  • volume not found

Job file (if appropriate)

Nomad Server logs (if appropriate)

Nomad Client logs (if appropriate)

@rbastiaans-tc rbastiaans-tc changed the title volume API returns invalid/no JSON if volume doesn't exist CSI volume API returns invalid/no JSON if volume doesn't exist May 18, 2022
@tgross tgross added the theme/api HTTP API and SDK issues label May 18, 2022
@tgross
Copy link
Member

tgross commented Jun 6, 2022

Hi @rbastiaans-tc! This is an unfortunate misfeature across the entire Nomad HTTP API. See also #8236. We'll need to break backwards compatibility to fix it, so we need to go thru a design effort and then a deprecation period first. I'm going to mark this issue for roadmapping until we have an issue open to go thru that API change work.

Thanks for opening this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api HTTP API and SDK issues type/bug
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

2 participants