kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.17k stars 4.87k forks source link

hyperv: exit status 1 - MethodInvocationNotSupportedInConstrainedLanguage #6098

Closed gtan01 closed 4 years ago

gtan01 commented 4 years ago

The exact command to reproduce the issue minikube start --vm-driver=hyperv

The full output of the command that failed:

minikube v1.6.1 on Microsoft Windows 10 Enterprise 10.0.17763 Build 17763

  • Selecting 'hyperv' driver from user configuration (alternates: [virtualbox])
  • Creating hyperv VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
  • Retriable failure: create: precreate: exit status 1
  • Creating hyperv VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
  • Retriable failure: create: precreate: exit status 1
  • Creating hyperv VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
  • Retriable failure: create: precreate: exit status 1
  • Creating hyperv VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
  • Retriable failure: create: precreate: exit status 1
  • X Unable to start VM: create: precreate: exit status 1

The output of the minikube logs command:

minikube logs * X api load: filestore "minikube": Docker machine "minikube" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.

The operating system version: Windows 10 Enterprise with Hyper-V activated in BIOS also

daneel3001 commented 4 years ago

Hello

I may be having the same issue. On Windows 10 insider/slow the command "Preparing Kubernetes 1.17.0 on Docker '19.03.5' never completes.

minikube start
* minikube v1.6.1 on Microsoft Windows 10 Pro 10.0.19041 Build 19041
* Selecting 'hyperv' driver from existing profile (alternates: [])
* Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
* Starting existing hyperv VM for "minikube" ...
* Waiting for the host to be provisioned ...
* Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...

Logs:

* Dec 17 08:54:05 minikube systemd[1]: Started Docker Application Container Engine.
* Dec 17 08:54:05 minikube dockerd[2896]: time="2019-12-17T08:54:05.974578913Z" level=info msg="API listen on /var/run/docker.sock"
* Dec 17 08:54:05 minikube dockerd[2896]: time="2019-12-17T08:54:05.974723513Z" level=info msg="API listen on [::]:2376"
*
* ==> container status <==
* time="2019-12-17T08:56:55Z" level=fatal msg="failed to connect: failed to connect, make sure you are running as root and the runtime has been started: context deadline exceeded"
* CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
*
daneel3001 commented 4 years ago

My issue might be linked to Docker engine and Minikube version incompatibility. https://github.com/kubernetes/minikube/issues/6065#issuecomment-564956169

gtan01 commented 4 years ago

Hi,

Will this be my issue as well in your opinion?

tstromberg commented 4 years ago

@gtan01 - do you mind including the output of:

minikube start --alsologtostderr -v=1

gtan01 commented 4 years ago

Hi Thomas,

Here it is: $ minikube start --alsologtostderr -v=1 I1219 15:21:05.115393 8216 notify.go:125] Checking for updates... I1219 15:21:05.225424 8216 start.go:255] hostinfo: {"hostname":"SIN-L-00040522","uptime":188988,"bootTime":1576551077,"procs":236,"os":"windows","platform":"Microsoft Windows 10 Enterprise","platformFamily":"Standalone Workstation","platformVersion":"10.0.17763 Build 17763","kernelVersion":"","virtualizationSystem":"","virtualizationRole":"","hostid":"3ce0ca5c-3041-4eef-bafa-b099d42404fb"} W1219 15:21:05.225424 8216 start.go:263] gopshost.Virtualization returned error: not implemented yet

