The Wayback Machine - https://web.archive.org/web/20201110182720/https://github.com/kubernetes/minikube/issues/9589
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

Wrong error message on minikube tunnel without Administrator privilege on Windows #9589

Open
blueelvis opened this issue Oct 30, 2020 · 3 comments

Comments

@blueelvis
Copy link
Member

@blueelvis blueelvis commented Oct 30, 2020

Steps to reproduce the issue:

  1. minikube start --driver hyperv
  2. Open a Command Prompt/PowerShell session without the Administrator privileges.
  3. minikube tunnel

Full output of failed command:

PS D:\dev\minikube> minikube tunnel --alsologtostderr
W1031 01:48:47.640326   45344 root.go:252] Error reading config file at C:\Users\Pranav.Jituri\.minikube\config\config.json: open C:\Users\Pranav.Jituri\.minikube\config\config.json: The system cannot find the file specified.
I1031 01:48:47.650327   45344 mustload.go:66] Loading cluster: minikube
I1031 01:48:47.654882   45344 main.go:115] libmachine: [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state
I1031 01:48:48.560370   45344 main.go:115] libmachine: [stdout =====>] :
E1031 01:48:48.560370   45344 main.go:111] libmachine: [stderr =====>] : Hyper-V\Get-VM : You do not have the required permission to complete this task. Contact the administrator of the authorization policy for the computer 'DESKTOP'.
At line:1 char:3
+ ( Hyper-V\Get-VM minikube ).state
+   ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-VM], VirtualizationException
    + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.GetVM


I1031 01:48:48.571373   45344 out.go:109] * The control plane node "" does not exist.
* The control plane node "" does not exist.
I1031 01:48:48.583371   45344 out.go:109]   - To fix this, run: "minikube start"
  - To fix this, run: "minikube start"

Instead of saying that the control plane doesn't exist, this should be throwing the following kind of error -

{
		Kind: Kind{
			ID:       "PR_HYPERV_AS_ADMIN",
			ExitCode: ExProviderPermission,
			Advice:   "Right-click the PowerShell icon and select Run as Administrator to open PowerShell in elevated mode.",
			URL:      "https://rominirani.com/docker-machine-windows-10-hyper-v-troubleshooting-tips-367c1ea73c24",
			Issues:   []int{4511},
		},
		Regexp: re(`Hyper-v commands have to be run as an Administrator`),
		GOOS:   []string{"windows"},
	},
@blueelvis blueelvis changed the title Wrong error message on minikube tunnel without Administrator privilege Wrong error message on minikube tunnel without Administrator privilege on Windows Oct 30, 2020
@priyawadhwa
Copy link
Collaborator

@priyawadhwa priyawadhwa commented Nov 5, 2020

Hey @blueelvis thanks for opening this issue, the error message could definitely be more helpful. If you, or anyone else, would be interested in fixing this I'd be happy to look at the PR

@alien19880726
Copy link

@alien19880726 alien19880726 commented Nov 9, 2020

@blueelvis Hi, maybe we can add an advisement, such as log info in the following pic:
image

@alien19880726
Copy link

@alien19880726 alien19880726 commented Nov 9, 2020

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.