[Solved] HAProxy throws error on configuration change

  • I just duplicated my "redirect port 80 to port 443" rule to use it with my newly introduced secondary WAN IP address.

    Now HAProxy throws this error:

    [ALERT] ….: parsing [/var/etc/haproxy_test/haproxy.cfg:27]: <errorfile>expects <status_code>and <file>asarguments.

    I checked my running config [/var/etc/haproxy.cfg], there is no errorfile line in it.
    The test generates this line:

    Did anything change?

    Documentation for HAProxy 1.6 says syntax "errorfile `<file>"

    What can I do to repair this?

    running HAProxy 0.48 (haproxy-1.6.6) on pfsense 2.3.1

    Thanks for any help

  • Just an update to my own Post:

    My haproxy didn't work anymore, so I needed any quick fix asap.

    I just hacked the source of "/usr/local/pkg/haproxy/haproxy.inc":

    in line 1704 you find

    fwrite ($fd, "\terrorfile\t\t\t" . $errorcode . " " . $filename . "\n");

    This is part of an IF-statement, which starts in line 1691.

    I had no time to figure out, what the purpose of this IF is and why it becomes TRUE.
    I did not configure any errorfiles…

    Just patching this line with a string "404" instead of the variable $errorcode gives a correct syntax.
    It raises a different error messages, which fortunately gets ignored.

    This may perhaps help in finding the problem…


  • The Problem is solved.

    After Update of HAProxy there was an undefined and unexpected behaviour:

    When changing frontend definitions, they magically got empty errorfiles entries.

    In the webfrontend of pfSense you cannot see these very easily because they are empty.
    You only see Icons for Edit/Delete.

    After deleting all these entries, everything is fine.


  • For your information, the issue was likely caused by this bug which should get fixed 'soon' https://redmine.pfsense.org/issues/6511

Log in to reply