trafficcontrol icon indicating copy to clipboard operation
trafficcontrol copied to clipboard

/consistenthash Internal Server Error when requesting a CDN with no Traffic Routers

Open ocket8888 opened this issue 3 years ago • 0 comments

This Bug Report affects these Traffic Control components:

  • Traffic Ops

Current behavior:

If you make a POST request to /consistenthash (any version) with a request body that specifies a cdnId that identifies a CDN which contains no servers that have a Type that has the exact name CCR, it will respond with a 500 Internal Server Error response.

Expected behavior:

When requesting testing a consistent hashing regular expression for a CDN that contains no Traffic Routers, the fault is with the requestor. That operation cannot succeed because an invalid parameter was specified. Therefore, the response code should be a 400 Bad Request or similar with an Alert that describes the problem.

The ubiquitous "ALL" CDN exists in all working ATC installations, and while that can contain Traffic Routers I'd be surprised if anyone's actually did in production. So while this bug is probably not actually going to cause any problems, it's pretty much guaranteed to be reproducible in nearly every environment.

Steps to reproduce:

  • topost -k consistenthash '{"cdnId": 1, "regex": ".*", "requestPath": "/asset.m3u8"}' (assuming the ID of the ALL CDN and/or some CDN with no Traffic Routers is 1).

ocket8888 avatar Jul 15 '22 00:07 ocket8888