Bug #54612 [Asn->Fbk]: FPM+chroot: random Error 404
| From: | fat@php.net | Date: | Tue, 05 Jul 2011 21:30:51 +0000 |
| Subject: | Bug #54612 [Asn->Fbk]: FPM+chroot: random Error 404 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-161614@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54612&edit=1
ID: 54612
Updated by: fat@php.net
Reported by: erno dot kovacs at freemail dot hu
Summary: FPM+chroot: random Error 404
-Status: Assigned
+Status: Feedback
Type: Bug
Package: FPM related
Operating System: Linux
PHP Version: 5.3.6
Assigned To: fat
Block user comment: N
Private report: N
New Comment:
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
can you please catch the content of the request made from your webserver
(lighthttpd or nginx) to FPM.
You can use the strace command you used but just add -s 1024 or something big in
order to ensure to see what FPM reads from the socket.
You can also use tcpdump
tcpdump -i any -s 0 -X dst port 9001
IMO the tcpdump option is the easier to implement.
Previous Comments:
------------------------------------------------------------------------
[2011-04-29 10:01:38] erno dot kovacs at freemail dot hu
Workarounds:
cgi.fix_pathinfo = 0
OR
using nginx and sending "correct" SCRIPT_FILENAME parameter
------------------------------------------------------------------------
[2011-04-27 16:37:36] erno dot kovacs at freemail dot hu
Description:
------------
Debian squeze:
# uname -a
Linux xxx 2.6.32-5-amd64 #1 SMP Mon Mar 7 21:35:22 UTC 2011 x86_64 GNU/Linux
Lighty 1.4.28 with fastcgi config lines:
fastcgi.server = ( ".php" =>
(
(
"host" => "127.0.0.1",
"port" => 9001
)
)
)
# ls -l /web/web/host/web/web/host
lrwxrwxrwx 1 root root 1 Apr 26 15:10 /web/web/host/web/web/host -> /
Docroot is:
/web/web/host/teszdomain.hu/pages
If I turn on chroot to /web/web/host in the fpm config, PHP starts dropping error 404 randomly:
Process 26491 attached - interrupt to quit
accept(0, {sa_family=AF_INET, sin_port=htons(57968), sin_addr=inet_addr("127.0.0.1")},
[16]) = 3
poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\1\0\1\0\10\0\0", 8) = 8
read(3, "\0\1\0\0\0\0\0\0", 8) = 8
read(3, "\1\4\0\1\3`\0\0", 8) = 8
read(3, "\17\17SERVER_SOFTWARElighttpd/1.4.28"..., 864) = 864
read(3, "\1\4\0\1\0\0\0\0", 8) = 8
lstat("/web/web/host/tesztdomain.hu/pages/x.php", {st_mode=S_IFREG|0644, st_size=102,
...}) = 0
lstat("/web/web/host/tesztdomain.hu/pages", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/web/web/host/tesztdomain.hu", {st_mode=S_IFDIR|0755, st_size=29, ...}) = 0
stat("/web/web/host/tesztdomain.hu/pages", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/web/web/host/tesztdomain.hu", {st_mode=S_IFDIR|0755, st_size=29, ...}) = 0
stat("/web/web/host", {st_mode=S_IFDIR|0111, st_size=4096, ...}) = 0
stat("/web/web", {st_mode=S_IFDIR|0755, st_size=17, ...}) = 0
stat("/web", {st_mode=S_IFDIR|0755, st_size=16, ...}) = 0
stat("", 0x7fffc3463110) = -1 ENOENT (No such file or directory)
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0
rt_sigaction(SIGPROF, {0x664e20, [PROF], SA_RESTORER|SA_RESTART, 0x7f04f9d7e1e0}, {0x664e20, [PROF],
SA_RESTORER|SA_RESTART, 0x7f04f9d7e1e0}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
write(3, "\1\6\0\1\0002\6\0Status: 404 Not Found\r\nC"..., 80) = 80
shutdown(3, 1 /* send */) = 0
recvfrom(3, "\1\5\0\1\0\0\0\0", 8, 0, NULL, NULL) = 8
recvfrom(3, "", 8, 0, NULL, NULL) = 0
close(3) = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
accept(0, ^C <unfinished ...>
Process 26491 detached
And sometimes it works just fine:
Process 26491 attached - interrupt to quit
accept(0, {sa_family=AF_INET, sin_port=htons(59088), sin_addr=inet_addr("127.0.0.1")},
[16]) = 3
poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\1\0\1\0\10\0\0", 8) = 8
read(3, "\0\1\0\0\0\0\0\0", 8) = 8
read(3, "\1\4\0\1\3`\0\0", 8) = 8
read(3, "\17\17SERVER_SOFTWARElighttpd/1.4.28"..., 864) = 864
read(3, "\1\4\0\1\0\0\0\0", 8) = 8
lstat("/web/web/host/tesztdomain.hu/pages/x.php", {st_mode=S_IFREG|0644, st_size=102,
...}) = 0
lstat("/web/web/host/tesztdomain.hu/pages", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/web/web/host/tesztdomain.hu", {st_mode=S_IFDIR|0755, st_size=29, ...}) = 0
lstat("/web/web/host", {st_mode=S_IFLNK|0777, st_size=1, ...}) = 0
readlink("/web/web/host", "/"..., 4096) = 1
stat("/web/web/host/tesztdomain.hu/pages/.user.ini", 0x7fffc3460aa0) = -1 ENOENT (No such
file or directory)
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0
rt_sigaction(SIGPROF, {0x664e20, [PROF], SA_RESTORER|SA_RESTART, 0x7f04f9d7e1e0}, {0x664e20, [PROF],
SA_RESTORER|SA_RESTART, 0x7f04f9d7e1e0}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
open("/tesztdomain.hu/pages/x.php", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=102, ...}) = 0
getcwd("/", 4095) = 2
chdir("/web/web/host/tesztdomain.hu/pages") = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={120, 0}}, NULL) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffc345e850) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(4, {st_mode=S_IFREG|0644, st_size=102, ...}) = 0
mmap(NULL, 134, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f04fd5cf000
fstat(4, {st_mode=S_IFREG|0644, st_size=102, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04fd5ce000
lseek(4, 0, SEEK_CUR) = 0
munmap(0x7f04fd5cf000, 102) = 0
close(4) = 0
munmap(0x7f04fd5ce000, 4096) = 0
uname({sys="Linux", node="xxx", ...}) = 0
write(3, "\1\6\0\1\37\370\0\0Content-type: text/html\r"..., 8192) = 8192
write(3,
"\1\6\0\1\37\370\0\0=\"v\">Off</td></tr>\n<tr><"...,
8192) = 8192
write(3, "\1\6\0\1\37\370\0\0<td class=\"e\">y2k_compli"..., 8192) = 8192
write(3, "\1\6\0\1\37\370\0\0 cellpadding=\"3\" width=\""..., 8192) = 8192
write(3, "\1\6\0\1\37\370\0\0d><td class=\"v\">100</td>"...,
8192) = 8192
chdir("/") = 0
write(3, "\1\6\0\1\30\353\5\0s=\"e\">_REQUEST[\"PHPSESSI"..., 6408) =
6408
shutdown(3, 1 /* send */) = 0
recvfrom(3, "\1\5\0\1\0\0\0\0", 8, 0, NULL, NULL) = 8
recvfrom(3, "", 8, 0, NULL, NULL) = 0
close(3) = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
accept(0, ^C <unfinished ...>
Note, I run PHP-FPM with the same chroot+symlink trick on other box and it works fine all the time.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54612&edit=1