Opened 2 years ago

Closed 17 months ago

#291 closed defect (duplicate)

Wrong path for same ??? file

Reported by: Steuf Owned by: moo
Priority: blocker Milestone: 3.0.2
Component: cacher Version: 2.0.1
Keywords: Cc:
Application: PHP Version: 5.4.8
Other Exts: SAPI: Irrelevant
Probability: Sometimes Blocked By:
Blocking:

Description

Hello,

On shared architecture I have a strange problem when Xcache is enabled. Sometimes I see it on logs :

include(/home/nfs/www/www.website1.com/httpdocs/footer.php): failed to open stream: Permission denied in /home/nfs/www/www.website2.com/httpdocs/index.php on line 13

I don't know why, but sometime "cache" for include is currupted and try to include file /home/nfs/www/www.website1.com/httpdocs/footer.php instead of /home/nfs/www/www.website2.com/httpdocs/footer.php

It's a really really big problem :/

This is on Debian whis Dotdeb package with files shared by NFS.

Change History (19)

comment:1 Changed 2 years ago by moo

please try 3.0.0

comment:2 Changed 2 years ago by Steuf

I have try version 3.0.0... But this version is very slower than version 2.0.1, page loading is 2 to 4X times slower with version 3.0.0 :/

comment:3 Changed 2 years ago by Steuf

So I have re-tested and today no performance issue with version 3.0.0. So I wait to see if version 3.0.0 have the same bug.

comment:4 Changed 2 years ago by Steuf

So

[07-Nov-2012 12:27:38 Europe/Paris?] PHP Warning: include_once(/home/nfs/www/www.website1.com/httpdocs/classes/../classes/MySQL.php): failed to open stream: Permission denied in /home/nfs/www/www.website2.com/httpdocs/classes/Db.php on line 17

Same problem with version 3.0.0 :/

comment:5 Changed 2 years ago by moo

did you ever have any problem with 1.x or 2.x?

comment:6 Changed 2 years ago by Steuf

Current architecture is recent, but the problem is found with version 2.* and 3.* I don't know for version 1.*

comment:7 Changed 2 years ago by Steuf

More information, /home/nfs/www/www.website1.com/httpdocs/classes/../classes/MySQL.php
and
/home/nfs/www/www.website2.com/httpdocs/classes/../classes/MySQL.php
are EXACTLY the same file.

I think this is for this reason that Xcache is confused (Hash collision ?) and serve the wrong file path. And this is generate fatal error on my architecture because all website is right isolated. I think this is for that that the problem is revealed on my servers.

comment:8 Changed 2 years ago by moo

  • Summary changed from Cache corruption on include to Wrong path for same ??? file

what do you mean by same file? are they different file with identical content or exactly same file on same nfs server side but mount separately?

comment:9 Changed 2 years ago by Steuf

Different file with same name and same content, the issue still appears in this case.

comment:10 Changed 2 years ago by moo

  • Status changed from new to assigned

different file (not hardlink) with same content, is designed to be taken care of and should be ok. there's something wrong with it because you still see this issue. still not enough clue to reproduce the problem anyway, yet it's "sometimes" reproduced in your case. this is the hard and important part

comment:11 Changed 2 years ago by Steuf

NFS mount (if it can help to reproduce) :

server.host:/ /home/nfs/ nfs4 rsize=32768,wsize=32768,hard,intr,async,noacl,nocto,noatime,tcp 0 1

And yes, no hardlink just the same script/framework/cms on different path. I would say it happens once in a hundred queries about...

This is server on Debian Squeeze with php 5.4 from http://www.dotdeb.org/ and same with compiled xcache 3.0.0 (And good job for this version :)).

comment:12 Changed 23 months ago by Steuf

Any news about that ? :/

comment:13 Changed 23 months ago by Steuf

So I think this is a zend bug :/

I have actived trace on xcache on file xc_cacher.c. When the bug appear I can see :

[25-nov.-2012 21:35:09.554734] WARNING: pid 8713, fpm_stdio_child_said(), line 166: [pool pool1] child 8849 said into stderr: "xc_cacher.c:2172: xc_compile_file: type=0 name=/home/nfs/www/www.pool2.com/httpdocs/footer.php"
[25-nov.-2012 21:35:09.555529] WARNING: pid 8713, fpm_stdio_child_said(), line 166: [pool pool1] child 8849 said into stderr: "xc_cacher.c:2188: failed to init key for /home/nfs/www/www.pool2.com/httpdocs/footer.php

FPM pool 1 try to get file from pool 2... Expected result :

[25-nov.-2012 21:35:09.554734] WARNING: pid 8713, fpm_stdio_child_said(), line 166: [pool pool1] child 8849 said into stderr: "xc_cacher.c:2172: xc_compile_file: type=0 name=/home/nfs/www/www.pool1.com/httpdocs/footer.php"
[25-nov.-2012 21:35:09.555529] WARNING: pid 8713, fpm_stdio_child_said(), line 166: [pool pool1] child 8849 said into stderr: "xc_cacher.c:2188: failed to init key for /home/nfs/www/www.pool1.com/httpdocs/footer.php

So I can see than function is an extention of zend_compile_file... And it would seem that it is the Zend engine that sends false values​​. You can confirm my observation ?

comment:14 Changed 22 months ago by Steuf

After testing without xcache is really a xcache bug. Please can you see for fix this bug... It's a really blocker problem.

comment:15 Changed 19 months ago by zerreissen

  • Cc chris.farmer@… added

Any update on this bug?

We're using XCache version 2.01, PHP 5.4.10, Redhat using a shared NFS environment and are seeing the same issue. We've tested with 3.00 and the issue is still present. It seems as though it's not using the full path to grab the file and instead relies on just the file name and so it tries to grab a file of the same name from a different site. I've x'd out any discriminating information in the error below, but I think it gets the point across:

PHP Fatal error: require_once(): Failed opening required '/mnt/stor9-xxx-xxxx/xxxxxx/xxxxxx/www.seanxxxxxxxx.com/web/content/wp-includes/pomo/streams.php' (include_path='.:/usr/share/pear:/usr/share/php') in /mnt/stor5-xxx-xxxx/xxxxxx/xxxxxx/blog.shrevxxxxxxxxxxxx.com/web/content/wp-includes/pomo/mo.php on line 11

The fatal error is obviously due to the fact that one site does not have permission to access files on the other site, but you can see that it is attempting to include a file on a completely different site.

This bug does not show up in PHP 5.3, only in PHP5.4. Disabling XCache rids of the issue. Unfortunately I have to shadow previous comments and say that it's not easily reproducible and it doesn't happen all the time, just enough to be of concern.

comment:16 Changed 19 months ago by zerreissen

  • Cc chris.farmer@… removed

comment:17 Changed 19 months ago by zerreissen

We're using XCache v1.3.2 in our PHP 5.3 environment (which does not have this issue present), so this is an additional variable...

comment:18 Changed 19 months ago by moo

please attach (or send me in private to phpxcache@…) the output of "List PHP" page of XCache admin "after" while the error is still happening, together with the error message about "require_once(): Failed opening required"

comment:19 Changed 17 months ago by moo

  • Milestone changed from undecided to 3.0.2
  • Resolution set to duplicate
  • Status changed from assigned to closed

duplicate as #296 which got fixed. reopen if this bug report in this ticket can still be reproduced with "fixed" version

Note: See TracTickets for help on using tickets.