Welcome! Log In Create A New Profile

Advanced

minor bug in cfgparse when stats is misconfigured

Posted by Lukas Tribus 
Lukas Tribus
minor bug in cfgparse when stats is misconfigured
December 05, 2017 12:40AM
Hello,


as reported by Martin Brauer:
https://discourse.haproxy.org/t/config-frontend-global-has-no-bind-directive/1858

If we configure "stats timeout", but no corresponding socket, haproxy
emits a bogus warning at startup about the "frontend GLOBAL" not
having a bind directive:

global
#stats socket run/admin.sock mode 660 level admin
stats timeout 30s


[WARNING] 334/150131 (23086) : config : frontend ‘GLOBAL’ has no
‘bind’ directive. Please declare it as a backend if this was intended.


This behavior can be seen since we enabled this warning in f3934b8c
("MEDIUM: config: emit a warning on a frontend without listener").
Not sure about the root cause here ...


Regards,
Lukas
Willy Tarreau
Re: minor bug in cfgparse when stats is misconfigured
December 05, 2017 07:00AM
Hi Lukas,

On Tue, Dec 05, 2017 at 12:30:17AM +0100, Lukas Tribus wrote:
> Hello,
>
>
> as reported by Martin Brauer:
> https://discourse.haproxy.org/t/config-frontend-global-has-no-bind-directive/1858
>
> If we configure "stats timeout", but no corresponding socket, haproxy
> emits a bogus warning at startup about the "frontend GLOBAL" not
> having a bind directive:
>
> global
> #stats socket run/admin.sock mode 660 level admin
> stats timeout 30s
>
>
> [WARNING] 334/150131 (23086) : config : frontend 'GLOBAL' has no
> 'bind' directive. Please declare it as a backend if this was intended.
>
>
> This behavior can be seen since we enabled this warning in f3934b8c
> ("MEDIUM: config: emit a warning on a frontend without listener").
> Not sure about the root cause here ...

Interesting corner case. I see what's happening. Any "stats" directive
in the global section creates the frontend if it doesn't exist, so that
the timeout can be stored. And "stats socket" creates the listeners,
hence the similar syntax with "bind" directives. I'll check how the
patch above works, but most likely the most efficient solution will
consist in ensuring we ignore this for the global frontend. I'm just
a bit surprized as I didn't remember that this frontend was present
in the global list, but that might also explain why we have this side
effect ;-)

Thanks,
Willy
Sorry, only registered users may post in this forum.

Click here to login