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

The process cannot access the file 'C:\WINDOWS\TEMP\<some file>' because it is being used by another process. #818

Closed
slafave opened this issue Jun 13, 2017 · 50 comments

Comments

@slafave
Copy link

slafave commented Jun 13, 2017

Expected behavior

When starting machine, Docker should start normally.

Actual behavior

Docker icon indicates it's initializing. After several minutes I get the following exception. The filename is always different. The temp file indicated is always created at bootup, it's creation and modified date correspond to when I log into my machine after clean boot.

The process cannot access the file 'C:\WINDOWS\TEMP\kmrua3r5.sbk' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
at Docker.Backend.MobyCommand.RunDocker(String arguments, IDictionary2 envVariables, String stdin, Int32 timeoutMs, String cidFile) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\MobyCommand.cs:line 139 at Docker.Backend.MobyCommand.Run(String commandLine, IDictionary2 envVariables, Boolean load, String stdin, Int32 timeoutMs) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\MobyCommand.cs:line 49
at Docker.Backend.SambaShare.MountInMoby(String mount, String drive, Credential cred, CredentialInfo credInfo, String options, String ip) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 197
at Docker.Backend.SambaShare.MountInMoby(String drive, Credential credential, Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 168
at Docker.Backend.SambaShare.Mount(String drive, Credential credential, Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 65
at Docker.Backend.BackendServer.b__5_11(Object[] args) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\BackendServer.cs:line 54
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145

Information

  • Diagnostic ID: A5DA733E-F0E6-4FCE-9066-01021758BEA2/2017-06-13_09-28-37
  • Docker Edge Build 17.06.0-rc2-ce-win14 (12510)
  • Windows 10 Enterprise 1703, Build 15063.332

Steps to reproduce the behavior

  1. Cold boot Windows
  2. Docker crashes trying to access a locked temp file.
@jasonbivins
Copy link

Hi @slafave
Do you have any antivirus or endpoint protection utilities running that would be scanning the windows\temp folder ?

@slafave
Copy link
Author

slafave commented Jun 14, 2017

Hi @jasonbivins -

We're running Windows Defender but I have the Windows\Temp folder excluded from all scanning.

@jasonterando
Copy link

For what it's worth, I've been getting this since loading Edge. Windows\Temp is not the best folder to exclude from AV scanning. I'm going to try setting an exclusion by process instead (Docker.Service). Will update this thread with results.

@jasonterando
Copy link

So far, excluding the Docker.Service process from AV scanning appears to be preventing the TEMP error...

@jasonterando
Copy link

Queue sad trombones, got the temp file access error again... Is there another process besides Docker.Service I can try excluding?

Crash report: C7ED5F5F-3273-4BDE-9A44-A018CA0CBD67/2017-06-18_09-54-59

Stack trace:

The process cannot access the file 'C:\WINDOWS\TEMP\iypofhvz.ase' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Docker.Backend.MobyCommand.RunDocker(String arguments, IDictionary`2 envVariables, String stdin, Int32 timeoutMs, String cidFile) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\MobyCommand.cs:line 139
   at Docker.Backend.MobyCommand.Run(String commandLine, IDictionary`2 envVariables, Boolean load, String stdin, Int32 timeoutMs) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\MobyCommand.cs:line 49
   at Docker.Backend.SambaShare.MountInMoby(String mount, String drive, Credential cred, CredentialInfo credInfo, String options, String ip) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 197
   at Docker.Backend.SambaShare.MountInMoby(String drive, Credential credential, Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 168
   at Docker.Backend.SambaShare.Mount(String drive, Credential credential, Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 65
   at Docker.Backend.BackendServer.<Run>b__5_11(Object[] args) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\BackendServer.cs:line 54
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145

@bribass
Copy link

bribass commented Jun 27, 2017

OK, I'm also affected by this issue. After a little bit of investigation, I doubt it's the AV. Here's my reasoning:

I'm running 17.06.0-ce-rc5-win16 (12604) on the Edge channel.
Crash report: 7375E156-29B2-468B-9C4C-F8C65221B099/2017-06-27_09-37-38
Stack trace:

The process cannot access the file 'C:\WINDOWS\TEMP\w3mbvm1u.z2u' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Docker.Backend.MobyCommand.RunDocker(String arguments, IDictionary`2 envVariables, String stdin, Int32 timeoutMs, String cidFile) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\MobyCommand.cs:line 139
   at Docker.Backend.MobyCommand.Run(String commandLine, IDictionary`2 envVariables, Boolean load, String stdin, Int32 timeoutMs) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\MobyCommand.cs:line 49
   at Docker.Backend.SambaShare.MountInMoby(String mount, String drive, Credential cred, CredentialInfo credInfo, String options, String ip) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 197
   at Docker.Backend.SambaShare.MountInMoby(String drive, Credential credential, Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 168
   at Docker.Backend.SambaShare.Mount(String drive, Credential credential, Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\SambaShare.cs:line 65
   at Docker.Backend.BackendServer.<Run>b__5_11(Object[] args) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\BackendServer.cs:line 54
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145

Using Process Explorer (from the Sysinternals suite, https://technet.microsoft.com/en-us/sysinternals/bb842062.aspx), I searched for processes having open handles containing w3mbvm1u.z2u (from the Find -> Find Handle or DLL... menu). I found one docker.exe process (a child of the com.docker.service process) that was just sitting taking very little CPU (under 1% every now and then). This process has the command line:

"C:\Program Files\Docker\Docker\Resources\bin\docker.exe" run --rm --privileged --pid=host -i -e USER --cidfile="C:\WINDOWS\TEMP\w3mbvm1u.z2u" d4w/nsenter /bin/sh -c "export PASSWD=$(cat); if ! nc -zv -w1 10.0.75.1 445; then exit 253; fi; (umount -vl /c || true) && (umount -vl /C || true) && (rmdir /c || true) && (rmdir /C || true) && mkdir -p /c && mkdir -p /C && mount -t cifs //10.0.75.1/C /c -v -o noperm,iocharset=utf8,nobrl,mfsymlinks,vers=3.02,domain=upsilon&& mount -t cifs //10.0.75.1/C /C -v -o noperm,iocharset=utf8,nobrl,mfsymlinks,vers=3.02,domain=upsilon"

Once the stack trace window with the error is dismissed, I can successfully restart Docker (from the Reset tab of the settings dialog), and everything comes up as expected.

@friism
Copy link

friism commented Jun 27, 2017

That's the cifs-mount container. cc @simonferquel @ebriney

@NicolasDorier
Copy link

Same error, right after the latest udpate.

@NicolasDorier
Copy link

And I confirm, after the error windows, clicking Restart works.

@gtardif gtardif closed this as completed Jun 29, 2017
@jasonterando
Copy link

@gtardif - did this actually get fixed? @NicolasDorier just mentioned that he was still seeing the error after the current update, and that restarting Docker worked. The error, however, still exists.

@ebriney
Copy link
Member

ebriney commented Jun 29, 2017

No it's not in the actual version. I'll be fixed in the next one, sorry for the convenience.

@NicolasDorier
Copy link

My version is

Version 17.06.0-ce-win18 (12627)
Channel: stable
d9b6651

@bribass
Copy link

bribass commented Jun 29, 2017

I can report that this also went away for me with the latest update on edge, 17.06.0-ce-win17 (12626).

@joelharkes
Copy link

For me this just started happening after a docker update to latest 17.06:

The process cannot access the file 'C:\WINDOWS\TEMP\0fq3fmla.c4l' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Docker.Backend.MobyCommand.RunDocker(String arguments, IDictionary`2 envVariables, String stdin, Int32 timeoutMs, String cidFile)
   at Docker.Backend.MobyCommand.Run(String commandLine, IDictionary`2 envVariables, Boolean load, String stdin, Int32 timeoutMs)
   at Docker.Backend.SambaShare.MountInMoby(String mount, String drive, Credential cred, CredentialInfo credInfo, String options, String ip)
   at Docker.Backend.SambaShare.MountInMoby(String drive, Credential credential, Settings settings)
   at Docker.Backend.SambaShare.Mount(String drive, Credential credential, Settings settings)
   at Docker.Backend.BackendServer.<Run>b__5_11(Object[] args)
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

Tried reset factory defaults, and this fixed it.

@jmanuelsoberano
Copy link

I currently have Docker version 17.06.0-ce, build 02c1d87. And I have the same problem that the others mention. I see that they say that reestablishing the defaults is fixed, but in realizad I do not see it as a solution because this destroys all the containers I currently have. I hope you can support me with this inconvenience.

The process cannot access the file 'C:\Windows\TEMP\qxtcclj4.f0m' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
at Docker.Backend.MobyCommand.RunDocker(String arguments, IDictionary2 envVariables, String stdin, Int32 timeoutMs, String cidFile) at Docker.Backend.MobyCommand.Run(String commandLine, IDictionary2 envVariables, Boolean load, String stdin, Int32 timeoutMs)
at Docker.Backend.SambaShare.MountInMoby(String mount, String drive, Credential cred, CredentialInfo credInfo, String options, String ip)
at Docker.Backend.SambaShare.MountInMoby(String drive, Credential credential, Settings settings)
at Docker.Backend.SambaShare.Mount(String drive, Credential credential, Settings settings)
at Docker.Backend.BackendServer.b__5_11(Object[] args)
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

@joelharkes
Copy link

Im not sure if it destroys running contaiers. But you shouldn't even store Important state in your containers in the first place.

@ikovalyov
Copy link

Started happening after last update. Reset to defaults helps but after reboot it's not working again.

@ikovalyov
Copy link

Restart odkcer using gui helped.

@oba2cat3
Copy link

oba2cat3 commented Jul 4, 2017

Still going on with the stable version:
Version 17.06.0-ce-win18 (12627)
Channel: stable
d9b6651
Reset fixes the problem...
Is there ETA on a Stable release fix for this?

@ikovalyov
Copy link

gave docker-users permission to write into temp folder. works good for now.

@valeriano-manassero
Copy link

Same issue here:

  • Diagnostic ID: 293A0B6E-066E-4604-982E-7D4C90AB0F8A/2017-07-05_07-58-02
  • Docker Version 17.06.0-ce-win18 (12627)
  • Windows 10 Pro 10.0.14393 build 14393

@Double-A-92
Copy link

ikovalyov Can you elaborate what you did? What are docker-users?

@yskeat
Copy link

yskeat commented Jul 11, 2017

Same problem here. Temporary solution is reset to factory defaults and redownload all images everyday.

@ciliehub
Copy link

Same issue since latest update. But a reboot after booting helps.

@Double-A-92
Copy link

Double-A-92 commented Jul 11, 2017

@yskeat Just restarting Docker a few times also works (for me at least).

@morrisalp
Copy link

morrisalp commented Jul 11, 2017

@ikovalyov I have given the docker-users user group full permissions on C:\Windows\Temp but I'm still having this issue. Docker does seem to sometimes work correctly, but I haven't yet figured out if it happens after I restart Docker or if there's something else that affects it.

@morrisalp
Copy link

This bug completely breaks my current workflow. Does anyone know if it is possible to downgrade to the previous version of Docker for Windows?

@morrisalp
Copy link

@gtardif Can you please re-open this issue? This has not been fixed.

@ebriney ebriney reopened this Jul 11, 2017
@ebriney
Copy link
Member

ebriney commented Jul 11, 2017

@morrisalp the patch will be in the next version due by the end of the week, I reopened the issue, feel free to close it when you will have test it.

@ikovalyov
Copy link

ikovalyov commented Jul 11, 2017

@morrisalp, yes. Right now I'm doing restart docker after it failed to start. It works then. No need to do factory reset.

@ljw6834
Copy link

ljw6834 commented Jul 11, 2017

I restart my pc and Docker started. My coworker unchecks "Start Docker when you log in" box on Settings ->General, he just clicks Docker for Windows icon every time to start and he said it worked too.

@jasonbivins
Copy link

@ljw6834
Can you try using Docker the same way and use the Docker icon instead of auto-start and let me know if the issue persists?

@ljw6834
Copy link

ljw6834 commented Jul 11, 2017

I unchecked "start Docker when you log in" box, restarted pc and clicked Docker for Windows" icon on my desk top, docker started normal.

@immunochomik
Copy link

I have the same problem after last update.

@uberchris2
Copy link

Same issue with:
Version: 17.06.0-ce-win18 (12627)
Channel: stable
Sha1: d9b66511e0920fdb4a7ff88b8343f65b46fc07e0
Started on: 2017/07/12 09:35:36.488

@friism
Copy link

friism commented Jul 12, 2017

As @ebriney mentioned above we have a fix for this and we're working on shipping it asap.

@dargmuesli
Copy link

The new version 17.06.0-ce-win19 (12801), Channel: stable, c98c1c2 fixed this issue for me!
But now I have another one, that was not present before: #690 I'm unable to share any drive... See you there ;)

@minkbear
Copy link

Confirmed. Update to version 17.06.0-ce-win19 (12801), Channel: stable, c98c1c2 .
Fixed for me.

@valeriano-manassero
Copy link

Fixed for me too.

@chen-xin
Copy link

After update to version 17.06.0-ce-win19 (12801), docker changes the info to "Docker command did not complete within the allowed timeout", as #927, have to restart docker every reboot.

@pomeo92
Copy link

pomeo92 commented Aug 10, 2017

Faced the same on the latest version. Nothing of suggested above worked.
Docker hv-sock proxy (vsudd) is not reachable
at Docker.Backend.ContainerEngine.Linux.ConnectToVsud(TaskCompletionSource`1 vmId) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 267
at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 251
at Docker.Backend.ContainerEngine.Linux.Restart(Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 182
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.b__0(Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 47
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145

Diagnostic id: F225E1AF-79FE-41F0-B906-CF7569CCD5AD/2017-08-11_00-55-16
Windows 10 Version 1607
Version 17.06.0-ce-win19 (12801)
Channel: stable
c98c1c2

@iNLyze
Copy link

iNLyze commented Sep 21, 2018

I fixed same problem by stopping the Docker for Windows Service in Computer Management/Services. It threw an error about not terminating correctly, but it stopped and I then could delete the entire Docker Folder in C:\Program Files\Docker (last step may not be necessary). I then re-installed Docker for Windows successfully.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests