This article explains how to identify the cause of an error message that occurs when purging the cache in Adobe Commerce Admin. When you attempt to purge cache through the Admin you receive the following message: /app/project-id/pub/media/catalog/product/cache/directory/filename" file can't be deleted. Warning!unlink(/app/project id/pub/media/catalog/product/cache/directory/filename): No such file or directory
Affected products and versions
Adobe Commerce, all deployment types: 2.3.0-2.3.7, 2.4.0-2.4.2-p1
When you attempt to purge cache through the Adobe Commerce Admin you receive an error message.
- In Adobe Commerce Admin, go to System > Tools > Cache Management.
- Select any of the clear caching options.
You successfully flush Adobe Commerce cache with no errors.
You get the "file cannot be deleted" error.
The error is related to a delay between the time that the cache cleaning operation was initiated and when it was reported as completed.
- Confirm that the files mentioned in the error are not present on the server (checking that the cache purge was successful):
ls -la pub/media/catalog/product/cache/directory/filename
If you see the following output:
ls: cannot access 'pub/media/catalog/product/cache/directory/filename/': No such file or directory
there was an attempt to clear the files when the operation had already completed. This is not a bug; it is a messaging concurrency issue that is expected to happen sometimes. There is no issue to troubleshoot. However, if the output shows that the files are still in the cache you need to submit a support ticket.
- DevDocs Cache Management