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: Access is denied #47841

Open
ryanolsonx opened this issue Apr 13, 2018 · 142 comments
Open

Windows update failed: Access is denied #47841

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

Comments

@ryanolsonx
Copy link

ryanolsonx commented Apr 13, 2018

Log from %HOME%\AppData\Local\Temp\vscode-inno-updater.log

Apr 13 11:27:40.666 INFO Starting: C:\Program Files\Microsoft VS Code\Code.exe, false
Apr 13 11:27:40.670 INFO Checking for running Code.exe processes... (attempt 1)
Apr 13 11:27:40.670 INFO Code.exe is running, wait a bit
Apr 13 11:27:41.148 INFO Checking for running Code.exe processes... (attempt 2)
Apr 13 11:27:41.153 INFO Code.exe is running, wait a bit
Apr 13 11:27:41.654 INFO Checking for running Code.exe processes... (attempt 3)
Apr 13 11:27:41.666 INFO Code.exe is not running
Apr 13 11:27:41.666 INFO Starting update, silent = false
Apr 13 11:27:41.691 INFO do_update: "C:\\Program Files\\Microsoft VS Code\\Code.exe", _
Apr 13 11:27:41.692 INFO move_update: "C:\\Program Files\\Microsoft VS Code\\unins000.dat", _
Apr 13 11:27:41.696 INFO Delete: "Code.exe" (attempt 1)
Apr 13 11:27:41.744 INFO Delete: "Code.exe" (attempt 2)
Apr 13 11:27:41.945 INFO Delete: "Code.exe" (attempt 3)
Apr 13 11:27:42.396 INFO Delete: "Code.exe" (attempt 4)
Apr 13 11:27:43.197 INFO Delete: "Code.exe" (attempt 5)
Apr 13 11:27:44.448 INFO Delete: "Code.exe" (attempt 6)
Apr 13 11:27:46.249 INFO Delete: "Code.exe" (attempt 7)
Apr 13 11:27:48.700 INFO Delete: "Code.exe" (attempt 8)
Apr 13 11:27:51.901 INFO Delete: "Code.exe" (attempt 9)
Apr 13 11:27:55.952 INFO Delete: "Code.exe" (attempt 10)
Apr 13 11:28:00.953 INFO Delete: "Code.exe" (attempt 11)
Apr 13 11:28:00.953 ERRO Access is denied. (os error 5)

On Windows 10 64 bit

@vscodebot
Copy link

vscodebot bot commented Apr 13, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues labels Apr 16, 2018
@joaomoreno joaomoreno added this to the April 2018 milestone Apr 16, 2018
@joaomoreno joaomoreno self-assigned this Apr 16, 2018
@joaomoreno joaomoreno changed the title Unable to update VS Code from 1.22.1 to 1.22.2 Windows update failed: Access is denied Apr 24, 2018
@joaomoreno joaomoreno added the windows VS Code on Windows issues label Apr 24, 2018
@joaomoreno
Copy link
Member

This is a puzzle to me, because we know Code isn't running... so why can't the updater remove Code... unless it is really running?


@ryanolsonx @gitDylanHub @OfficerHalf @SwingCoder911

Can you run this little app I've created, while Code is running? rust-playground.zip

It will output all running process numbers and names. Something like this:

image

Does Code appear in that list, for you? Can you show me the output of the app in your system?

@nathonius
Copy link

I'll do you one better. I'm attaching the output of that before running the update, while running the update, and at the point when I get the error message.
pre-update.txt
mid-update2.txt
error.txt

It certainly doesn't look like Code is running. That doesn't necessarily mean that some other process isn't preventing its deletion, though.

@joaomoreno
Copy link
Member

@OfficerHalf Awesome, it's great that you can reliably reproduce it. Any thoughts on who might be preventing that deletion? Just to confirm, the setup runs elevated, correct? Does the inno-updater.exe process also run elevated?

@nathonius
Copy link

nathonius commented Apr 25, 2018

Well, there are at least two pieces of security software running on my machine: ESET Security and CrowdStrike Falcon (though CrowdStrike is a recent addition, and I think this issue was present before it was installed), neither of which I have any control over. There are also various other controls in place as this is a managed Enterprise installation of Windows. I have co-workers that use Code without issue though so I doubt it's those. My guess was more along the lines of zombie processes spawned by Code that were still holding some resource.

A quick check in the task manager shows that all three update processes (inno_updater.exe, CodeSetup-insider-guid.exe, and CodeSetup-insider-guid.tmp) are elevated.

@joaomoreno
Copy link
Member

joaomoreno commented Apr 25, 2018

OK. I just need you to use the task manager and find those zombie processes and what is their full command line.

@nathonius
Copy link

FindZombieHandles reports nothing. I'm at a loss.

@joaomoreno
Copy link
Member

And can you manually delete the executable file yourself, in the file explorer?

@nathonius
Copy link

I can delete it manually. Even attempted to do so during the update, though it still failed with a complaint that the file didn't exist. Make up your mind, updater... 😁

@joaomoreno
Copy link
Member

joaomoreno commented Apr 26, 2018

The updater, as admin, can't. Yet you can easily delete it. 🤔 Did you get an elevation prompt to delete the file?

@joaomoreno joaomoreno modified the milestones: April 2018, May 2018 Apr 26, 2018
@nathonius
Copy link

I was not asked to elevate. I just get the usual 'are you sure you want to delete this' prompt.

@gitDylanHub
Copy link

Same issue that was originally reported here with the most recent update as well. So, had this issue on 1.22 and again now on 1.23. Be kind of annoying if I have to uninstall and download to get the latest features. Definitely a work related only issue though, can update on my personal easily. Probably good old McAfee locking everything down in the registries with some unique rule.

@Morten242
Copy link

It also happens on my home computer, which is not in a domain.

This was referenced Oct 11, 2018
@brotherdust
Copy link

I had a bit of an epiphany on Friday. I had installed the Vivaldi browser on both my work and home computers. By default, the Vivaldi browser also gets installed into the %userprofile%\AppData\Local folder. On my work PC, I have no problems updating the browser. But on my home PC, the updates always fail due to—can you guess?—locked files! Locked by the SYSTEM process. The same exact reason that updates to the user installations of VS Code and VS Code Insiders fail.

One thing that's worth checking out is what installer technology is being used by Vivaldi. Is the installer technology the same as that being used by VS Code? If so, then maybe it's something specific to the installer.

Ruling out any installer issues with respect to the installation location, it would seem most likely that this issue is machine-specific, I'm sorry to report, because for the life of me I'm unable to determine why this particular machine is behaving in such a manner.

I also run Vivaldi and have the SAME issue! I thought it was just me!

@fourpastmidnight
Copy link

fourpastmidnight commented Oct 11, 2018

@arencambre It does not seem to be highly correlated to domain-joined computers. My domain-joined work computer has no issues updating VS Code (regular or Insiders) nor Vivaldi (which also installs into %userprofile%\AppData\Local). My home computer, on the other hand, which is NOT domain-joined exhibits this behavior for both applications.

Therefore, as I stated previously, this issue is not a VS Code-specific issue, but is probably a machine-specific issue. (I'm leaning towards ruling out the installer because it's not the installer which has a problem, rather, it's the SYSTEM account holding a lock on files which need to be replaced causing the installer to fail.) The top culprit is the Anti-Virus program in use and/or it's configuration. I haven't been able to resolve the issue by changing my anti-virus configuration, however.

In my case, on my work computer they use Sophos Anti-Virus--again, this computer does not have an issue updating VS Code. On my home computer, I'm running Trend Micro Maximum Security, the latest version.

It may be helpful if others also list their anti-virus program in use to see if there are any program and/or configuration commonalities that could help determine why the SYSTEM process is holding locks on these files.

@brotherdust
Copy link

Here's my setup:

  • Latest VS Code (non-insider) User installed
  • Windows 10 1809 (2H18)
  • Windows Defender for anti-virus
  • NOT domain joined

Both my laptop and my desktop are set up the same as above and exhibit the same problem. I just uninstalled VS Code User and installed VS Code System. Seems to have fixed the problem.

@fourpastmidnight
Copy link

@brotherdust Thanks for the info. Yes, the system-wide installation does not exhibit this problem (to my knowledge) because it's installed to %Program Files%. I, too, have resorted to using the system-wide installation on my home computer due to the update issues.

One question: since you're running Windows 10 1809 and Windows Defender, did you enable the new anti-ransomware folder protection feature? Trend Micro has a similar feature that's been around for a while now and I am using it on some folders (though, not the %userprofile%\AppData folder). If so, is it possible for you to list the locations you've enabled it for (just use the well-known folder names such as Documents, Pictures, etc., not the full path to those folders. And also note if you've used the feature on other not well-known folders, e.g. C:\some-other-folder—I don't want to know the actual path, just whether or not you're using the feature outside of well-known folders as well).

