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

Lingering "apiserver received an error that is not an api.Status" errors #11069

Closed
a-robinson opened this issue Jul 10, 2015 · 6 comments
Closed
Assignees
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@a-robinson
Copy link
Contributor

When running 0.21.1 I've seen a couple different types of errors returned as 500s due to errors not being of the correct type. In both cases, it's causing 500s to be returned where it looks like 404s would be much more appropriate.

First when trying to proxy to an endpoint that has no endpoints:

E0710 12:23:52.937913       5 errors.go:62] apiserver received an error that is not an api.Status: no endpoints availabl
e for "redacted"
I0710 12:23:52.938225       5 handlers.go:137] GET /api/v1beta3/proxy/namespaces/default/services/redacted/redacted
: (1.287423ms) 500
goroutine 973 [running]:
github.com/GoogleCloudPlatform/kubernetes/pkg/httplog.(*respLogger).WriteHeader(0xc20953a9c0, 0x1f4)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kuber
netes/pkg/httplog/log.go:188 +0x9a
github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver.writeJSON(0x1f4, 0x7f2bbbbbe2b0, 0xc2080b0660, 0x7f2bbbbbe4c8, 0
xc20952c280, 0x7f2bbba11080, 0xc20953a9c0, 0x1)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kuber
netes/pkg/apiserver/apiserver.go:278 +0x2b7
github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver.(*ProxyHandler).ServeHTTP(0xc208279d10, 0x7f2bbba11080, 0xc20953
a9c0, 0xc209a789c0)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kuber
netes/pkg/apiserver/proxy.go:118 +0xcb9
github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver.func·002(0xc209d0b290, 0xc208d02500)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kuber
netes/pkg/apiserver/api_installer.go:732 +0x60
github.com/emicklei/go-restful.func·005(0xc209d0b290, 0xc208d02500)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/Godeps/_workspace/src/github.com/emicklei/go-restful/container
.go:215 +0x41
github.com/emicklei/go-restful.(*FilterChain).ProcessFilter(0xc209d0b320, 0xc209d0b290, 0xc208d02500)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/Godeps/_workspace/src/github.com/emicklei/go-restful/filter.go
:21 +0xa2
github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver.func·003(0xc209d0b290, 0xc208d02500, 0xc209d0b320)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kuber
netes/pkg/apiserver/apiserver.go:59 +0x88
github.com/emicklei/go-restful.(*FilterChain).ProcessFilter(0xc209d0b320, 0xc209d0b290, 0xc208d02500)
        /go/src/github.com/GoogleCloudPlatform/kubernetes/Godeps/_workspace/src/github.com/emicklei/go-restful/filter.go
:19
Error getting ResourceLocation: no endpoints available for "redacted" [[redacted] redacted]

Also when trying to PUT an rc that doesn't exist

I0710 15:35:50.874866       6 handlers.go:137] PUT /api/v1/namespaces/redacted/replicationcontrollers/webserver: (29.893146ms) 500
E0710 15:35:50.874707       6 errors.go:62] apiserver received an error that is not an api.Status: 100: Key not found (/registry/controllers/redacted/webserver) [2258]

cc @lavalamp

@a-robinson a-robinson added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. team/master labels Jul 10, 2015
@nikhiljindal
Copy link
Contributor

I can take this

@nikhiljindal nikhiljindal self-assigned this Jul 10, 2015
@a-robinson a-robinson added this to the v1.0-candidate milestone Jul 10, 2015
@a-robinson
Copy link
Contributor Author

Thanks Nikhil!

@nikhiljindal
Copy link
Contributor

This is working fine for me on HEAD

  1. Getting service without endpoint: I created the following service without any spec.selector
apiVersion: v1
kind: Service
metadata:
  name: frontend
  labels:
    name: frontend
spec:
  ports:
  - port: 80

Since there is no selector, there is no endpoint created. Now when I do GET api/v1/proxy/namespaces/default/services/frontend, I get:

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "endpoints \"frontend\" not found",
  "reason": "NotFound",
  "details": {
    "name": "frontend",
    "kind": "endpoints"
  },
  "code": 404
}

which is as expected.

  1. PUT on an rc that doesnt exist, I tried: curl -X PUT http://<masterIP>/api/v1/namespaces/default/replicationcontrollers/fdds -d @/tmp/rc.yaml and I get:
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "replicationControllers \"fdds\" not found",
  "reason": "NotFound",
  "details": {
    "name": "fdds",
    "kind": "replicationControllers"
  },
  "code": 404
}

as expected.

So everything seems WAI on HEAD to me. @a-robinson Am I doing something wrong?

@nikhiljindal
Copy link
Contributor

The second one if reproable, seems to be an etcd error: #10064

@nikhiljindal
Copy link
Contributor

ok. I can repro the first one, when I create a service with selectors. It fails because there is no rc backing the service.

@nikhiljindal
Copy link
Contributor

#11076 fixes the first case.
The second one will be fixed as part of #10064

@goltermann goltermann modified the milestones: v1.0-post, v1.0-candidate Jul 14, 2015
@bgrant0607 bgrant0607 removed this from the v1.0-post milestone Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

4 participants