2

I am so sorry for any unconvenience as I am very fresh new to HAProxy and now I have one issue which may not really an issue but as I am fresh new to this tool I don't know how to fix it.

I was using HAProxy version 1.8.8 and now I am upgrade to version 2.0.5 and my /etc/haproxy/haproxy.cfg which was work properly on HAProxy version 1.8.8 is no longer work now in HAProxy new version 2.0.5. From the log /var/log/haproxy.log I got this error message

Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: frontend 'http': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: backend 'video-upload': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: backend 'video-upload-merchant': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: backend 'video-upload-premium': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: backend 'contents-upload': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: proxy 'stats': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: proxy 'stats2': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: proxy 'stats3': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : config: proxy 'stats4': Unable to convert message in HTX for HTTP return code 503.
Aug 30 19:59:21 haproxy2002 haproxy[2726]: [ALERT] 241/195921 (2726) : Fatal errors found in configuration.

Please kindly help me

2 Answers2

1

Assuming that the error is caused by errorfile directive.

errorfile 500 /etc/haproxy/errors/500.http
errorfile 503 /etc/haproxy/errors/503.http

I had the same issue and it was because we did not have the HTTP header in .http file but just the html.

I had to add at the beginning of the file the header

HTTP/1.1 500 Internal Error
Cache-Control: no-cache
Connection: close
Content-Type: text/plain
Retry-After: 60
<blank line>
<rest of file content>

Hope this helps.

Some examples here: https://github.com/ingshtrom/haproxy-htx-conversion-issue (credit to the author). Original source: https://discourse.haproxy.org/t/is-this-a-bug-unable-to-convert-message-in-htx/4304

0

Besides the requirement for a HTTP header (including blank line between header and body), you can get tripped up by a BOM (byte order mark) in your file.

If you save a file as UTF-8 it may include a BOM at the start (depends on the editor and your options), which HAProxy does not like.

Solution is to save it as UTF-8 without the BOM (you can do this with an editor like EditPlus for example, or write it fresh with pico on Linux).

Jim W
  • 101
  • 2