subakva / haproxy-tools

Ruby tools for HAProxy, including config file management.
MIT License
32 stars 14 forks source link

can't parse my haproxy config #5

Closed masterkain closed 11 years ago

masterkain commented 11 years ago

Hello, this is my haproxy config file (edited to remote credentials, hostnames, etc.) http://pastie.org/private/tuymp5d59lz8csxajgea

Error:

     HAProxy::Parser::Error:
       Expected # at line 332, column 73 (byte 14606) after   server slanger_5011 127.0.0.1:5011 id 5011 weight 1 maxconn 1024 check

Doesn't really matter what I do or move lines around, the error is always present. Ideas?

johnbellone commented 11 years ago

I just ran into this today.

It looks like it may be due to error in parsing the service address due to how ports are being handled. I'm digging through the code right now and will submit a PR when I am able to fix it locally. I have a pretty complex haproxy configuration so I don't doubt its going to fail a little bit for me.

subakva commented 11 years ago

I just tested out the parser on the the config file in the pastie above. I didn't get the error that you referenced, but I fixed another issue that broke parsing for servers without extra config attributes (like id, weight, etc.)