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

Trailing slash on "localhost:5681/meshes/default/meshtraces/" causes "internal server error" #5705

Closed
lahabana opened this issue Jan 16, 2023 · 2 comments · Fixed by #5719
Closed
Assignees
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@lahabana
Copy link
Contributor

What happened?

It works with a slash

@lahabana lahabana added triage/pending This issue will be looked at on the next triage meeting kind/bug A bug labels Jan 16, 2023
@lahabana
Copy link
Contributor Author

Error:

2023-01-16T13:31:57.901Z	ERROR	Could not retrieve a resource	{"error": "name \"\" must include namespace after the dot, ex. \"name.namespace\"", "errorVerbose": "name \"\" must include namespace after the dot, ex. \"name.namespace\"\ngithub.com/kumahq/kuma/pkg/util/k8s.CoreNameToK8sName\n\tgithub.com/kumahq/kuma/pkg/util/k8s/name_converter.go:13\ngithub.com/kumahq/kuma/pkg/plugins/resources/k8s.k8sNameNamespace\n\tgithub.com/kumahq/kuma/pkg/plugins/resources/k8s/store.go:212\ngithub.com/kumahq/kuma/pkg/plugins/resources/k8s.(*KubernetesStore).Get\n\tgithub.com/kumahq/kuma/pkg/plugins/resources/k8s/store.go:148\ngithub.com/kumahq/kuma/pkg/core/resources/store.(*paginationStore).Get\n\tgithub.com/kumahq/kuma/pkg/core/resources/store/pagination_store.go:42\ngithub.com/kumahq/kuma/pkg/metrics/store.(*MeteredStore).Get\n\tgithub.com/kumahq/kuma/pkg/metrics/store/store.go:62\ngithub.com/kumahq/kuma/pkg/core/resources/store.(*customizableResourceStore).Get\n\tgithub.com/kumahq/kuma/pkg/core/resources/store/customizable_store.go:22\ngithub.com/kumahq/kuma/pkg/core/resources/manager.(*resourcesManager).Get\n\tgithub.com/kumahq/kuma/pkg/core/resources/manager/manager.go:43\ngithub.com/kumahq/kuma/pkg/core/resources/manager.(*customizableResourceManager).Get\n\tgithub.com/kumahq/kuma/pkg/core/resources/manager/customizable_manager.go:43\ngithub.com/kumahq/kuma/pkg/api-server.(*resourceEndpoints).findResource\n\tgithub.com/kumahq/kuma/pkg/api-server/resource_endpoints.go:64\ngithub.com/emicklei/go-restful/v3.(*FilterChain).ProcessFilter\n\tgithub.com/emicklei/go-restful/[email protected]/filter.go:23\ngithub.com/emicklei/go-restful/v3.CrossOriginResourceSharing.Filter\n\tgithub.com/emicklei/go-restful/[email protected]/cors_filter.go:53\ngithub.com/emicklei/go-restful/v3.(*FilterChain).ProcessFilter\n\tgithub.com/emicklei/go-restful/[email protected]/filter.go:21\ngithub.com/kumahq/kuma/pkg/plugins/authn/api-server/tokens.UserTokenAuthenticator.func1\n\tgithub.com/kumahq/kuma/pkg/plugins/authn/api-server/tokens/authenticator.go:34\ngithub.com/emicklei/go-restful/v3.(*FilterChain).ProcessFilter\n\tgithub.com/emicklei/go-restful/[email protected]/filter.go:21\ngithub.com/kumahq/kuma/pkg/util/prometheus.MetricsHandler.func1.1\n\tgithub.com/kumahq/kuma/pkg/util/prometheus/gorestful_middleware.go:21\ngithub.com/slok/go-http-metrics/middleware.Middleware.Measure\n\tgithub.com/slok/[email protected]/middleware/middleware.go:117\ngithub.com/kumahq/kuma/pkg/util/prometheus.MetricsHandler.func1\n\tgithub.com/kumahq/kuma/pkg/util/prometheus/gorestful_middleware.go:20\ngithub.com/emicklei/go-restful/v3.(*FilterChain).ProcessFilter\n\tgithub.com/emicklei/go-restful/[email protected]/filter.go:21\ngithub.com/emicklei/go-restful/v3.(*Container).dispatch\n\tgithub.com/emicklei/go-restful/[email protected]/container.go:296\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2084\nnet/http.(*ServeMux).ServeHTTP\n\tnet/http/server.go:2462\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2916\nnet/http.(*conn).serve\n\tnet/http/server.go:1966\nruntime.goexit\n\truntime/asm_arm64.s:1270"}

@lahabana
Copy link
Contributor Author

xref: #4985 the error is similar but the cause different

@lahabana lahabana self-assigned this Jan 16, 2023
@lahabana lahabana added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Jan 16, 2023
lahabana added a commit to lahabana/kuma that referenced this issue Jan 16, 2023
Before we were returning 500 when resource was not in the format
`<name>.<namespace>`
We now return a typed error in the store and have the api-server map the
error to a 400

Fix kumahq#5705
Fix kumahq#4985

Signed-off-by: Charly Molter <[email protected]>
lahabana added a commit to lahabana/kuma that referenced this issue Jan 17, 2023
Before we were returning 500 when resource was not in the format
`<name>.<namespace>`
We now return a typed error in the store and have the api-server map the
error to a 400

Fix kumahq#5705
Fix kumahq#4985

Signed-off-by: Charly Molter <[email protected]>
lahabana added a commit that referenced this issue Jan 17, 2023
Before we were returning 500 when resource was not in the format
`<name>.<namespace>`
We now return a typed error in the store and have the api-server map the
error to a 400

Fix #5705
Fix #4985

Signed-off-by: Charly Molter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant