kubernetes / minikube

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

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

Open Jack881 opened 4 years ago

Jack881 commented 4 years ago

Steps to reproduce the issue:

1.minikube start

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

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

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

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")

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

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

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

C:\windows\system32>

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

C:\windows\system32>minikube start

Optional: Full output of minikube logs command:

sharifelgamal commented 4 years ago

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 commented 4 years ago

Hi,

Thank you for your reply.

I have changed the registry value of PSLockDown to 8 and it is working fine now. There is another issue registry value is keep changing to 4 now. is there any way to fix the registry value to 8

Regards, Gaurav Naik

On Tue, 5 May, 2020, 9:48 PM Sharif Elgamal, notifications@github.com wrote:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kubernetes/minikube/issues/7990#issuecomment-624153456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOP2FOD4KNIERJMSG3QYVDRQA36NANCNFSM4MYNKZDA .

medyagh commented 4 years ago

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

priyawadhwa commented 4 years ago

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

Jack881 commented 4 years ago

Yes I am still facing issue

On Wed, 3 Jun, 2020, 11:41 PM priyawadhwa, notifications@github.com 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 https://github.com/kubernetes/minikube/issues/7990#issuecomment-638370710, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOP2FPRVTL4VEKXBPJ5QP3RU2G53ANCNFSM4MYNKZDA .

medyagh commented 4 years ago

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 ?

Jack881 commented 4 years ago

Yes I am trying with admin privileges and after every reboot I have to change the registry value

On Thu, 4 Jun, 2020, 4:47 AM Medya Ghazizadeh, notifications@github.com wrote:

Yes I am still facing issue … <#m-7538877095679038270> On Wed, 3 Jun, 2020, 11:41 PM priyawadhwa, @.***> wrote: Hey @Jack881 https://github.com/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) https://github.com/kubernetes/minikube/issues/7990#issuecomment-638370710>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOP2FPRVTL4VEKXBPJ5QP3RU2G53ANCNFSM4MYNKZDA .

have you tried with administrative powershell ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/minikube/issues/7990#issuecomment-638509615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOP2FJAV3NQUCFGXGHZQQDRU3KYVANCNFSM4MYNKZDA .

medyagh commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

I would be happy to review any PR that detects this and suggests to the user in powershell to do the solution mentioned in https://github.com/kubernetes/minikube/issues/7990#issuecomment-642183515

sharifelgamal commented 3 years ago

A better error message would be helpful here.