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

delete: The process cannot access the file because it is being used by another process #6804

Closed
halmai opened this issue Feb 26, 2020 · 4 comments · Fixed by #7160
Closed
Assignees
Labels
co/hyperv HyperV related issues kind/feature Categorizes issue or PR as related to a new feature. os/windows priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@halmai
Copy link
Contributor

halmai commented Feb 26, 2020

The exact command to reproduce the issue:

minikube delete

The full output of the command that failed:

! Unable to get the status of the minikube cluster.
* Removing C:\Users\Csongor Halmai\.minikube\machines\minikube ...
*
X Unable to remove machine directory: %v: remove C:\Users\Csongor Halmai\.minikube\machines\minikube\disk.vhd: The process cannot access the file because it is being used by another process.
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose

The output of the minikube logs command:

*
X api load: filestore "minikube": open C:\Users\Csongor Halmai\.minikube\machines\minikube\config.json: The system cannot find the file specified.
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose

The operating system version:

Microsoft Windows [Version 10.0.18362.592]

I hoped that creating a config.json file can solve the problem. I created one with 0 bytes which was simply deleted by minikube delete. Then I created one with the content {} but it caused minikube delete to die with panic: runtime error: invalid memory address or nil pointer dereference. Then I gave up.

@halmai
Copy link
Contributor Author

halmai commented Feb 26, 2020

Solution: the Hyper-V Manager locked the file. I stopped it and then I was able to delete everything I wanted.
It would be nice to see some reference to this potential cause if the minikube delete command fails.

@tstromberg tstromberg changed the title minikube cannot be deleted delete: The process cannot access the file because it is being used by another process Feb 26, 2020
@tstromberg tstromberg added co/hyperv HyperV related issues triage/needs-information Indicates an issue needs more information in order to work on it. os/windows needs-solution-message Issues where where offering a solution for an error would be helpful kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Feb 26, 2020
@tstromberg
Copy link
Contributor

That sounds reasonable. If you or anyone else wants to add a solution message to be displayed for this error, please add an entry here:

@RA489
Copy link

RA489 commented Feb 27, 2020

/assign

@bahrikhalil
Copy link

you can resolve this by mannually stopping the process that is using the file by:

-open resmon.exe
resmon

-stop the process:
ps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues kind/feature Categorizes issue or PR as related to a new feature. os/windows priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
4 participants