dataplaneapi icon indicating copy to clipboard operation
dataplaneapi copied to clipboard

​POST /services​/haproxy​/configuration​/raw using text/plain report missing LF error

Open ljhmily opened this issue 3 years ago • 0 comments

When I POST my raw configuration on /services​/haproxy​/configuration​/raw I get a 400 response code with the response body: curl -s -X POST "http://10.23.10.207:50082/v2/services/haproxy/configuration/raw?version=$(eval $ver)" -H "Content-Type: text/plain" --data-binary "global\n daemon\r\n"

{"code":400,"message":"14: err transactionId=3cad6f19-cad8-4dfa-9c4c-eaea06a25afc \nmsg="parsing [/tmp/haproxy/haproxy.cfg.22b22ff8-752e-416e-977a-9e00eb0ce04c:3]: Missing LF on last line, file might have been truncated at position 10."\nmsg="Error(s) found in configuration file /tmp/haproxy/haproxy.cfg.22b22ff8-752e-416e-977a-9e00eb0ce04c"\nmsg="Fatal errors found in configuration.""}

and the tmp config file has noeol status image

ljhmily avatar May 21 '22 05:05 ljhmily