Re: UDP Connection refused

2020-03-20 Пенетрантность inkognito0609
Спасибо за ссылку. Многое прояснило.
Да, проблема нашлась на стороне получателя.

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?21,287308,287395#msg-287395

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: UDP Connection refused

2020-03-12 Пенетрантность Maxim Dounin
Hello!

On Thu, Mar 12, 2020 at 02:32:23AM -0400, inkognito0609 wrote:

> При отправке логов через syslog (udp) проскакивают ошибки 111 Connection
> refused, что непонятно при отправке логов по udp, так как этот протокол не
> подразумевает установки соединения в принципе.
> 
> strace дает следующее:
> 30752 sendto(64, "<190>Mar 12 09:45:59 balancer nginx: { \"timestamp\":
> \"2020-03-12T09:45:59+05:00\", \"remote_addr\": \"91.144.134.5\",
> \"body_bytes_sent\": 18686, \"request_time\": 0.000, \"response_status\":
> 200, \"request\": \"GET /themes/default/images/flags.png HTTP/1.0\",
> \"request_method\": \"GET\", \"host\":
> \"chel.wifi.example.ru\",\"upstream_cache_status\":
> \"HIT\",\"upstream_addr\": \"\",\"http_x_forwarded_for\":
> \"10.12.199.134\",\"http_referrer\":
> \"https://chel.wifi.domru.ru/index.php?request_uri=http://captive.apple.com/hotspot-detect.html\;,
> \"upstream_response_time\": \"\",\"upstream_header_time\":
> \"\",\"upstream_connect_time\": \"\",\"http_user_agent\": \"Mozilla/5.0
> (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like
> Gecko)\",\"x-project\": \"\",\"cluster\": \"1\",\"container_id\":
> \"\",\"citydomain\": \"\" }", 765, 0, NULL, 0) = -1 ECONNREFUSED (Connection
> refused)

Да, так бывает.

Цитируя "Programming UNIX Sockets in C - Frequently Asked 
Questions", AKA Socket FAQ 
(http://web.deu.edu.tr/doc/soket/#faq57):

: If the target machine discards the message because there is no 
: process reading on the requested port number, it sends an ICMP 
: message to your machine which will cause the next system call on 
: the socket to return ECONNREFUSED. Since delivery of ICMP messages 
: is not guarenteed you may not recieve this notification on the 
: first transaction.

То есть ошибка ожидаема, и она означает, что на предыдущее 
сообщение в syslog прилетело ICMP-сообщение в ответ.

Если вы не в курсе, что у вас часть UDP-сообщений где-то 
реджектится - это повод разобраться, где и почему.  Если в курсе - 
это лишнее напоминание, что оно так.

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: UDP Connection refused

2020-03-12 Пенетрантность Evgeniy Berdnikov
On Thu, Mar 12, 2020 at 02:32:23AM -0400, inkognito0609 wrote:
> При отправке логов через syslog (udp) проскакивают ошибки 111 Connection
> refused, что непонятно при отправке логов по udp, так как этот протокол не
> подразумевает установки соединения в принципе.

 Читайте man 7 udp. ECONNREFUSED может быть вызвана отображением
 на уровень сокетов ответов icmp[port-unreach], icmp[admin-prohib]
 на предыдущие пакеты от этого сокета, а также блокировкой исходящих udp
 локальным пакетным фильтром. Конкретика зависит от реализации
 (может отличаться для разных ОС). К nginx это отношения не имеет.
-- 
 Eugene Berdnikov
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

UDP Connection refused

2020-03-12 Пенетрантность inkognito0609
При отправке логов через syslog (udp) проскакивают ошибки 111 Connection
refused, что непонятно при отправке логов по udp, так как этот протокол не
подразумевает установки соединения в принципе.

strace дает следующее:
30752 sendto(64, "<190>Mar 12 09:45:59 balancer nginx: { \"timestamp\":
\"2020-03-12T09:45:59+05:00\", \"remote_addr\": \"91.144.134.5\",
\"body_bytes_sent\": 18686, \"request_time\": 0.000, \"response_status\":
200, \"request\": \"GET /themes/default/images/flags.png HTTP/1.0\",
\"request_method\": \"GET\", \"host\":
\"chel.wifi.example.ru\",\"upstream_cache_status\":
\"HIT\",\"upstream_addr\": \"\",\"http_x_forwarded_for\":
\"10.12.199.134\",\"http_referrer\":
\"https://chel.wifi.domru.ru/index.php?request_uri=http://captive.apple.com/hotspot-detect.html\;,
\"upstream_response_time\": \"\",\"upstream_header_time\":
\"\",\"upstream_connect_time\": \"\",\"http_user_agent\": \"Mozilla/5.0
(Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like
Gecko)\",\"x-project\": \"\",\"cluster\": \"1\",\"container_id\":
\"\",\"citydomain\": \"\" }", 765, 0, NULL, 0) = -1 ECONNREFUSED (Connection
refused)

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?21,287308,287308#msg-287308

___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru