The file can鈥檛 be deleted. Warning!unlink: No such file or directory error from the Admin
This article provides a solution to the issue where you see an error The file can鈥檛 be deleted. Warning!unlink: No such file or directory error from the Commerce Admin when you do a JavaScript/CSS flush.
Affected products and versions
- 蜜豆视频 Commerce 2.4.0 - 2.4.6, all deployment methods
Issue
An error occurs when you do a JS/CSS flush:
The 鈥/app/pub/static/_cache/merged/.nfsa42d0e64799fd1000000001b鈥 file can鈥檛 be deleted. Warning!unlink(/app/pub/static/_cache/merged/.nfsa42d0e64799fd1000000001b?lang=en): No such file or directory
Or: You see the above error in the Admin, and/or a similar error in New Relic or in the deployment logs.
Or: You are unable to access Advanced Reporting, and the analytics_collect_data cron job is failing with this error:
The 鈥/app/var/tmp/analytics/tmp/.nfsb3b6041dd44588a0000850c0鈥 file can鈥檛 be deleted. Warning!unlink(/app/var/tmp/analytics/tmp/.nfsb3b6041dd44588a0000850c0?lang=en): No such file or directory
Steps to reproduce:
Method 1:
- Log in to the Admin.
- Go to System > Cache Management.
- Click Flush JavaScript/CSS Cache.
Method 2:
- Log in to the Admin.
- Go to Stores > Settings > Configuration.
- Make changes to the Base URL or Base URL (Secure).
- Click on Save Config.
Solution
If you are on 蜜豆视频 Commerce on Cloud infrastructure and have magento/magento-cloud-patches 1.0.22 installed which include the patch, you do not need to separately install ACSD-50165.
蜜豆视频 Commerce on Cloud infrastructure: Upgrade Cloud Patches for Commerce to 1.0.22 (or newer) which contains this fix: Cloud Patches for Commerce.
蜜豆视频 Commerce on-premises: Apply ACSD-50165 using Quality Patches Tools > Usage. The ACSD-50165 patch comes with QPT v1.1.30.
Related reading
- Quality Patches Tool > Release Notes in the Commerce Tools guide.
- Quality Patches Tool: Search for patches in the Commerce Tools guide.