Skip to content
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

Windows update failed: The directory is not empty #47804

Closed
Ashu131 opened this issue Apr 13, 2018 · 12 comments
Closed

Windows update failed: The directory is not empty #47804

Ashu131 opened this issue Apr 13, 2018 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@Ashu131
Copy link

Ashu131 commented Apr 13, 2018

  • VSCode Version: 1.22.2
  • OS Version: Windows 7 Ultimate
    When I tried to update my vscode today. Update process throws an error, log file and uninstalled from my system.

vscode-inno-updater.log

Apr 13 10:45:37.416 INFO Starting: C:\Program Files\Microsoft VS Code\Code.exe, false
Apr 13 10:45:37.444 INFO Checking for running Code.exe processes... (attempt 1)
Apr 13 10:45:37.445 INFO Code.exe is running, wait a bit
Apr 13 10:45:37.934 INFO Checking for running Code.exe processes... (attempt 2)
Apr 13 10:45:37.934 INFO Code.exe is running, wait a bit
Apr 13 10:45:38.434 INFO Checking for running Code.exe processes... (attempt 3)
Apr 13 10:45:38.434 INFO Code.exe is running, wait a bit
Apr 13 10:45:38.934 INFO Checking for running Code.exe processes... (attempt 4)
Apr 13 10:45:38.934 INFO Code.exe is running, wait a bit
Apr 13 10:45:39.434 INFO Checking for running Code.exe processes... (attempt 5)
Apr 13 10:45:39.434 INFO Code.exe is running, wait a bit
Apr 13 10:45:39.934 INFO Checking for running Code.exe processes... (attempt 6)
Apr 13 10:45:39.934 INFO Code.exe is running, wait a bit
Apr 13 10:45:40.434 INFO Checking for running Code.exe processes... (attempt 7)
Apr 13 10:45:40.434 INFO Code.exe is running, wait a bit
Apr 13 10:45:40.946 INFO Checking for running Code.exe processes... (attempt 8)
Apr 13 10:45:40.946 INFO Code.exe is not running
Apr 13 10:45:40.946 INFO Starting update, silent = false
Apr 13 10:45:41.265 INFO do_update: "C:\\Program Files\\Microsoft VS Code\\Code.exe", _
Apr 13 10:45:41.265 INFO move_update: "C:\\Program Files\\Microsoft VS Code\\unins000.dat", _
Apr 13 10:45:41.265 INFO Delete: "api-ms-win-core-console-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.281 INFO Delete: "api-ms-win-core-datetime-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.281 INFO Delete: "api-ms-win-core-debug-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.328 INFO Delete: "api-ms-win-core-errorhandling-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.328 INFO Delete: "api-ms-win-core-file-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.328 INFO Delete: "api-ms-win-core-file-l1-2-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-file-l2-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-handle-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-heap-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-interlocked-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-libraryloader-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-localization-l1-2-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-memory-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-namedpipe-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-processenvironment-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-processthreads-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-processthreads-l1-1-1.dll" (attempt 1)
Apr 13 10:45:41.343 INFO Delete: "api-ms-win-core-profile-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-rtlsupport-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-string-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-synch-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-synch-l1-2-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-sysinfo-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-timezone-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-core-util-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-crt-conio-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-crt-convert-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-crt-environment-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-crt-filesystem-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-crt-heap-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.359 INFO Delete: "api-ms-win-crt-locale-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-math-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-multibyte-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-private-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-process-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-runtime-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-stdio-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-string-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-time-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "api-ms-win-crt-utility-l1-1-0.dll" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "bin" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "blink_image_resources_200_percent.pak" (attempt 1)
Apr 13 10:45:41.375 INFO Delete: "Code.exe" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "Code.VisualElementsManifest.xml" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "CodeSignSummary.md" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "content_resources_200_percent.pak" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "content_shell.pak" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "d3dcompiler_47.dll" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "ffmpeg.dll" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "icudtl.dat" (attempt 1)
Apr 13 10:45:41.390 INFO Delete: "inno_updater.exe" (attempt 1)
Apr 13 10:45:41.406 INFO Delete: "libEGL.dll" (attempt 1)
Apr 13 10:45:41.406 INFO Delete: "libGLESv2.dll" (attempt 1)
Apr 13 10:45:41.406 INFO Delete: "locales" (attempt 1)
Apr 13 10:45:41.531 INFO Delete: "msvcp140.dll" (attempt 1)
Apr 13 10:45:41.531 INFO Delete: "natives_blob.bin" (attempt 1)
Apr 13 10:45:41.531 INFO Delete: "node.dll" (attempt 1)
Apr 13 10:45:41.531 INFO Delete: "pdf_viewer_resources.pak" (attempt 1)
Apr 13 10:45:41.531 INFO Delete: "resources" (attempt 1)
Apr 13 10:45:51.927 INFO Delete: "resources" (attempt 2)
Apr 13 10:45:52.177 INFO Delete: "resources" (attempt 3)
Apr 13 10:46:04.621 INFO Delete: "resources" (attempt 4)
Apr 13 10:46:05.545 INFO Delete: "resources" (attempt 5)
Apr 13 10:46:06.833 INFO Delete: "resources" (attempt 6)
Apr 13 10:46:09.052 INFO Delete: "resources" (attempt 7)
Apr 13 10:46:11.563 INFO Delete: "resources" (attempt 8)
Apr 13 10:46:14.842 INFO Delete: "resources" (attempt 9)
Apr 13 10:46:18.981 INFO Delete: "resources" (attempt 10)
Apr 13 10:46:24.047 INFO Delete: "resources" (attempt 11)
Apr 13 10:46:24.125 ERRO The directory is not empty. (os error 145)
@vscodebot vscodebot bot added the install-update VS Code installation and upgrade system issues label Apr 13, 2018
@MAntal001
Copy link

same issue
vscode-inno-updater.log

@joaomoreno joaomoreno added this to the April 2018 milestone Apr 13, 2018
@joaomoreno joaomoreno self-assigned this Apr 13, 2018
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Apr 13, 2018
@wenkeming
Copy link

same issue with Windows 10
default

@arunAtCSGI
Copy link

Same Issue
vscode-inno-updater.log

@lukemiller93
Copy link

Same issue
OS: Windows 7 Professional
VSCode Version: 1.22.2
vscode-inno-updater.log

@Ashu131
Copy link
Author

Ashu131 commented Apr 17, 2018

Found a temporarily solution.

Actually code.exe is not deleted @alakameljebali all files moved to a folder with a '__'(double underscore) name.
In my case files location is C:/ProgramFiles/Microsoft VsCode/
I just copied all files from '__' folder to parent directory and replaced the existing.
My VS Code is working good and have the latest version.

Actually what updating VSCode did here is copied all important data to a temporary directory(__) uninstalled older version installed new version and merge with data in temporary directory and crashed before the next step, which is to move the files to main directory from temporary directory.
@joaomoreno

@joaomoreno joaomoreno changed the title Unable to update VsCode Windows update failed: The directory is not empty Apr 24, 2018
@joaomoreno joaomoreno added the windows VS Code on Windows issues label Apr 24, 2018
@joaomoreno
Copy link
Member

Related to rust-lang/rust#29497

@joaomoreno
Copy link
Member

Verifier:

It's pretty much very hard to reproduce. I suspect it is reproducible in slower machines / IO devices.

I suggest a code review, after being aware of rust-lang/rust#29497: microsoft/inno-updater@6311428

  • First I added a parameter to the retry util function which lets me control how many attempts are made, while there are errors.
  • Then I increased the retry count for deleting folders to retry for at least 5 minutes, with a quadratic backoff.
  • Then I changed the check for whether a file/folder exists to before attempting to delete it. I suspect that in some situations fs::remove_dir_all might return an error, while successfully deleting the target folder; the previous code would get us in stuck a loop since further calls to fs::remove_dir_all would simply fail because the folder wouldn't be there. It's just a theory, though.

joaomoreno added a commit that referenced this issue Apr 25, 2018
@dbaeumer
Copy link
Member

Verifiying...

@dbaeumer dbaeumer added the verified Verification succeeded label Apr 27, 2018
@dbaeumer
Copy link
Member

Verified.

@LeaFrock
Copy link

I meet the error too, but i find no answers among the linked issues. Now i can't update to version 1.23. So what's the problem?
My exe file is at the path "D://" but the error message shows that it doesn't find the code.exe in "C://". I guess the problem occurs if the filepath is not the default one while being installed. What a ridiculous and disturbing mistake if i guess right!
I think i'm not the only guy who wanna get a solution excluding reinstallation.
@joaomoreno @dbaeumer

@dbaeumer
Copy link
Member

@LeaFrock this sounds like a different issue. Can you please open a new issue with a description about what you experience.

@LeaFrock
Copy link

@dbaeumer Thanks for your reply. I have described my problem in the issue #49373 and i also provide the snapshot.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

8 participants