tedious / Stash

The place to keep your cache.
http://www.stashphp.com
BSD 3-Clause "New" or "Revised" License
961 stars 133 forks source link

Random critical error #360

Closed rashidul0405 closed 7 years ago

rashidul0405 commented 7 years ago

This is the error we got time to time. No specific use case. For example, while editing article we got this time to time, but most of the time it works.

from log:

request.CRITICAL: Uncaught PHP Exception UnexpectedValueException: "RecursiveDirectoryIterator::construct(/volumes/friflyt/ezpublish5/ezpublish/cache/prod/stash/0fea6a13c52b4d47/25368f24b045ca84/c21f969b5f03d33d/43e04f8f136e7682/4a1c6be177996f9e/03934ae1c1c02ffc/c1ea7b5cb5837487/95f67f2e772f6043/59cd7b3222254010): failed to open dir: No such file or directory" at /volumes/friflyt/ezpublish5/vendor/tedivm/stash/src/Stash/Utilities.php line 144 {"exception":"[object] (UnexpectedValueException(code: 0): RecursiveDirectoryIterator::construct(/volumes/friflyt/ezpublish5/ezpublish/cache/prod/stash/0fea6a13c52b4d47/25368f24b045ca84/c21f969b5f03d33d/43e04f8f136e7682/4a1c6be177996f9e/03934ae1c1c02ffc/c1ea7b5cb5837487/95f67f2e772f6043/59cd7b3222254010): failed to open dir: No such file or directory at /volumes/friflyt/ezpublish5/vendor/tedivm/stash/src/Stash/Utilities.php:144)"} []

Environment:

Symfony.

Stash settings:

    caches:
        default:
            drivers:
                - FileSystem
            inMemory: true
            registerDoctrineAdapter: false
tedivm commented 7 years ago

This is due to a race condition where one request deletes the directory while another is also deleting it. It tends not to happen until a site gets busier, and honestly at that point you should really switch to the sqlite driver for local caching.

rashidul0405 commented 7 years ago

@tedivm Thank you very much for your answer. I assume so. I'm confirming that we've quite a busy site with lots of contents. Will test sqlite driver later on.