Re: Problem with BOM in healthcheck-file?

2017-07-20 Thread Lukas Tribus
Hello,


Am 20.07.2017 um 17:28 schrieb rai...@ultra-secure.de:
>
>
>> od -c bomfile.
>
>
> 000 377 376   s  \0   e  \0   r  \0   v  \0   e  \0   r  \0   _  \0
> 020   u  \0   p  \0  \r  \0  \n  \0
> 030
>

Obviously haproxy can't match this. Not only because of the BOM, but
also because it really is UTF-16-le (note \0 after each character).

"http-check expect string" matches an exact ASCII string.


I'm unable to reproduce the hang in freebsd 10.1/amd64.
Does it reliably hang in your setup?
When it hangs, do you see high CPU usage in haproxy or the system?



Regards,
Lukas




Re: Problem with BOM in healthcheck-file?

2017-07-20 Thread rainer

Am 2017-07-20 14:18, schrieb Jarno Huuskonen:



Can you share how you've configured health checks in haproxy.cfg ?


backend site-back
  balance roundrobin
  mode http
  option httpchk GET /healthcheck.htm HTTP/1.1\r\nHost:\ 
site.com\r\nConnection:\ close

  http-check expect string server_up
  http-check disable-on-404
  cookie SERVERID insert indirect nocache
  server SERVER1 ip1:80 check  maxconn 3000 cookie s1
  server SERVER2 ip2:80 check  maxconn 3000 cookie s2



And can you show curl -v output of the BOM response and


(lb2-beeline-prod ) 0 # curl -v -H "Host: site.com" 
http://ip1:80//Healthcheck_broken.htm

*   Trying ip1...
* TCP_NODELAY set
* Connected to ip1 (ip1) port 80 (#0)

GET //Healthcheck_broken.htm HTTP/1.1
Host: site.com
User-Agent: curl/7.50.3
Accept: */*


< HTTP/1.1 200 OK
< Content-Type: text/html
< Last-Modified: Thu, 20 Jul 2017 15:18:51 GMT
< Accept-Ranges: bytes
< ETag: "4d832b7e6b1d31:0"
< Server: Microsoft-IIS/8.5
< Date: Thu, 20 Jul 2017 15:27:08 GMT
< Content-Length: 24
<
��server_up
* Curl_http_done: called premature == 0
* Connection #0 to host ip1 left intact



od -c bomfile.



000 377 376   s  \0   e  \0   r  \0   v  \0   e  \0   r  \0   _  \0
020   u  \0   p  \0  \r  \0  \n  \0
030






Re: Problem with BOM in healthcheck-file?

2017-07-20 Thread Jarno Huuskonen
Hi,

On Thu, Jul 20, rai...@ultra-secure.de wrote:
> I had a very strange situation earlier.
> 
> He have a site behind a haproxy/nginx combination, it has been
> working for years.
> (It's Windows).
> 
> However, suddenly I get L7 timeouts.
> 
> But curl to the healthcheck URL works perfectly.
> 
> The output I get looks like this:
> 
> ��server_up
> 
> Piping curl through cat -v looks like this:
> 
> M-^?M-~s^@e^@r^@v^@e^@r^@_^@u^@p^@^M^@
> ^@
> 
> They have started to generate this file via a powershell script and
> it has inserted a byte-order-mark into the file (BOM).
> Took a while to figure this out ;-)
> 
> haproxy 1.6.9 (FreeBSD 10-amd64) seems to actually choke on these
> files and hang - I had to kill -9 it.
> 
> After replacing the file with its previous, ASCII-only copy,
> everything started to work again.
> 
> Can anyone reproduce this?

Can you share how you've configured health checks in haproxy.cfg ?

And can you show curl -v output of the BOM response and
od -c bomfile.

> Maybe it's fixed in later versions?

(AFAIK 1.6.13 has some freebsd related fixes
(http://www.haproxy.org/download/1.6/src/CHANGELOG)).
(https://www.mail-archive.com/haproxy@formilux.org/msg25807.html)

-- 
Jarno Huuskonen



Problem with BOM in healthcheck-file?

2017-07-20 Thread rainer

Hi,

I had a very strange situation earlier.

He have a site behind a haproxy/nginx combination, it has been working 
for years.

(It's Windows).

However, suddenly I get L7 timeouts.

But curl to the healthcheck URL works perfectly.

The output I get looks like this:

��server_up

Piping curl through cat -v looks like this:

M-^?M-~s^@e^@r^@v^@e^@r^@_^@u^@p^@^M^@
^@

They have started to generate this file via a powershell script and it 
has inserted a byte-order-mark into the file (BOM).

Took a while to figure this out ;-)

haproxy 1.6.9 (FreeBSD 10-amd64) seems to actually choke on these files 
and hang - I had to kill -9 it.


After replacing the file with its previous, ASCII-only copy, everything 
started to work again.


Can anyone reproduce this?

Maybe it's fixed in later versions?



Regards
Rainer