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

minikube stop hangs when local file system is mounted #12649

Closed
rogierhofboer opened this issue Oct 4, 2021 · 3 comments · Fixed by #12716
Closed

minikube stop hangs when local file system is mounted #12649

rogierhofboer opened this issue Oct 4, 2021 · 3 comments · Fixed by #12716
Assignees
Labels
area/mount co/hyperv HyperV related issues kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@rogierhofboer
Copy link

rogierhofboer commented Oct 4, 2021

OS: Microsoft Windows [Version 10.0.19042.1052]
Minikube version: 1.23.2

Steps to reproduce the issue:

  1. minikube start --apiserver-names minikube.mshome.net --mount
  2. minikube stop
  3. hangs and files needs to be removed manually with LockHunter at next machine restart

Run minikube logs --file=logs.txt and drag and drop the log file into this issue

Cannot pull logs, Guest not found

Full output of failed command if not minikube start:

PS C:\WINDOWS\system32> minikube start --apiserver-names minikube.mshome.net --mount * minikube v1.23.2 on Microsoft Windows 10 Pro 10.0.19042 Build 19042 * Using the hyperv driver based on existing profile

  • Starting control plane node minikube in cluster minikube
  • Creating hyperv VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
    ! This VM is having trouble accessing https://k8s.gcr.io
  • To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
  • Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
    • Generating certificates and keys ...
    • Booting up control plane ...
    • Configuring RBAC rules ...
  • Verifying Kubernetes components...
  • Creating mount C:\Users\rogierhofboer:/minikube-host ...
    • Using image gcr.io/k8s-minikube/storage-provisioner:v5
  • Enabled addons: storage-provisioner, default-storageclass
  • Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
    PS C:\WINDOWS\system32> minikube stop
  • Stopping node "minikube" ...
  • Powering off "minikube" via SSH ...
    PS C:\WINDOWS\system32> minikube delete
  • Stopping node "minikube" ...
  • Powering off "minikube" via SSH ...
    E1004 12:09:18.122191 18320 main.go:126] libmachine: [stderr =====>] : Hyper-V\Stop-VM : 'minikube' failed to change state.
    The operation cannot be performed while the object is in its current state.
    At line:1 char:1
  • Hyper-V\Stop-VM minikube
  •   + CategoryInfo          : InvalidOperation: (:) [Stop-VM], VirtualizationException
      + FullyQualifiedErrorId : InvalidState,Microsoft.HyperV.PowerShell.Commands.StopVM
    
    
    
  • Deleting "minikube" in hyperv ...
    E1004 12:09:25.287222 18320 main.go:126] libmachine: [stderr =====>] : Hyper-V\Stop-VM : 'minikube' failed to change state.
    The operation cannot be performed while the object is in its current state.
    At line:1 char:1
  • Hyper-V\Stop-VM minikube -TurnOff
  •   + CategoryInfo          : InvalidOperation: (:) [Stop-VM], VirtualizationException
      + FullyQualifiedErrorId : InvalidState,Microsoft.HyperV.PowerShell.Commands.StopVM
    
    
    

E1004 12:09:28.826476 18320 main.go:126] libmachine: [stderr =====>] : Hyper-V\Stop-VM : 'minikube' failed to change state.
The operation cannot be performed while the object is in its current state.
At line:1 char:1

  • Hyper-V\Stop-VM minikube -TurnOff
  •   + CategoryInfo          : InvalidOperation: (:) [Stop-VM], VirtualizationException
      + FullyQualifiedErrorId : InvalidState,Microsoft.HyperV.PowerShell.Commands.StopVM
    
    
    

X Failed to delete cluster: host remove retry: exit status 1

  • You may need to manually remove the "minikube" VM from your hypervisor
  • Removing C:\Users\rogierhofboer.minikube\machines\minikube ...

X Exiting due to GUEST_FILE_IN_USE: remove C:\Users\rogierhofboer.minikube\machines\minikube\disk.vhd: The process cannot access the file because it is being used by another process.

PS C:\WINDOWS\system32>

@rogierhofboer
Copy link
Author

It Works without problems when the --mount option is not used.

@spowelljr
Copy link
Member

Hi @rogierhofboer, thanks for reporting your issue with minikube!

I was able to reproduce your issue, I'm going to look into this.

@spowelljr spowelljr self-assigned this Oct 4, 2021
@spowelljr spowelljr added this to the 1.24.0 milestone Oct 4, 2021
@spowelljr spowelljr added co/hyperv HyperV related issues kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. area/mount labels Oct 4, 2021
@rogierhofboer
Copy link
Author

FYI running minikube mount --kill before minikube stop does produce this error while stopping, but it doesn't hang:

minikube mount --kill
minikube stop
* Stopping node "minikube"  ...
* Powering off "minikube" via SSH ...
E1005 13:40:25.425246    1940 main.go:126] libmachine: [stderr =====>] : Hyper-V\Stop-VM : Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.
At line:1 char:1
+ Hyper-V\Stop-VM minikube
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Stop-VM], VirtualizationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.HyperV.PowerShell.Commands.StopVM


* Stopping node "minikube"  ...
* 1 nodes stopped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mount co/hyperv HyperV related issues kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants