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

Windows 10 WSL - "cannot allocate memory" when calling a plugin #603

Closed
jon-walton opened this issue Mar 9, 2019 · 11 comments · Fixed by kubernetes/kubernetes#76227
Closed
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@jon-walton
Copy link

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): no

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): windows; allocate


Is this a BUG REPORT or FEATURE REQUEST? (choose one): bug report

Kubernetes version (use kubectl version): Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:08:12Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): Windows 10.0.17763 / Ubuntu 18.04.2 LTS
  • Kernel (e.g. uname -a): Linux DESKTOP-3I1L0FQ 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
  • Others:

What happened:

kubectl often returns cannot allocate memory instead of executing a plugin. Calling the plugin directly always works.

What you expected to happen:

calling the plugin via kubectl to work as if called directly

How to reproduce it (as minimally and precisely as possible):

Use the example plugin from https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/#example-plugin

$ k plugin list
The following kubectl-compatible plugins are available:

/home/jon/.kube/plugins/kubectl-foo

kubectl often returns cannot allocate memory instead of executing the plugin.

$ k foo
cannot allocate memory
$ k foo version
1.0.0
$ k foo version
cannot allocate memory
$ k foo version
cannot allocate memory
$ k foo
cannot allocate memory
$ k foo
cannot allocate memory
$ k foo
cannot allocate memory
$ k foo
cannot allocate memory
$ k foo
I am a plugin named kubectl-foo
$ k foo
cannot allocate memory

executing the plugin directly always works

$ kubectl-foo version
1.0.0
$ kubectl-foo
I am a plugin named kubectl-foo
$ kubectl-foo version
1.0.0
$ kubectl-foo version
1.0.0
$ kubectl-foo version
1.0.0
$ kubectl-foo version
1.0.0
$ kubectl-foo version
1.0.0

Anything else we need to know:

This also happens with windows compatible plugins when called directly from Windows 10, rather then WSL; however it's easier for me to provide details using linux tooling.

Here's a strace -o kubectl -ff -y kubectl foo version
kubectl.zip

@jon-walton
Copy link
Author

Here's a strace -o kubectl -ff -y kubectl foo version of it working
kubectl-works.zip

@sawlanipradeep-zz
Copy link

sawlanipradeep-zz commented Apr 5, 2019

I am also having issue installing Krew on Windows and got here from kubernetes-sigs/krew#156
@jon-walton Looking at the description, error message you have are for Linux. For windows I see following

PS C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin> kubectl krew --help
not supported by windows
PS C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin>

I tried different plugins but same error. kubectl version is this:

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b
1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:08:12Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"windows/amd64"}

Windows version: Microsoft Windows Server 2012 R2 Datacenter

@sawlanipradeep-zz
Copy link

kubectl calls Exec which on windows returns error (https://golang.org/src/syscall/exec_windows.go)
May be kubectl should be using StartProcess instead of Exec on Windows.

@spacecat
Copy link

spacecat commented May 22, 2019

Also getting not supported by windows:

PS C:\krew-temp\krew> kubectl krew
not supported by windows

Ran the following command in an elevated PowerShell and it installed successfully:

.\krew-windows_amd64.exe install --manifest=krew.yaml --archive=krew.zip

kubectl version:

clientVersion:
  buildDate: "2019-03-25T15:53:57Z"
  compiler: gc
  gitCommit: 641856db18352033a0d96dbc99153fa3b27298e5
  gitTreeState: clean
  gitVersion: v1.14.0
  goVersion: go1.12.1
  major: "1"
  minor: "14"
  platform: windows/amd64
serverVersion:
  buildDate: "2019-03-25T06:30:48Z"
  compiler: gc
  gitCommit: 16236ce91790d4c75b79f6ce96841db1c843e7d2
  gitTreeState: clean
  gitVersion: v1.11.9
  goVersion: go1.10.8
  major: "1"
  minor: "11"
  platform: linux/amd64

Windows version:

Windows 10 Pro

Got here from kubernetes-sigs/krew#156

Installed krew version:

https://github.com/kubernetes-sigs/krew/releases/tag/v0.2.1

@seans3
Copy link
Contributor

seans3 commented May 22, 2019

/sig cli
/area kubectl
/kind bug

@seans3 seans3 added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. kind/bug Categorizes issue or PR as related to a bug. labels May 22, 2019
@jon-walton
Copy link
Author

I just updated to Windows 10 1903 (10.0.18362) and can no longer reproduce this under WSL.

Can anyone else confirm?

@User5910
Copy link

User5910 commented Sep 11, 2019

I can't run any plugin on Windows. I'm using kubectl 1.15.2* on Windows 10 Enterprise 1903 Version 10.0.18362.295 and it always fails with

not supported by windows

@spacecat, are you still seeing this?

* Downloaded from https://storage.googleapis.com/kubernetes-release/release/v1.15.2/bin/windows/amd64/kubectl.exe

EDIT: I see the fix for this bug is in the 1.16 branch. Never mind, I spoke too soon.

@GimmeDaKitty
Copy link

I just updated to Windows 10 1903 (10.0.18362) and can no longer reproduce this under WSL.

Can anyone else confirm?

Updating Windows 10 did not fix the issue for me. Still getting not supported by windows
If I use kubectl-krew (with the dash) it does work however.

@fkleedorfer
Copy link

Experiencing this under Windows 10 (10.0.17763) and kubectl 1.19, getting cannot allocate memory for most calls as described by the OP

@uvwild
Copy link

uvwild commented Nov 13, 2020

me too for
kubectl krew list
same versions

@tace
Copy link

tace commented Jan 10, 2021

Windows 10 1809 and WSL1, most of krew calls I get "cannot allocate memory". I'm using ConEmu terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants