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

hyperv: Method invocation is supported only on core types in this language mode. #7990

Open
Jack881 opened this issue May 4, 2020 · 11 comments
Labels
co/hyperv HyperV related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/ux lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-solution-message Issues where where offering a solution for an error would be helpful os/windows priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@Jack881
Copy link

Jack881 commented May 4, 2020

Steps to reproduce the issue:

1.minikube start
2.
3.

Full output of failed command:

C:\windows\system32>minikube start --alsologtostderr -v=1
I0504 08:44:24.795853 5860 start.go:259] hostinfo: {"hostname":"PUN-GNAIK02","uptime":3738,"bootTime":1588558326,"procs":263,"os":"windows","platform":"Microsoft Windows 10 Enterprise","platformFamily":"Standalone Workstation","platformVersion":"10.0.18362 Build 18362","kernelVersion":"","virtualizationSystem":"","virtualizationRole":"","hostid":"754650a7-4a07-48a5-8830-1c1aff7e24db"}
W0504 08:44:24.796844 5860 start.go:267] gopshost.Virtualization returned error: not implemented yet

  • minikube v1.9.0 on Microsoft Windows 10 Enterprise 10.0.18362 Build 18362
    I0504 08:44:24.805806 5860 driver.go:226] Setting default libvirt URI to qemu:///system
    W0504 08:44:24.805806 5860 start.go:547] selectDriver 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.
  • Using the hyperv driver based on existing profile
    I0504 08:44:26.185815 5860 start.go:307] selected driver: hyperv
    I0504 08:44:26.186789 5860 start.go:596] validating driver "hyperv" against &{Name:minikube KeepContext:false EmbedCerts:false MinikubeISO:https://storage.googleapis.com/minikube/iso/minikube-v1.9.0.iso Memory:4000 CPUs:2 DiskSize:20000 Driver:hyperv HyperkitVpnKitSock: HyperkitVSockPorts:[] DockerEnv:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.99.1/24 HypervVirtualSwitch: HypervUseExternalSwitch:false HypervExternalAdapter: KVMNetwork:default KVMQemuURI:qemu:///system KVMGPU:false KVMHidden:false DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID: NoVTXCheck:false DNSProxy:false HostDNSResolver:true HostOnlyNicType:virtio NatNicType:virtio KubernetesConfig:{KubernetesVersion:v1.18.0 ClusterName:minikube APIServerName:minikubeCA APIServerNames:[] APIServerIPs:[] DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin: FeatureGates: ServiceCIDR:10.96.0.0/12 ImageRepository: ExtraOptions:[] ShouldLoadCachedImages:true EnableDefaultCNI:false NodeIP: NodePort:0 NodeName:} Nodes:[{Name:m01 IP: Port:8443 KubernetesVersion:v1.18.0 ControlPlane:true Worker:true}] Addons:map[]}
    I0504 08:44:26.186789 5860 start.go:602] status for hyperv: {Installed:true Healthy:true Error: Fix: Doc:}
    I0504 08:44:26.187790 5860 start.go:946] Using suggested 4000MB memory alloc based on sys=16263MB, container=0MB
    I0504 08:44:26.187790 5860 iso.go:119] acquiring lock: {Name:mka7d949eb3e5814bbf3c27fa46f8ef5c69d2355 Clock:{} Delay:500ms Timeout:10m0s Cancel:}
    I0504 08:44:26.188808 5860 preload.go:81] Checking if preload exists for k8s version v1.18.0 and runtime docker
    I0504 08:44:26.188808 5860 preload.go:97] Found local preload: C:\Users\gaurav.naik.minikube\cache\preloaded-tarball\preloaded-images-k8s-v2-v1.18.0-docker-overlay2-amd64.tar.lz4
    I0504 08:44:26.188808 5860 cache.go:46] Caching tarball of preloaded images
    I0504 08:44:26.189817 5860 preload.go:123] Found C:\Users\gaurav.naik.minikube\cache\preloaded-tarball\preloaded-images-k8s-v2-v1.18.0-docker-overlay2-amd64.tar.lz4 in cache, skipping download
    I0504 08:44:26.189817 5860 cache.go:49] Finished downloading the preloaded tar for v1.18.0 on docker
    I0504 08:44:26.189817 5860 profile.go:138] Saving config to C:\Users\gaurav.naik.minikube\profiles\minikube\config.json ...
    I0504 08:44:26.192815 5860 cache.go:117] Successfully downloaded all kic artifacts
    I0504 08:44:26.192815 5860 start.go:260] acquiring machines lock for minikube: {Name:mk9247ecc4d9f263aa04a4c3cc12607cdf59a575 Clock:{} Delay:500ms Timeout:15m0s Cancel:}
    I0504 08:44:26.192815 5860 start.go:264] acquired machines lock for "minikube" in 0s
    I0504 08:44:26.194041 5860 start.go:86] Provisioning new machine with config: {Name:minikube KeepContext:false EmbedCerts:false MinikubeISO:https://storage.googleapis.com/minikube/iso/minikube-v1.9.0.iso Memory:4000 CPUs:2 DiskSize:20000 Driver:hyperv HyperkitVpnKitSock: HyperkitVSockPorts:[] DockerEnv:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.99.1/24 HypervVirtualSwitch: HypervUseExternalSwitch:false HypervExternalAdapter: KVMNetwork:default KVMQemuURI:qemu:///system KVMGPU:false KVMHidden:false DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID: NoVTXCheck:false DNSProxy:false HostDNSResolver:true HostOnlyNicType:virtio NatNicType:virtio KubernetesConfig:{KubernetesVersion:v1.18.0 ClusterName:minikube APIServerName:minikubeCA APIServerNames:[] APIServerIPs:[] DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin: FeatureGates: ServiceCIDR:10.96.0.0/12 ImageRepository: ExtraOptions:[] ShouldLoadCachedImages:true EnableDefaultCNI:false NodeIP: NodePort:0 NodeName:} Nodes:[{Name:m01 IP: Port:8443 KubernetesVersion:v1.18.0 ControlPlane:true Worker:true}] Addons:map[]} {Name:m01 IP: Port:8443 KubernetesVersion:v1.18.0 ControlPlane:true Worker:true}
    I0504 08:44:26.194102 5860 start.go:107] createHost starting for "m01" (driver="hyperv")
  • Creating hyperv VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
    I0504 08:44:26.197790 5860 start.go:143] libmachine.API.Create for "minikube" (driver="hyperv")
    I0504 08:44:26.197790 5860 client.go:169] LocalClient.Create starting
    I0504 08:44:26.197790 5860 main.go:110] libmachine: Reading certificate data from C:\Users\gaurav.naik.minikube\certs\ca.pem
    I0504 08:44:26.198800 5860 main.go:110] libmachine: Decoding PEM data...
    I0504 08:44:26.198800 5860 main.go:110] libmachine: Parsing certificate...
    I0504 08:44:26.199801 5860 main.go:110] libmachine: Reading certificate data from C:\Users\gaurav.naik.minikube\certs\cert.pem
    I0504 08:44:26.199801 5860 main.go:110] libmachine: Decoding PEM data...
    I0504 08:44:26.200793 5860 main.go:110] libmachine: Parsing certificate...
    I0504 08:44:26.200793 5860 main.go:110] libmachine: [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Module -ListAvailable hyper-v).Name | Get-Unique
    I0504 08:44:26.573815 5860 main.go:110] libmachine: [stdout =====>] : Hyper-V

I0504 08:44:26.573815 5860 main.go:110] libmachine: [stderr =====>] :
I0504 08:44:26.574792 5860 main.go:110] libmachine: [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(([System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-578")))
I0504 08:44:26.844755 5860 main.go:110] libmachine: [stdout =====>] :
I0504 08:44:26.844755 5860 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

  • @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
    
    
    

I0504 08:44:26.845757 5860 main.go:110] libmachine: exit status 1
I0504 08:44:26.845757 5860 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")
I0504 08:44:27.110982 5860 main.go:110] libmachine: [stdout =====>] :
I0504 08:44:27.110982 5860 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

  • @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
    
    
    

I0504 08:44:27.112237 5860 client.go:172] LocalClient.Create took 914.4474ms
I0504 08:44:29.113540 5860 start.go:110] createHost completed in 2.919439s
I0504 08:44:29.113540 5860 start.go:77] releasing machines lock for "minikube", held for 2.9197522s
! StartHost failed, but will try again: creating host: create: precreate: exit status 1
I0504 08:44:30.816387 5860 delete.go:45] couldn't inspect container "minikube" before deleting, docker-daemon might needs a restart!: inspecting container: output
Error: No such object: minikube
: exit status 1
I0504 08:44:30.830287 5860 delete.go:45] couldn't inspect container "minikube" before deleting, podman-daemon might needs a restart!: inspecting container: output : exec: "podman": executable file not found in %PATH%
W0504 08:44:30.830577 5860 start.go:335] delete host: Docker machine "minikube" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.
I0504 08:44:35.831162 5860 start.go:260] acquiring machines lock for minikube: {Name:mk9247ecc4d9f263aa04a4c3cc12607cdf59a575 Clock:{} Delay:500ms Timeout:15m0s Cancel:}
I0504 08:44:35.832008 5860 start.go:264] acquired machines lock for "minikube" in 845.8µs
I0504 08:44:35.834997 5860 start.go:86] Provisioning new machine with config: {Name:minikube KeepContext:false EmbedCerts:false MinikubeISO:https://storage.googleapis.com/minikube/iso/minikube-v1.9.0.iso Memory:4000 CPUs:2 DiskSize:20000 Driver:hyperv HyperkitVpnKitSock: HyperkitVSockPorts:[] DockerEnv:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.99.1/24 HypervVirtualSwitch: HypervUseExternalSwitch:false HypervExternalAdapter: KVMNetwork:default KVMQemuURI:qemu:///system KVMGPU:false KVMHidden:false DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID: NoVTXCheck:false DNSProxy:false HostDNSResolver:true HostOnlyNicType:virtio NatNicType:virtio KubernetesConfig:{KubernetesVersion:v1.18.0 ClusterName:minikube APIServerName:minikubeCA APIServerNames:[] APIServerIPs:[] DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin: FeatureGates: ServiceCIDR:10.96.0.0/12 ImageRepository: ExtraOptions:[] ShouldLoadCachedImages:true EnableDefaultCNI:false NodeIP: NodePort:0 NodeName:} Nodes:[{Name:m01 IP: Port:8443 KubernetesVersion:v1.18.0 ControlPlane:true Worker:true}] Addons:map[]} {Name:m01 IP: Port:8443 KubernetesVersion:v1.18.0 ControlPlane:true Worker:true}
I0504 08:44:35.834997 5860 start.go:107] createHost starting for "m01" (driver="hyperv")

  • Creating hyperv VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
    I0504 08:44:35.838190 5860 start.go:143] libmachine.API.Create for "minikube" (driver="hyperv")
    I0504 08:44:35.838190 5860 client.go:169] LocalClient.Create starting
    I0504 08:44:35.838995 5860 main.go:110] libmachine: Reading certificate data from C:\Users\gaurav.naik.minikube\certs\ca.pem
    I0504 08:44:35.838995 5860 main.go:110] libmachine: Decoding PEM data...
    I0504 08:44:35.838995 5860 main.go:110] libmachine: Parsing certificate...
    I0504 08:44:35.840002 5860 main.go:110] libmachine: Reading certificate data from C:\Users\gaurav.naik.minikube\certs\cert.pem
    I0504 08:44:35.840002 5860 main.go:110] libmachine: Decoding PEM data...
    I0504 08:44:35.840002 5860 main.go:110] libmachine: Parsing certificate...
    I0504 08:44:35.840995 5860 main.go:110] libmachine: [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Module -ListAvailable hyper-v).Name | Get-Unique
    I0504 08:44:36.231995 5860 main.go:110] libmachine: [stdout =====>] : Hyper-V

