Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    [Solved] HAProxy throws error on configuration change

    Scheduled Pinned Locked Moved Cache/Proxy
    5 Posts 3 Posters 3.3k Views 1 Watching
    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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
              Privacy Policy · Cookie Policy