When I try file caching, I am getting
warning: unlink(sites/MYSITE.TLD/files/cacherouter/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables) [function.unlink]: No such file or directory in /MYLINUXSITEPATH/sites/all/modules/cacherouter/engines/file.php on line 128.
Tried changing fast_cache to TRUE or FALSE - no help.
Tried also the current dev version (of February 2, 2009) - no help, except that error line number changes to 154.
Did all cache clearing, also deleting of the cache router caching directory. The above error is always present.
FYI - I have the Boost module running to cache anonymous requests. I wanted to use Cache Router in file mode for any other writing to cache to free up the database load, but did not manage and will have to wait for somebody's help here.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 514030_unlink.patch | 1.99 KB | andypost |
| #7 | cacherouter-rc1-fix-unlink-file-missing-v2.patch | 2.22 KB | harking |
| #5 | cacherouter-rc1-fix-unlink-file-missing.patch | 2.22 KB | harking |
Comments
Comment #1
doq commentedNeed more info. Can you please post your $conf['cacherouter'] settings?
Comment #2
vacilando commentedThanks for looking into this; I keep trying to use cacherouter on many sites, sometimes with minor warnings etc. but the file caching was totally unusable so far.
Don't hesitate to let me know if you need more info or testing.
Comment #3
slantview commentedSorry for the late reply. I was too busy to keep maintaining this for a while. Can you check the file permissions to see if you have the ability to write to the directory you configured for cache router files.
Thanks.
Comment #4
vacilando commentedStill a problem. I do have writing perms. Thousands other files are being written in the cache directory. Seems to happen only with cache files ending "--variables" (though this might be a red herring). (FYI I mentioned the same at #352953: fileCache::delete() passes in wrong argument type for fopen() and unlink() before realizing there was this thread as well.)
Comment #5
harking commentedHi vacilando,
We've just seen the same issue. It looks like similar problem in #581476: Filesize errors caused by unlink
In this case, the delete() method gets the file pointer by calling fopen(), then a file lock is placed on the file pointer, and then unlink is called on that file.
I think the problem is that between the file open and the file lock, the file is unlinked somewhere else in the application, thus when unlink is called with only the file name and not the pointer, it can not find it. Since flock is a blocking call, it is possible that another process has already unlinked the file.
I've attached a patch where file_exists($file->filename) is called before unlink($file->filename) to prevent this condition.
Comment #6
harking commentedComment #7
harking commentedFirst patch for the fix had syntax errors. New patch is clean.
Comment #8
vacilando commentedThe patch is broken because a closing bracket is missing from each of the conditions.
I've corrected that in my test file and so far I haven't seen any error like that. So far so good. Thanks, harking!
EDIT: We were writing at the same time. I meant that the 1st patch was broken. Thanks for posting the corrected one. Still no problems, the error has disappeared.
Comment #9
vacilando commentedPlease see also JirkaRybka's solution, which is a part of a larger patch solving other problems as well: #578522: File engine: Performance, filenames, and other cleanup. It works very well for me.
Comment #10
andypostSeems is much easy to use error control @
Lets focus on #578522: File engine: Performance, filenames, and other cleanup so marked as duplicate