You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A Stache file deleted while it is being traversed or read aborts the traversal or is rebuilt as an empty item #15902
A file deleted while the Stache is traversing or reading it either aborts the traversal or is rebuilt as a new, empty item.
When a content file is removed between the moment the Stache lists it and the moment it stats or reads it, the result is:
Traverser::traverse(): RuntimeException: SplFileInfo::getMTime(): stat failed for ..., aborting the whole traversal.
Store::paths(), Store::getItemFromModifiedPath(), BasicStore::getItem() and the three taxonomy-term equivalents: File::get() returns null for the vanished file and the item is built from no contents, so the Stache records a new, empty item for a file that no longer exists.
Present on 6.40.0 and on current 6.x (9d20aef), where the traverser has no guard around getMTime(), and the stores pass File::get()'s result straight to makeItemFromFile().
Expected: a file that is confirmed gone is skipped. A real permission or IO error still throws.
How to reproduce
Let the Stache list a content directory.
Delete one of the listed files before the Stache stats or reads it (a test can do this by removing the file between the listing and the getMTime() call).
Observe the RuntimeException from Traverser::traverse(), or a new empty item for the deleted file from the stores listed above.
Regression tests for each case are in the pull request that follows.
Logs
RuntimeException: SplFileInfo::getMTime(): stat failed for ...
Environment
Statamic: 6.40.0 (also current 6.x, 9d20aef)
Found by reading the package source and reproducing it in the package's own test suite, not on a running site, so the full php please support:details output is not available.
Installation
Other (please explain): reproduced in the statamic/cms test suite.
Additional details
A fix that skips a file only when a fresh scandir() of its directory confirms it is gone is in the pull request that follows, with regression tests.
In the future, please open issues using our issue template. Issues created without them aren't categorised correctly and may be missing crucial details useful in closing the issue.
Activity
duncanmcclean commentedon Nov 14, 2026
In the future, please open issues using our issue template. Issues created without them aren't categorised correctly and may be missing crucial details useful in closing the issue.
statamic/cmsrelease carries its fix UAMS-Web/patches-statamic-cms#2statamic/cmsrelease carries their fix UAMS-Web/patches-statamic-cms#3