CF push fails with "Error processing app files: remove <TEMP_FOLDER>\unzipped-app160441603\BOOT-INF\lib: The directory is not empty
Command
cf push
What occurred
When pushing a java app from a windows machine once in a while we are treated with error after the upload of file is complete
FAILED
Error processing app files: remove <FOLDER_TEMP>\unzipped-app160441603\BOOT-INF\lib: The directory is not empty
What you expected to occur
CF CLI should not fail since it can't clean up temp folder, as it's a minor issue to exit the push, it should ignore and continue with the remaining task.
CLI Version
cf version 6.35.2+88a03e995.2018-03-15
CC API Endpoint Version
v2 (2.75.0)
CF Trace
Platform & Shell Details
Windows 10 64-bit with cmd only
Any other relevant information
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/156363481
The labels on this github issue will be updated when the story is started.
@tanhung3101 By chance, are you running an Anti-Virus, if so, which one/version?
Also, are you seeing a similar Deprecation warning at the top of your push:
Deprecation warning: Route component attributes 'domain', 'domains', 'host', 'hosts' and 'no-hostname' are deprecated. Found: host.
Please see http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#deprecated for the currently supported syntax and other app manifest deprecations. This feature will be removed in the future.
If you are seeing the deprecation warning. Please update your manifest.yml to use the non-deprecated properties and that will allow you to push with the non-legacy version of push which has fixed the issue.
@XenoPhex : I'm using McAfee v5.0.5.658
And I do see the deprecation warning when pushing my app. So do you think the root cause is my manifest.yml file?
@tanhung3101 Sorry for the delayed response! Yes the issue is the manifest file contains deprecated fields and is falling back on the legacy version of push (aka the old crunchy code). The problem you're seeing is due to the old code making multiple copies of your app files into a TEMP directory and then your virus scanner wanting to scan these copies for safety reasons. Because of this scanning, when the CF CLI tries to delete them (post upload), the files are still open by the Antivirus and an error occurs.
If you remove all the deprecated fields, push will use the new (more performant and safe) version of the code which has a fix for the problem you're seeing. This version only creates a single ZIP file in your TEMP dir containing your app bits which is much quicker to scan/requires less work for your anti-virus. Additionally, if push can't delete the file, for whatever reason, it'll just display a warning instead of breaking push.
I'm going to close this issue as it's been solved for manifests containing non-deprecated fields. Feel free to continue asking questions/providing feedback. I'll try and stay on top of any replies to this thread. Sorry again for the delay!!
Marking as dupe of #1006.