I0504 08:44:36.231995 5860 main.go:110] libmachine: [stderr =====>] :
I0504 08:44:36.232997 5860 main.go:110] libmachine: [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(([System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-578")))
I0504 08:44:36.513996 5860 main.go:110] libmachine: [stdout =====>] :
I0504 08:44:36.513996 5860 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

  • @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
    
    
    

I0504 08:44:36.514996 5860 main.go:110] libmachine: exit status 1
I0504 08:44:36.514996 5860 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")
I0504 08:44:36.788452 5860 main.go:110] libmachine: [stdout =====>] :
I0504 08:44:36.788452 5860 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

  • @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
    
    
    

I0504 08:44:36.789452 5860 client.go:172] LocalClient.Create took 950.4582ms
I0504 08:44:38.790093 5860 start.go:110] createHost completed in 2.955098s
I0504 08:44:38.790093 5860 start.go:77] releasing machines lock for "minikube", held for 2.955098s

  • StartHost failed again: creating host: create: precreate: exit status 1
    • Run: "minikube delete", then "minikube start --alsologtostderr -v=1" to try again with more logging

E0504 08:44:38.793086 5860 style.go:173] unable to parse "X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible\n": template: X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible
:1: malformed character constant: 'minikube delete' - returning raw string.
X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible

C:\windows\system32>

Full output of minikube start command used, if not already included:

C:\windows\system32>minikube start

  • minikube v1.9.0 on Microsoft Windows 10 Enterprise 10.0.18362 Build 18362
  • Automatically selected the hyperv driver. Other choices: docker, virtualbox
  • Creating hyperv VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
    ! StartHost failed, but will try again: creating host: create: precreate: exit status 1
  • Creating hyperv VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
  • StartHost failed again: creating host: create: precreate: exit status 1
    • Run: "minikube delete", then "minikube start --alsologtostderr -v=1" to try again with more logging

Optional: Full output of minikube logs command:

@sharifelgamal sharifelgamal added co/hyperv HyperV related issues kind/bug Categorizes issue or PR as related to a bug. os/windows kind/support Categorizes issue or PR as a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels May 4, 2020
@sharifelgamal
Copy link
Collaborator

This seems to be an issue with the permissions in your terminal:

I0504 08:44:26.844755 5860 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

@([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
  + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
  + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage

Although I was not able to reproduce this issue (I was able to build minikube in a elevated powershell in ContrainedLanguage mode), I believe that's the source of the error. Have you tried using a regular admin terminal?

@Jack881
Copy link
Author

Jack881 commented May 5, 2020 via email

@medyagh
Copy link
Member

medyagh commented May 13, 2020

@Jack881 do u mind trying with out latest version v1.0.1 ?

@priyawadhwa
Copy link

priyawadhwa commented Jun 3, 2020

Hey @Jack881 are you still seeing this issue with the latest version v1.11.0?

@priyawadhwa priyawadhwa added the triage/needs-information Indicates an issue needs more information in order to work on it. label Jun 3, 2020
@Jack881
Copy link
Author

Jack881 commented Jun 3, 2020 via email

@medyagh
Copy link
Member

medyagh commented Jun 3, 2020

Yes I am still facing issue

On Wed, 3 Jun, 2020, 11:41 PM priyawadhwa, @.***> wrote: Hey @Jack881 https://github.com/Jack881 are you still seeing this issue with the latest version v1.11.0 https://github.com/kubernetes/minikube/releases/tag/v1.11.0? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#7990 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOP2FPRVTL4VEKXBPJ5QP3RU2G53ANCNFSM4MYNKZDA .

have you tried with administrative powershell ?

@medyagh medyagh changed the title Unable to start minikube hyperv: Unable to start minikube Jun 3, 2020
@medyagh medyagh changed the title hyperv: Unable to start minikube hyperv: Method invocation is supported only on core types in this language mode. At line:1 char:1 Jun 3, 2020
@medyagh medyagh changed the title hyperv: Method invocation is supported only on core types in this language mode. At line:1 char:1 hyperv: Method invocation is supported only on core types in this language mode. Jun 3, 2020
@Jack881
Copy link
Author

Jack881 commented Jun 4, 2020 via email

@medyagh
Copy link
Member

medyagh commented Jun 8, 2020

@Jack881
I noticed you are using an older minikube verison, have u tried the latest verison ?
and also have you tried out newest driver Docker Driver with latest version of minikube?
you could try
minikube delete
minikube start --driver=docker

for more information on the docker driver checkout:
https://minikube.sigs.k8s.io/docs/drivers/docker/

@tstromberg tstromberg added needs-solution-message Issues where where offering a solution for an error would be helpful long-term-support Long-term support issues that can't be fixed in code and removed triage/needs-information Indicates an issue needs more information in order to work on it. kind/support Categorizes issue or PR as a support question. labels Jun 10, 2020
@tstromberg
Copy link
Contributor

This happens if PSLockDown is set: https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/

The Hyper-V driver currently requires PowerShell scripting to work. We should give this error message a solution which mentions how to adjust PSLockDown.

@medyagh medyagh added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed long-term-support Long-term support issues that can't be fixed in code labels Jun 10, 2020
@medyagh medyagh added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Jun 10, 2020
@medyagh
Copy link
Member

medyagh commented Jun 10, 2020

I would be happy to review any PR that detects this and suggests to the user in powershell to do the solution mentioned in #7990 (comment)

@tstromberg tstromberg added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Jul 22, 2020
@tstromberg tstromberg self-assigned this Sep 1, 2020
@priyawadhwa priyawadhwa added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Nov 6, 2020
@sharifelgamal
Copy link
Collaborator

A better error message would be helpful here.

@spowelljr spowelljr added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/ux lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-solution-message Issues where where offering a solution for an error would be helpful os/windows priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

6 participants