I'm getting very occasional errors like the one shown below. I can't see any reason why it's happening; a simple page reload and the error goes away. It feels like there might be a race condition occurring or something like that.

Any ideas? Anyone else seen anything like it?

Warning: file_get_contents(/home/kalaam/wurfl/cache/FILE_PERSISTENCE_PROVIDER/4b820b83c8565a66b9435f8a6b283251) [function.file-get-contents]: failed to open stream: No such file or directory in /home/kalaam/wurfl/wurfl-php-1.r2/WURFL/FileManager.php on line 52

Warning: unlink(/home/kalaam/wurfl/cache/FILE_PERSISTENCE_PROVIDER/4b820b83c8565a66b9435f8a6b283251) [function.unlink]: No such file or directory in /home/kalaam/wurfl/wurfl-php-1.r2/WURFL/FileManager.php on line 58

Warning: Cannot modify header information - headers already sent by (output started at /home/kalaam/wurfl/wurfl-php-1.r2/WURFL/FileManager.php:52) in /home/kalaam/www.kalaam.org/includes/bootstrap.inc on line 709

Warning: Cannot modify header information - headers already sent by (output started at /home/kalaam/wurfl/wurfl-php-1.r2/WURFL/FileManager.php:52) in /home/kalaam/www.kalaam.org/includes/bootstrap.inc on line 710

Warning: Cannot modify header information - headers already sent by (output started at /home/kalaam/wurfl/wurfl-php-1.r2/WURFL/FileManager.php:52) in /home/kalaam/www.kalaam.org/includes/bootstrap.inc on line 711

Warning: Cannot modify header information - headers already sent by (output started at /home/kalaam/wurfl/wurfl-php-1.r2/WURFL/FileManager.php:52) in /home/kalaam/www.kalaam.org/includes/bootstrap.inc on line 712

Comments

twom’s picture

Status: Active » Needs review

Hi,

There is a big update of the module. No specific changes are made to fix the error you are talking about, but mayb the new PHP api has several improvements.

Let me know if this error still occurs.

martin_q’s picture

Unfortunately, with the new module and API I'm getting very similar errors... the only difference being that the error now says:

warning: fopen(/home/kalaam/wurfl/cache/FILE_CACHE_PROVIDER/63a9408c300aed867249487ddf4d84db [function.fopen]: failed to open stream: No such file or directory in /home/kalaam/wurfl/wurfl-php-1.1/WURFL/FileManager.php on line 76

Since the line concerned is involved with opening a file to write into, and the directory path does exist, I can't work out why it's not possible for fopen to work.

twom’s picture

Hi,

I have this error to on my local system, but not on production servers where I am using it...
No solution so far.

It is as if WURFL tries to get session information related to the current mobile device, but it never saved that information...

martin_q’s picture

My systems admin suggests the following:

FileManager.php makes an exclusive lock on the file when it opens it.
So the only reason I can see that an open/create would fail, would be
because the filename already exists and was locked. Given that, here's
a couple of options:

The filename is an md5 sum. Perhaps we're getting collisions. There's
over 13000 files in the 'FILE_PERSISTENCE_PROVIDER' folder, so it's not
impossible that we're getting md5 collisions on the filename.

Perhaps "mtime" on vservers isn't 'fine' enough. Maybe it only does
seconds, rather than milliseconds. I can look into that. Since the
filename is an md5 sum of the last access time, if the mtime is only
accurate to 1 second (or something like that) we could definitely get
identical mtimes.

I'll poke around a bit more, but that's all I can see at the moment.

Do you think he's onto something?

twom’s picture

Hi,

I think that this could indeed be one of the problems.

It could be good to circulate this question on the http://tech.groups.yahoo.com/group/wmlprogramming/mailinglist.

My main remark on the above comment is that I experience this problem from time to time on my local machine... And since I do not generate a lot of traffic locally, the '1 sec time granularity' should not be a problem... My page requests are much more spread out then the 1 second.

However the locking issue seems interesting to look at.