Opened 8 years ago

Closed 8 years ago

#855 closed defect (fixed)

Invalid detection of unix sockets in configuration files

Reported by: bartosz.wojcik.pl@… Owned by:
Priority: blocker Milestone:
Component: nginx-core Version: 1.9.x
Keywords: configuration, unix, sockets, parser Cc: mdounin@…
uname -a: Linux bartoszwojcik.com 4.1.5-x86_64-linode61 #7 SMP Mon Aug 24 13:46:31 EDT 2015 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.9.8

Description

I don't want to be an asshole, but I've just upgraded my server with
this latest Debian package

nginx -v
nginx version: nginx/1.9.8

and all of my websites are down.

I've just upgraded nginx (everything else is latest for Debian Jessie)

My logs are filled with:

2015/12/08 23:53:25 [error] 5582#5582: *559 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xx.220.5.234, server: devstart.pl, request: "GET /profile/624-hubot/?do=content&type=calendar_event&sortby=calendar_events.e$
2015/12/08 23:53:26 [error] 5582#5582: *561 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.113.153.218, server: devstart.pl, request: "GET /feed/ HTTP/1.1", host: "www.devstart.pl"
2015/12/08 23:53:27 [error] 5582#5582: *563 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.113.153.218, server: devstart.pl, request: "GET /pytania/feed/ HTTP/1.1", host: "www.devstart.pl"
2015/12/08 23:53:27 [error] 5582#5582: *564 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.220.5.234, server: devstart.pl, request: "GET /profile/624-hubot/?do=content&type=calendar_event&sortby=calendar_events.e$
2015/12/08 23:53:29 [error] 5582#5582: *565 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.220.5.234, server: devstart.pl, request: "GET /profile/624-hubot/?do=content&type=calendar_event&sortby=calendar_events.e$
2015/12/08 23:53:31 [error] 5582#5582: *566 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.220.5.234, server: devstart.pl, request: "GET /profile/624-hubot/?do=content&type=calendar_event&sortby=calendar_events.e$
2015/12/08 23:53:32 [error] 5582#5582: *568 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.249.78.31, server: devstart.pl, request: "GET /temat/174-instalacja-libgdx/ HTTP/1.1", host: "devstart.pl"
2015/12/08 23:53:33 [error] 5582#5582: *569 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.220.5.234, server: devstart.pl, request: "GET /profile/624-hubot/?do=content&type=calendar_event&sortby=calendar_events.e$
2015/12/08 23:53:35 [error] 5582#5582: *570 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xxx.220.5.234, server: devstart.pl, request: "GET /profile/624-hubot/?do=content&type=cms_records1&sortby=cms_custom_database$
2015/12/08 23:53:36 [error] 5582#5582: *571 no port in upstream "unix:/var/run/php5-fpm.devstart.sock", client: xx.220.5.234, server: devstart.

Unix sockets are available at the exact locations, no configuration
files were modified.

It seems like latest nginx cannot properly handle unix socket
configuration entry and looks for the the port number even if the
listening entry is unix socket.

My php configs were the same all the time

location ~ \.php$ {

include fastcgi_params;

try_files $uri =404;
fastcgi_split_path_info (.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.$user.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

(I specify $user to handle different users)

I dunno if that helps you, but I cannot downgrade to anything above 1.8 (and it cannot handle http2). I'm stuck here...

Attachments (1)

p (930 bytes ) - added by Ruslan Ermilov 8 years ago.
patch

Download all attachments as: .zip

Change History (8)

comment:1 by bartosz.wojcik.pl@…, 8 years ago

The only rescue was to find the package file directly on the site, download it and downgrade manually

wget http://nginx.org/packages/mainline/debian/pool/nginx/n/nginx/nginx_1.9.7-1~jessie_amd64.deb

dpkg -i nginx_1.9.7-1~jessie_amd64.deb

and now it works fine, so I guess the main problem is the parsing of unix sockets from the configuration files.

comment:2 by bartosz.wojcik.pl@…, 8 years ago

I've digged a while in your GitHub mirror and I guess, the problem has something to do with this change

https://github.com/nginx/nginx/commit/72b9a317d2983b3127b8cce21236af8409ff732a

just a clue.

comment:3 by Jorrit, 8 years ago

Same here. In hindsight it would also be great if the Ubuntu repository would contain more patch releases than just the latest so I can downgrade easily. I once had a similar issue with rethinkdb and their repository contained many versions, so it was easy to go back.

comment:4 by Andrei Belov, 8 years ago

We've just updated Ubuntu/Debian repository indexes to include previous packages as well.

comment:5 by vl, 8 years ago

Status: newaccepted

by Ruslan Ermilov, 8 years ago

Attachment: p added

patch

comment:6 by Ruslan Ermilov <ru@…>, 8 years ago

In 6326:705c356ce664/nginx:

Fixed fastcgi_pass with UNIX socket and variables (ticket #855).

This was broken in a93345ee8f52 (1.9.8).

comment:7 by Maxim Dounin, 8 years ago

Resolution: fixed
Status: acceptedclosed

Fix committed and available in nginx 1.9.9.

Note: See TracTickets for help on using tickets.