This article provides a solution to the issue where you see an error The file can’t be deleted. Warning!unlink: No such file or directory error from the Commerce Admin when you do a JavaScript/CSS flush.
An error occurs when you do a JS/CSS flush:
The “/app/pub/static/_cache/merged/.nfsa42d0e64799fd1000000001b” file can’t 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’t be deleted. Warning!unlink(/app/var/tmp/analytics/tmp/.nfsb3b6041dd44588a0000850c0?lang=en): No such file or directory
Steps to reproduce:
Method 1:
Method 2:
If you are on Adobe 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.
Adobe Commerce on Cloud infrastructure: Upgrade Cloud Patches for Commerce to 1.0.22 which contains this fix: Cloud Patches for Commerce.
Adobe Commerce on-premises: Apply ACSD-50165 using Quality Patches Tools > Usage. The ACSD-50165 patch comes with QPT v1.1.30.