Hi All,
Has anyone been able to confirm this bug and the patch? I wanted to
confirm I had not missed any potential issues elsewhere?

Thank you,

Ben

On 4 September 2015 at 13:50, Ben Cabot <[email protected]> wrote:
> We have been seeing the following error when trying to use the
> external-check command option.
>
> [ALERT] 246/120705 (25012) : parsing [/etc/haproxy/haproxy.cfg:31] :
> 'external-check' cannot handle unexpected argument
> '/var/lib/loadbalancer.org/check/http_ntlm_proxy_check.sh'.
> [ALERT] 246/120705 (25012) : Error(s) found in configuration file :
> /etc/haproxy/haproxy.cfg
> [ALERT] 246/120705 (25012) : Proxy 'VIP_Name' : 'option
> external-check' unable to find required 'external-check command'.
> [ALERT] 246/120705 (25012) : Fatal errors found in configuration.
>
> Also the same "cannot handle unexpected argument" error occurs for
> "external-check path".
>
> I have tried with the latest build haproxy-ss-20150904 and can
> reproduce the problem. I believe it is because it is checking for an
> invalid number of arguments but may be completely wrong.
>
> Here is my suggested fix.
>
> --- src/cfgparse.org 2015-09-04 13:26:36.070579303 +0100
> +++ src/cfgparse.c 2015-09-04 13:36:31.194587549 +0100
> @@ -3349,9 +3349,9 @@
>                  }
>
>   if (!strcmp(args[1], "command")) {
> - if (alertif_too_many_args(1, file, linenum, args, &err_code))
> + if (alertif_too_many_args(2, file, linenum, args, &err_code))
>   goto out;
> - if (*(args[1]) == 0) {
> + if (*(args[2]) == 0) {
>   Alert("parsing [%s:%d] : missing argument after '%s'.\n",
>        file, linenum, args[1]);
>   err_code |= ERR_ALERT | ERR_FATAL;
> @@ -3361,9 +3361,9 @@
>   curproxy->check_command = strdup(args[2]);
>   }
>   else if (!strcmp(args[1], "path")) {
> - if (alertif_too_many_args(1, file, linenum, args, &err_code))
> + if (alertif_too_many_args(2, file, linenum, args, &err_code))
>   goto out;
> - if (*(args[1]) == 0) {
> + if (*(args[2]) == 0) {
>   Alert("parsing [%s:%d] : missing argument after '%s'.\n",
>        file, linenum, args[1]);
>   err_code |= ERR_ALERT | ERR_FATAL;
>
>
>
> Test config:
> global
>         daemon
>         stats socket /var/run/haproxy.stat mode 600 level admin
>         pidfile /var/run/haproxy.pid
>         log /dev/log local4
>         maxconn 40000
>         tune.bufsize 16384
>         tune.maxrewrite 1024
>         external-check
>
> defaults
>         mode http
>         balance roundrobin
>         timeout connect 4000
>         timeout client 42000
>         timeout server 43000
>         log global
>
> peers loadbalancer_replication
>         peer lbmaster localhost:7778
>         peer lbslave localhost:7778
>
> listen VIP_Name
>         bind 192.168.63.122:80 transparent
>         mode http
>         balance leastconn
>         cookie SERVERID insert nocache indirect
>         server backup 127.0.0.1:9081 backup  non-stick
>         option external-check
>         external-check command
> /var/lib/loadbalancer.org/check/http_ntlm_proxy_check.sh
>         option accept-invalid-http-request
>         option http-keep-alive
>         option forwardfor
>         option redispatch
>         option abortonclose
>         maxconn 40000
>         option httplog
>         server RIP_Name 192.168.63.100  weight 100  cookie RIP_Name
> check  inter 4000  rise 2  fall 2  minconn 0  maxconn 0
> on-marked-down shutdown-sessions
>
> thanks,
>
> Ben
>
> --
> LOADBALANCER.ORG LTD.
> www.loadbalancer.org
> [email protected]



-- 
LOADBALANCER.ORG LTD.
www.loadbalancer.org
[email protected]

Reply via email to