Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [Solved] HAProxy throws error on configuration change

    Scheduled Pinned Locked Moved Cache/Proxy
    5 Posts 3 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bkraegelin
      last edited by

      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:
      <tab>errorfile<tab><tab><tab><space>/var/haproxy_test/errorfile___

      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
      Birger</file>`</space></tab></tab></tab></tab></file></status_code></errorfile>

      1 Reply Last reply Reply Quote 0
      • B
        bkraegelin
        last edited by

        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…

        Birger

        1 Reply Last reply Reply Quote 0
        • B
          bkraegelin
          last edited by

          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.

          Birger

          1 Reply Last reply Reply Quote 0
          • P
            PiBa
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • R
              Roger-IoTX3
              last edited by

              I found that I had to delete the front end entry that had a logging setting, it fixed the error.

              A new question, how do you enable logging for HAPROXY within pfSense properly?

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.