-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CF push fails with "Error processing app files: remove <TEMP_FOLDER>\unzipped-app160441603\BOOT-INF\lib: The directory is not empty" #1223
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/150931625 The labels on this github issue will be updated when the story is started. |
Impressive how you tried to get to the bottom of the issue (and shared it with us). I am looking forward to more such bug reports! We occasionally receive similar issues and are in the process of rewriting the push command to not extract files anymore. We do still need to create one temporary file so I'll check with the team if we display a warning instead of fail with an error if that fails. |
Thanks @dkoper for the update. Moreover, i think this is more of the GoLang kernel issue with os.removeall package.. Attaching golang bug for reference: golang/go#20841 |
Is there some quick workaround for now? I'm running into this issue all the time with the latest release of the cli on Windows. |
Use an older version, if you're seeing it only with the latest? |
Hi All, Done uploading note: Tried with older versions of CLI too, but no success. Please suggest if this can be resolved. |
push +1 the issue is still occurring and is still a huge problem for our setup (deploying works only every ~7th time on a Windows machine) |
This is now resolved in cf CLI 6.34.0. Regards, |
Hi, Thanks, |
@tanhung3101 Sorry to hear that. Please open a new github issue providing all the details of your situation. |
Command
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
This is similar to when someone has opened the folder and from other windows someone tries to run
rmdir /s <folder>
. The issue doesn't popup always but sometimes (i.e intermittent), as part of the troubleshooting I happen to check on the CF CLI code at "https://github.com/cloudfoundry/cli/blob/master/cf/actors/push.go". The function "ProcessPath" doesn't do anything fancy, it just extracts all the files (jar) to a temp location defined by %TEMP% or %TMP% and then uploads to the foundation after which it removes the temp file using "os.removeAll" function (which is where the error is thrown).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
CC API Endpoint Version
v2 (2.94.0)
CF Trace
Not needed in this case.
Platform & Shell Details
Windows 8.1 64-bit with PowerShell
Any other relevant information
Here are some troubleshooting steps that I have taken
My initial thought was that something ( like antivirus ) is opening the file which is causing the "os.removeAll" to fail, since the machine was running McAfee antivirus, I created a folder under user home, excluded the scan on McAfee virus exclusion folder tab to that folder, changed the %TEMP% & %TMP% and ran cf push, but it didn't work and failed at the same point in removing the temp directory via
cf push
.Found some online document that there is a known issue with windows.
https://www.repairwin.com/fix-cannot-remove-folder-directory-is-not-empty-solved/
https://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/error-0x80070091-the-directory-is-not-empty-while/8c58e1d9-b6f2-4164-8fa6-19f35c09ea3d?auth=1
So as a test I wrote this simple script and started to loop multiple time
but still, no luck in reproducing the issue, treating this is not a windows issue seems more to be a cf CLI problem.
Checked on the folder permission and also ran rmdir (as command line) as soon as the cf failed, but os never had any issue in cleaning up the folder, again pointing to its only the cf that has an issue.
I turned on resmon.exe and started to find for the handlers that are currently locking the folder, to surprise its only cf.exe that has the file opened and no third party software had any handler to it, so I believe during deleting files which multiple folders there seems to be a race condition with multiple handlers started during "os.removeAll" or during "cf push" not sure from where...
Attached is the screenshot that I see on the resmon.exe, this was collected as soon as the cf push failed and refresh of the resmon.exe, as you can see cf.exe even though it failed and exited it still had a handler to those folders, seconds later it cleaned up the process and the lock was released.
Suggestion fix
The easiest fix to this issue would be instead of returning error
and error out the progress of push, it would be easier to just print a warning and continue as its anyways a temp file which would be cleaned up DiskCleanup later by the user, it should not be a cause of failure.
The text was updated successfully, but these errors were encountered: