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

kubectl get --raw /apis/* works incorrect on windows and git minigw xterm like terminal #594

Closed
tarvitz opened this issue Mar 3, 2019 · 8 comments
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/P2 sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@tarvitz
Copy link

tarvitz commented Mar 3, 2019


Is this a BUG REPORT:

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:37:52Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T20:56:12Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: From scratch / server independent due to linux version of kubectl works properly.
  • OS (e.g. from /etc/os-release):
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
  • Kernel (e.g. uname -a):
Linux k8s.w40k.net 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
  • Others: Running kubectl on windows 10 x64 in git's minigw xterm like terminal
$ git --version
git version 2.21.0.windows.1

What happened:

kubectl get --raw /apis/apps/v1

does not work, neither works any other apis .

What you expected to happen:
If it works properly

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

#: type
kubectl get --raw /apis/apps/v1 -v 10

#: recieve
I0303 02:58:14.114842   18760 loader.go:359] Config loaded from file C:\Users\Tarvitz/.kube/config
I0303 02:58:14.153842   18760 round_trippers.go:419] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl.exe/v1.13.4 (windows/amd64) kubernetes/c27b913" 'https://178.79.148.185:6443/Program%20Files/Git/apis/apps/v1'
I0303 02:58:14.387840   18760 round_trippers.go:438] GET https://178.79.148.185:6443/Program%20Files/Git/apis/apps/v1 404 Not Found in 233 milliseconds
I0303 02:58:14.387840   18760 round_trippers.go:444] Response Headers:
I0303 02:58:14.387840   18760 round_trippers.go:447]     Content-Type: application/json
I0303 02:58:14.387840   18760 round_trippers.go:447]     Content-Length: 563
I0303 02:58:14.387840   18760 round_trippers.go:447]     Date: Sat, 02 Mar 2019 23:58:15 GMT
I0303 02:58:14.387840   18760 request.go:942] Response Body: {
  "paths": [
    "/apis",
    "/apis/",
    "/apis/apiextensions.k8s.io",
    "/apis/apiextensions.k8s.io/v1beta1",
    "/healthz",
    "/healthz/etcd",
    "/healthz/log",
    "/healthz/ping",
    "/healthz/poststarthook/generic-apiserver-start-informers",
    "/healthz/poststarthook/start-apiextensions-controllers",
    "/healthz/poststarthook/start-apiextensions-informers",
    "/metrics",
    "/openapi/v2",
    "/swagger-2.0.0.json",
    "/swagger-2.0.0.pb-v1",
    "/swagger-2.0.0.pb-v1.gz",
    "/swagger.json",
    "/swaggerapi",
    "/version"
  ]
}
I0303 02:58:14.387840   18760 request.go:1144] body was not decodable (unable to check for Status): Object 'Kind' is missing in '{
  "paths": [
    "/apis",
    "/apis/",
    "/apis/apiextensions.k8s.io",
    "/apis/apiextensions.k8s.io/v1beta1",
    "/healthz",
    "/healthz/etcd",
    "/healthz/log",
    "/healthz/ping",
    "/healthz/poststarthook/generic-apiserver-start-informers",
    "/healthz/poststarthook/start-apiextensions-controllers",
    "/healthz/poststarthook/start-apiextensions-informers",
    "/metrics",
    "/openapi/v2",
    "/swagger-2.0.0.json",
    "/swagger-2.0.0.pb-v1",
    "/swagger-2.0.0.pb-v1.gz",
    "/swagger.json",
    "/swaggerapi",
    "/version"
  ]
}'
I0303 02:58:14.387840   18760 helpers.go:198] server response object: [{
  "metadata": {},
  "status": "Failure",
  "message": "the server could not find the requested resource",
  "reason": "NotFound",
  "details": {
    "causes": [
      {
        "reason": "UnexpectedServerResponse",
        "message": "unknown"
      }
    ]
  },
  "code": 404
}]
F0303 02:58:14.387840   18760 helpers.go:116] Error from server (NotFound): the server could not find the requested resource

Anything else we need to know:
URI for sending request by kubectl is wrong apparently:
I0303 02:58:14.153842 18760 round_trippers.go:419] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl.exe/v1.13.4 (windows/amd64) kubernetes/c27b913" 'https://178.79.148.185:6443/Program%20Files/Git/apis/apps/v1'
Tried with version of kubectl got by link: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-curl

Probably it's related to git's minigw terminal may be it's not, however URI request sending to server is obviously not good. kubectl running in cmd and powershell works fine.

@novinfor
Copy link

I think it is MSYS subsystem issue (e.g. see docker-archive/toolbox#673).

As a workaround run with:
MSYS_NO_PATHCONV=1 kubectl get --raw /apis/apps/v1
Or create an alias:
alias kubectl='MSYS_NO_PATHCONV=1 kubectl'

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 28, 2019
@seans3
Copy link
Contributor

seans3 commented Aug 28, 2019

/remove-lifecycle stale
/kind bug
/sig cli
/area kubectl
/priority P2

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI. area/kubectl priority/P2 and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 28, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 26, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 26, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot
Copy link
Contributor

@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.

@junandaip
Copy link

I'm using git bash and I've wasted hours of reinstalling and reconfiguring metric-server because everytime i try to do "kubectl get /apis/*" it's always returned "Error from server (NotFound): the server could not find the requested resource".

Glad to know the error is from the Windows system.

Here's me trying to get the api via Git Bash
image

and here's me using the CMD
image

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. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/P2 sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
Development

No branches or pull requests

6 participants