apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.03k stars 339 forks source link

Requesting for non-existing bucket returns Internal Server Error #4472

Open ericholguin opened 4 years ago

ericholguin commented 4 years ago

I'm submitting a ...

Traffic Control components affected ...

Current behavior:

When making a GET request to /vault/bucket/{bucket}/key/{key}/values with a bucket value that does not exist the response returned is:

HTTP/1.1 500 Internal Server Error
{
    "alerts": [
        {
            "text": "Internal Server Error",
            "level": "error"
        }
    ]
}

Expected / new behavior:

Should return:

HTTP/1.1 404 Not Found
{
    "alerts": [
        {
            "text": "Resource not found.",
            "level": "error"
        }
    ]
}

Minimal reproduction of the problem with instructions:

Anything else:

Error Log:

ERROR: api.go:146: getting bucket key from Riak: ClientError|[Cluster] all retries exhausted and/or no nodes available to execute command|InnerError|RiakError|0|Permission denied: User ... does not have ... on default/doesntexist
ocket8888 commented 4 years ago

I think the problem here is that Traffic Ops doesn't know why the request failed, and it looks like even if it tried parsing the error there it wouldn't be totally clear, because it's saying that permission is being denied. So idk if the behaviour here can really be improved.

mitchell852 commented 3 years ago

closing as riak is soon to be deprecated.

zrhoffman commented 3 years ago

This issue could possibly occur in the new Traffic Vault implementation discussed on the mailing list.

zrhoffman commented 3 years ago

Reopening because this is more of a general Traffic Vault issue than a Riak issue.