I1219 15:21:10.092819 8216 main.go:110] libmachine: [stderr =====>] : I1219 15:21:10.092819 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578") I1219 15:21:10.434820 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:10.434820 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:10.434820 8216 main.go:110] libmachine: exit status 1 I1219 15:21:10.434820 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") I1219 15:21:10.772817 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:10.772817 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:18.808314 8216 main.go:110] libmachine: [stderr =====>] : I1219 15:21:18.808314 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578") I1219 15:21:19.138314 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:19.138314 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:19.138314 8216 main.go:110] libmachine: exit status 1 I1219 15:21:19.138314 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") I1219 15:21:19.465315 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:19.465315 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:32.762612 8216 main.go:110] libmachine: [stderr =====>] : I1219 15:21:32.762612 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578") I1219 15:21:33.099612 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:33.099612 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:33.099612 8216 main.go:110] libmachine: exit status 1 I1219 15:21:33.099612 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") I1219 15:21:33.435612 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:33.435612 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:49.021587 8216 main.go:110] libmachine: [stderr =====>] : I1219 15:21:49.021587 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578") I1219 15:21:49.358587 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:49.358587 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

I1219 15:21:49.358587 8216 main.go:110] libmachine: exit status 1 I1219 15:21:49.358587 8216 main.go:110] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") I1219 15:21:49.686818 8216 main.go:110] libmachine: [stdout =====>] : I1219 15:21:49.686818 8216 main.go:110] libmachine: [stderr =====>] : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:1

tstromberg commented 4 years ago

It looks like PowerShell might be restricted on your computer. I found this issue which seems to indicate that other programs may suffer from the same issue: https://github.com/docker/for-win/issues/1348

Do you mind trying:

Alternatively, I would talk to your IT Administrator about giving you this permission by default. Please let me know how it works!

gtan01 commented 4 years ago

Hi Thomas,

Thank you very much it worked in Powershell. Most appreciated.

BTW, there are errors if I launch using CYGWIN FYI...below are the error messages when I run "minikube start --vm-driver=hyperv" in CYGWIN.

minikube start --vm-driver=hyperv

gtan01 commented 4 years ago

Hi Thomas,

Here are the error messages. These occur when Hyperv is shutdown and restarted the next day.

PS C:\WINDOWS\system32> minikube start --vm-driver=hyperv --alsologtostderr -v=1 I0106 11:15:08.601247 9328 start.go:255] hostinfo: {"hostname":"SIN-L-00040522","uptime":1486,"bootTime":1578279022,"procs":239,"os":"windows","platform":"Microsoft Windows 10 Enterprise","platformFamily":"Standalone Workstation","platformVersion":"10.0.17763 Build 17763","kernelVersion":"","virtualizationSystem":"","virtualizationRole":"","hostid":"3ce0ca5c-3041-4eef-bafa-b099d42404fb"} W0106 11:15:08.601247 9328 start.go:263] gopshost.Virtualization returned error: not implemented yet

I0106 11:15:10.526351 9328 cluster.go:114] Machine state:

W0106 11:15:11.382940 9328 start.go:1017] DeleteHost: Docker machine "minikube" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one. I0106 11:15:16.918556 9328 cluster.go:102] Skipping create...Using existing machine configuration

I0106 11:15:17.337547 9328 cluster.go:114] Machine state:

W0106 11:15:18.182615 9328 start.go:1017] DeleteHost: Docker machine "minikube" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one. I0106 11:15:28.990812 9328 cluster.go:102] Skipping create...Using existing machine configuration

I0106 11:15:29.507540 9328 cluster.go:114] Machine state:

W0106 11:15:30.359998 9328 start.go:1017] DeleteHost: Docker machine "minikube" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one. I0106 11:15:43.472141 9328 cluster.go:102] Skipping create...Using existing machine configuration

I0106 11:15:43.935746 9328 cluster.go:114] Machine state:

W0106 11:15:44.820295 9328 start.go:1017] DeleteHost: Docker machine "minikube" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one. W0106 11:15:44.832295 9328 exit.go:101] Unable to start VM: start: exit status 1 X Unable to start VM: start: exit status 1

gtan01 commented 4 years ago

Hi Thomas,

I solved the problem by using "minikube delete". I notice I have to do this after complete shutdown.

medyagh commented 4 years ago

glad to see your issue was solved, I will close this, please feel free to re-open if needed.

medyagh commented 4 years ago

could be duplicate of https://github.com/kubernetes/minikube/issues/7990