trafficcontrol icon indicating copy to clipboard operation
trafficcontrol copied to clipboard

deliveryservices returns Internal Server Error when config parameter doesn't exist

Open ericholguin opened this issue 2 years ago • 4 comments

This Bug Report affects these Traffic Control components:

  • Traffic Ops

Current behavior:

When sending either a POST or PUT request to /deliveryservices and either themidHeaderRewrite or edgeHeaderRewrite have a value BUT there is no remap.config parameter created, this will result in an Internal Server Error.

Traffic Ops error.log will show:

ERROR: api.go:263: ... ensuring ds parameters:: creating edge header rewrite parameters: executing parameter query for ATS config location: parameter missing (do you have a name=location config_file=remap.config parameter?

Coming from: https://github.com/apache/trafficcontrol/blob/d4286d867db2a094c39e127336869ad8cc0eb74f/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go#L2019

Expected behavior:

Should return a 400 Bad Request with the proper message mentioning that the parameter is required.

Steps to reproduce:

In CiaB, open TP create a delivery service with an Edge Header Rewrite Rule e.g. "edgeHeader1\nedgeHeader2", after having all other values correctly filled in click on the Create button, you should see an Internal Server Error at the top of the page and it will not have created the delivery service. Do the same again this time with an Mid Header Rewrite Rule e.g. "midHeader1\midHeader2" you should again see an Internal Server Error at the top of the page and it will not have created the delivery service.

The same can be done using the Traffic Ops API with either of the edge or mid header rewrite fields containing a value.

ericholguin avatar Mar 25 '22 15:03 ericholguin

If it's really a requirement that any working ATC instance have this Parameter, it ought to be in our seed data

ocket8888 avatar Mar 28 '22 21:03 ocket8888

either edgeHeaderRewrite or midHeaderRewrite

This also affects cacheurl and probably firstHeaderRewrite, lastHeaderRewrite, and innerHeaderRewrite as well.

ocket8888 avatar Apr 22 '22 20:04 ocket8888

This also affects server deliveryservice assignment through the /servers/{{ID}}/deliveryservices endpoint.

ocket8888 avatar Apr 28 '22 00:04 ocket8888

This also affects server-to-Delivery Service assignment through the /cachegroups/{{ID}}/deliveryservices endpoint.

ocket8888 avatar Jul 08 '22 14:07 ocket8888