@shanselman
Copy link
Member

shanselman commented Oct 11, 2018 via email

@Morten242
Copy link

But I don't think vivaldi's the cause though (I don't have it).
Also had this issue before 1809 so it's not because of the anti-ransomware feature.

@fourpastmidnight
Copy link

fourpastmidnight commented Oct 12, 2018 via email

@spences10
Copy link

So, this worked on my Dell XPS 13 but still fails on my Asus Transformer Pro

@joaomoreno
Copy link
Member

joaomoreno commented Oct 15, 2018

Will give Vivaldi a try... @shanselman is this happening to you on every update?

@jcotton42
Copy link

I don't have Vivaldi installed and am also having this issue

@mknejp
Copy link

mknejp commented Oct 16, 2018

Ever since I switched to the user-based installation this is now happening to me ever since. vscode is incapable of updating itself now, always claiming it cannot access Code.exe.

What I have noticed though (whenever I remember to check) is that the System process (pid 4) has a lock on Code.exe which remains locked even when vscode and the udpater exit. I can't even delete the file by hand at this point. Occasionally new locks are added within System when the update process attempts to run again. Needless to say when that happens not even the manually downloaded installer can do anything until I restart the machine.

@axmccx
Copy link

axmccx commented Oct 17, 2018

I'm also having this exact same issue. I need to download the new installer from the website, reboot, and install it first thing for it to succeed. This was the issue I posted weeks ago: #58743 (comment)

@fourpastmidnight
Copy link

@Morten242 Well, it may still be a "ransomware feature". As I mentioned earlier, I use Trend Micro Maximum Security which has had a "ransomware folder protection" feature since late 2017 (so, since around Windows 1803, possibly even 1709) and I've been using it on my Documents, Pictures and some other folders. So, it's not so much whether you're using the Windows ransomware folder protection feature, but whether or not you're using a ransomware folder protection feature of some software security suite which may be interfering (even though, in my case particularly, I'm not protecting %AppData%).

And as far as Vivaldi, for the 3rd time, I'm not saying it's causing anything, but that it also exhibits the same update failure behavior as VS Code (SYSTEM process holding a lock on critical files causing updates to fail), which is leading me to believe that this issue may be more specific to a machine configuration than an actual problem with VS Code itself (or Vivaldi, for that matter).

@WindFox
Copy link

WindFox commented Oct 18, 2018

@fourpastmidnight Except, all I have is Defender and I did not turn on the ransomware protection and I still get this on VSCode and Twitch (Starting to think Discord as well now unless they are truly pushing daily updates with no changelog)

@fourpastmidnight
Copy link

@WindFox Cool! It's just one more thing to potentially rule out. Thanks!

@pushqrdx
Copy link
Contributor

pushqrdx commented Oct 28, 2018

same issue with me with the exact same description from other members.

Edit> It's really bad for as i can't even uninstall vscode or reinstall it because both inno_updater and code are being used by System, even after restarting the machine.

@arencambre
Copy link

Can we change the name of this issue? This isn't about Windows Update.

@joaomoreno
Copy link
Member

Thanks for all the info guys, will continue investigating this. Meanwhile, I'll lock this thread so everyone sees this:

If you're having this issue constantly, disable background updates with

"update.enableWindowsBackgroundUpdates": false

@microsoft microsoft locked as too heated and limited conversation to collaborators Oct 29, 2018
@joaomoreno joaomoreno modified the milestones: October 2018, November 2018 Nov 1, 2018
@joaomoreno joaomoreno modified the milestones: November 2018, Backlog Dec 6, 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 windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests