probo icon indicating copy to clipboard operation
probo copied to clipboard

Dedicated API error when tenant is not found

Open gearnode opened this issue 1 year ago • 3 comments

Returns a real API error in case tenant was not found.

{"environment":"prod","http_server_addr":"0.0.0.0:8080","http_request_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36","http_request_flavor":"HTTP/1.1","http_request_method":"POST","time":"2025-07-18T12:01:41.653402621Z","http_request_path":"/api/console/v1/query","http_request_client_ip":"10.1.1.12:31710","version":"0.42.1","http_request_id":"01981d69-5f05-7000-be15-3abe705709b0","http_request_host":"us.console.getprobo.com","name":"probod.http.server","msg":"resolver panic","stack":"goroutine 57829 [running]:\nruntime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x5e\ngithub.com/getprobo/probo/pkg/server/api/console/v1.graphqlHandler.func1({0x221de30?, 0xc000aede00?}, {0x1945060, 0xc000aeee00})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/resolver.go:238 +0xe5\ngithub.com/99designs/gqlgen/graphql.(*OperationContext).Recover(0x43ed60?, {0x221de30, 0xc000aede00}, {0x1945060?, 0xc000aeee00?})\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/context_operation.go:125 +0x38\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query_node.func1()\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:28623 +0x6e\npanic({0x1945060?, 0xc000aeee00?})\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x132\ngithub.com/getprobo/probo/pkg/server/api/console/v1.GetTenantService({0x221de30?, 0xc000aede00?}, 0xc0000ac7e0, {0x88, 0x94, 0x7b, 0x7a, 0x37, 0x7b, 0x0, ...})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/resolver.go:354 +0xb3\ngithub.com/getprobo/probo/pkg/server/api/console/v1.(*Resolver).ProboService(...)\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/resolver.go:338\ngithub.com/getprobo/probo/pkg/server/api/console/v1.(*queryResolver).Node(0xc0008f85b8?, {0x221de30, 0xc000aede00}, {0x88, 0x94, 0x7b, 0x7a, 0x37, 0x7b, 0x0, ...})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/v1_resolver.go:2543 +0x65\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query_node.func2({0x221de30, 0xc000aede00})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:28629 +0xef\ngithub.com/99designs/gqlgen/graphql/executor.processExtensions.func4({0x221de30?, 0xc000aede00?}, 0xc0004cf930?)\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/extensions.go:73 +0x22\ngithub.com/99designs/gqlgen/graphql/executor.processExtensions.func8.1({0x221de30?, 0xc000aede00?})\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/extensions.go:111 +0x25\ngithub.com/getprobo/probo/pkg/server/api/console/v1.tracingExtension.InterceptField({}, {0x221de30, 0xc000aede00}, 0xc0005f1db8)\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/tracing_extensions.go:61 +0x688\ngithub.com/99designs/gqlgen/graphql/executor.processExtensions.func8({0x221de30, 0xc000aede00}, 0xc000743900)\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/extensions.go:110 +0xa2\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query_node(0xc000743800, {0x221de30, 0xc000aedd10}, {0xc000ac2c60, {0xc000aedcb0, 0x3, 0x3}, 0x0})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:28627 +0x204\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query.func1({0x221de30?, 0xc000aedd10?}, 0xc0006c9a90)\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:47911 +0x91\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query.func2.1({0x221de30?, 0xc000aedd10?})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:47920 +0x25\ngithub.com/99designs/gqlgen/graphql/executor.processExtensions.func3({0x221de30?, 0xc000aedd10?}, 0x10?)\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/extensions.go:70 +0x22\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query.func2({0x221de30, 0xc000aedd10})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:47919 +0xa2\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query.func3({0x1aacdc0?, 0x1292401?})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:47923 +0x1f\ngithub.com/99designs/gqlgen/graphql.(*FieldSet).Dispatch(0xc0006c9a90, {0x221de30?, 0xc000aedce0?})\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/fieldset.go:41 +0xa2\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executionContext)._Query(0xc000743800, {0x221de30, 0xc000aedc50}, {0xc000aee490, 0x1, 0x1})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:47958 +0xbf3\ngithub.com/getprobo/probo/pkg/server/api/console/v1/schema.(*executableSchema).Exec.func1({0x221de30, 0xc000aedc20})\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/schema/schema.go:4882 +0x230\ngithub.com/99designs/gqlgen/graphql/executor.(*Executor).DispatchOperation.func1.1.1({0x221de30, 0xc000aedc20})\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/executor.go:127 +0x25\ngithub.com/99designs/gqlgen/graphql/executor.processExtensions.func2({0x221de30?, 0xc000aedc20?}, 0x18cfee0?)\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/extensions.go:67 +0x22\ngithub.com/99designs/gqlgen/graphql/executor.(*Executor).DispatchOperation.func1.1({0x221de30, 0xc000aedb60})\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/executor/executor.go:126 +0x104\ngithub.com/99designs/gqlgen/graphql/handler/transport.POST.Do({0x0?, 0x0?}, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000abb900, {0x2219bd0, 0xc0001f8b00})\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/handler/transport/http_post.go:124 +0xaa2\ngithub.com/99designs/gqlgen/graphql/handler.(*Server).ServeHTTP(0xc000742c80, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000abb900)\n\t/home/runner/go/pkg/mod/github.com/99designs/[email protected]/graphql/handler/server.go:147 +0x225\ngithub.com/getprobo/probo/pkg/server/api/console/v1.graphqlHandler.WithSession.func3({0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/work/probo/probo/pkg/server/api/console/v1/resolver.go:328 +0x5b3\nnet/http.HandlerFunc.ServeHTTP(0xc0001aea50?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc0005635a8?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc000932840, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:478 +0x2e2\nnet/http.HandlerFunc.ServeHTTP(0xc0004d0d58?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc0004d0d38?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc000932840, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 +0x32f\ngithub.com/go-chi/chi/v5.(*Mux).Mount.func1({0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:325 +0x1bb\nnet/http.HandlerFunc.ServeHTTP(0xc0001aea50?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc0008f8030?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc000932720, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:478 +0x2e2\nnet/http.HandlerFunc.ServeHTTP(0xc000778c80?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc000aba140?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/cors.(*Cors).Handler-fm.(*Cors).Handler.func1({0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/cors.go:231 +0x1a4\nnet/http.HandlerFunc.ServeHTTP(0x17?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc000932720, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 +0x32f\ngithub.com/getprobo/probo/pkg/server/api.(*Server).ServeHTTP(0xc00032aa00, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/work/probo/probo/pkg/server/api/api.go:131 +0x97a\ngithub.com/getprobo/probo/pkg/server.(*Server).setupRoutes.func1({0x7ff02d0fa190?, 0xc00080fb00?}, 0x10?)\n\t/home/runner/work/probo/probo/pkg/server/server.go:103 +0xd1\nnet/http.HandlerFunc.ServeHTTP(0xc000821230?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc000299b0a?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).Mount.func1({0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:325 +0x1bb\nnet/http.HandlerFunc.ServeHTTP(0xc0001aea50?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0xc000299b05?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc000390000, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:478 +0x2e2\nnet/http.HandlerFunc.ServeHTTP(0x2?, {0x7ff02d0fa190?, 0xc00080fb00?}, 0x1?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2294 +0x29\ngithub.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc000390000, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 +0x32f\ngithub.com/getprobo/probo/pkg/server.(*Server).ServeHTTP(0xc00039c340, {0x7ff02d0fa190, 0xc00080fb00}, 0xc000aba140)\n\t/home/runner/work/probo/probo/pkg/server/server.go:116 +0x1a5\ngo.gearno.de/kit/httpserver.(*handlerWrapper).ServeHTTP(0xc00048d220, {0x2218e70, 0xc0001a55e0}, 0xc00084fcc0)\n\t/home/runner/go/pkg/mod/go.gearno.de/[email protected]/httpserver/handler_wrapper.go:313 +0x2098\nnet/http.serverHandler.ServeHTTP({0x220abf0?}, {0x2218e70?, 0xc0001a55e0?}, 0x6?)\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:3301 +0x8e\nnet/http.(*conn).serve(0xc0007b6a20, {0x221de30, 0xc0007beb40})\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:2102 +0x625\ncreated by net/http.(*Server).Serve in goroutine 63\n\t/opt/hostedtoolcache/go/1.24.4/x64/src/net/http/server.go:3454 +0x485\n","error":"tenant not found"}

gearnode avatar Jul 18 '25 12:07 gearnode

Hello, I starting to learn go and i would like to be assigned this task please :)

brogouh avatar Aug 02 '25 12:08 brogouh

Your pull request will be welcome!

gearnode avatar Aug 04 '25 08:08 gearnode

Fixed in https://github.com/getprobo/probo/commit/9a33f7b771ce8c8758d09b734753127b82812abe

SachaProbo avatar Nov 04 '25 12:11 SachaProbo