Epoll_ctl failed (17: File exists)

Hi,

when I run ‘/etc/init.d/nginx reload’ on Debian, I get the following
error message in /var/log/nginx/error.log and I have to restart nginx:

2010/04/08 03:07:23 [alert] 10719#0: epoll_ctl(1, 7) failed (17: File
exists)

$ nginx -V
nginx version: nginx/0.7.65
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf
–error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid
–lock-path=/var/lock/nginx.lock
–http-log-path=/var/log/nginx/access.log
–http-client-body-temp-path=/var/lib/nginx/body
–http-proxy-temp-path=/var/lib/nginx/proxy
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
–with-http_stub_status_module --with-http_flv_module
–with-http_ssl_module --with-http_dav_module
–with-http_gzip_static_module --with-http_realip_module --with-mail
–with-mail_ssl_module --with-ipv6 --with-http_geoip_module
–add-module=/tmp/buildd/nginx-0.7.65/modules/nginx-upstream-fair

$ cat /etc/nginx/nginx.conf
user www-data;
worker_processes 1;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
# multi_accept on;
}

http {
include /etc/nginx/mime.types;

access_log  /var/log/nginx/access.log;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;
tcp_nodelay        on;

gzip on;
gzip_static on;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_vary on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}

uname -a

Linux example.com 2.6.26-2-openvz-amd64 #1 SMP Thu Aug 6 01:50:56 UTC
2009 x86_64 GNU/Linux

mail {

[…]

Any ideas?

Regards,
Matthias-Christian

On Thu, Apr 08, 2010 at 03:17:09AM +0200, Matthias-Christian O. wrote:

configure arguments: --conf-path=/etc/nginx/nginx.conf
–add-module=/tmp/buildd/nginx-0.7.65/modules/nginx-upstream-fair
# multi_accept on;
#keepalive_timeout 0;
include /etc/nginx/conf.d/.conf;
include /etc/nginx/sites-enabled/
;
}

uname -a

Linux example.com 2.6.26-2-openvz-amd64 #1 SMP Thu Aug 6 01:50:56 UTC 2009 x86_64 GNU/Linux

mail {

[…]

This should read:

mail {

[…]

$ uname -a
Linux example.com 2.6.26-2-openvz-amd64 #1 SMP Thu Aug 6 01:50:56 UTC
2009 x86_64 GNU/Linux

Regards,
Matthias-Christian

Hi,

it took a while to find the bug, but the patch is trivial:

— src/core/ngx_cycle.c~ 2009-10-26 17:22:24.000000000 +0100
+++ src/core/ngx_cycle.c 2010-04-11 21:14:43.997932783 +0200
@@ -847,7 +847,7 @@
sin61 = (struct sockaddr_in6 *) sa1;
sin62 = (struct sockaddr_in6 *) sa2;

  •    if (sin61->sin6_port != sin61->sin6_port) {
    
  •    if (sin61->sin6_port != sin62->sin6_port) {
           return NGX_DECLINED;
       }
    

Without the patch reloading will fail, because nginx thinks the two IPv6
addresses are the same regardless of the port.

Regards,
Matthias-Christian

Hello!

On Sun, Apr 11, 2010 at 09:20:17PM +0200, Matthias-Christian O. wrote:

  •    if (sin61->sin6_port != sin61->sin6_port) {
    
  •    if (sin61->sin6_port != sin62->sin6_port) {
           return NGX_DECLINED;
       }
    

Without the patch reloading will fail, because nginx thinks the two IPv6
addresses are the same regardless of the port.

Good catch, thanks.

Maxim D.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs