Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
issue/bug
Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTre
eState:"clean", BuildDate:"2018-04-27T09:22:21Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Environment:
uname -a):What happened:
kubectl : error: Error loading config file "C:Userscg.kube": read C:Userscg.kube: The handle is invalid.
At line:1 char:1
I have installed and uninstalled and reinstalle kubectl. I have set different paths i have moved the files around. No dice.
What you expected to happen:
none of the action commands work even kubectl config view returns the above
How to reproduce it (as minimally and precisely as possible):
run kubectl config view.
Anything else we need to know:
I would assume that it is some odd configuration i must have since this does not appear to be reported. But its a standard windows box. I connected up to the master in Azure and copied the config file down I also rebuilt it from scratch using kubectl commands
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/kind bug
/sig cli
/area kubectl
/priority P3
/remove-lifecycle rotten
I had this problem, solved it by setting the KUBECONFIG environmental variable like:
$env:KUBECONFIG="C:\Users\your_user_name\.kube\config"
On PowerShell
Another reason this could happen is if the actual KUBECONFIG environmental variable is set to an incorrect location or file. You can solve that by simply setting it to nothing/empty like this:
$env:KUBECONFIG="" on power shell and verify it like this:
$env:KUBECONFIG
Hi, guys!
For me it works:
%USERPROFILE%\.kube\prod.kubeconfig;%USERPROFILE%\.kube\dev.kubeconfig
Environment:
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0
eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:55:54Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/am
d64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.3", GitCommit:"435f92c719f279a3a67808c80521ea17d57
15c66", GitTreeState:"clean", BuildDate:"2018-11-26T12:46:57Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd
64"}
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen.
Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Most helpful comment
I had this problem, solved it by setting the KUBECONFIG environmental variable like:
$env:KUBECONFIG="C:\Users\your_user_name\.kube\config"On PowerShell
Another reason this could happen is if the actual KUBECONFIG environmental variable is set to an incorrect location or file. You can solve that by simply setting it to nothing/empty like this:
$env:KUBECONFIG=""on power shell and verify it like this:$env:KUBECONFIG