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

Subscription with Apollo Tracing extension results in missing tracing extension error #1103

Closed
danishsatkut opened this issue Mar 14, 2020 · 3 comments · Fixed by #1170
Closed
Labels

Comments

@danishsatkut
Copy link

What happened?

I have defined a simple subscription which works perfectly without Apollo Tracing. When I use apollotracing extension, all the queries work perfectly fine, but the subscription panics with "missing tracing extension" error.

missing tracing extension

goroutine 1086 [running]:
runtime/debug.Stack(0x18e5e40, 0xc0001aa010, 0x0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/debug/stack.go:24 +0x9d
graphql/server/handlers.panicMiddleware(0x18f4360, 0xc00001e720, 0x16c8840, 0x18d3510, 0x24, 0xc000505630)
	/Users/danish/Projects/datascale/insights-graphql/server/handlers/graphql.go:93 +0xad
graphql/resolver.(*executionContext)._Subscription_uploadStatus.func1(0xc0006c2890, 0xc0006c28f0, 0xc000505b00)
	/Users/danish/Projects/datascale/insights-graphql/resolver/generated.go:14737 +0x78
panic(0x16c8840, 0x18d3510)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/panic.go:967 +0x15d
github.com/99designs/gqlgen/graphql/handler/apollotracing.Tracer.InterceptField(0x18f4360, 0xc00001e720, 0xc0004c2260, 0x0, 0x0, 0x0, 0x0)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/handler/apollotracing/tracer.go:61 +0x224
github.com/99designs/gqlgen/graphql/executor.processExtensions.func6(0x18f4360, 0xc00001e720, 0xc0004c2220, 0x18d3440, 0x18d4850, 0x1, 0x18)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:90 +0xa3
github.com/99designs/gqlgen/graphql/executor.processExtensions.func6.1(0x18f4360, 0xc00001e720, 0x18d4850, 0x16f5380, 0xc0003c2180, 0x10)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:91 +0x42
graphql/server/handlers.insightsMiddleware.func1(0x18f4360, 0xc00001e720, 0xc0004c2240, 0x20, 0x1751620, 0xe9953bd2222fd501, 0xc0004c2240)
	/Users/danish/Projects/datascale/insights-graphql/server/handlers/graphql.go:112 +0xca
github.com/99designs/gqlgen/graphql/executor.aroundFieldFunc.InterceptField(0xc0002f8690, 0x18f4360, 0xc00001e720, 0xc0004c2240, 0xc00001e780, 0xc000505a10, 0x100eae8, 0x20)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:158 +0x44
github.com/99designs/gqlgen/graphql/executor.processExtensions.func6(0x18f4360, 0xc00001e720, 0xc0004c2220, 0xc00001e750, 0xc00001e780, 0x0, 0x0)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:90 +0xa3
graphql/resolver.(*executionContext)._Subscription_uploadStatus(0xc0006c2890, 0x18f4360, 0xc00001e6f0, 0xc0003b6c00, 0x0, 0x0, 0x0, 0x0)
	/Users/danish/Projects/datascale/insights-graphql/resolver/generated.go:14756 +0x2b3
graphql/resolver.(*executionContext)._Subscription(0xc0006c2890, 0x18f4360, 0xc00001e6c0, 0xc0005a28a0, 0x1, 0x1, 0x30)
	/Users/danish/Projects/datascale/insights-graphql/resolver/generated.go:19540 +0x236
graphql/resolver.(*executableSchema).Exec(0xc00031c000, 0x18f4360, 0xc00001e6c0, 0x18d34f0)
	/Users/danish/Projects/datascale/insights-graphql/resolver/generated.go:3017 +0x392
github.com/99designs/gqlgen/graphql/executor.(*Executor).DispatchOperation.func1(0x18f4360, 0xc00001e660, 0x0)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/executor.go:97 +0x126
github.com/99designs/gqlgen/graphql/executor.processExtensions.func1(0x18f4360, 0xc00001e660, 0xc0004c2180, 0x0)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:56 +0x3a
github.com/99designs/gqlgen/graphql/executor.processExtensions.func4.1(0x18f4360, 0xc00001e660, 0x4c)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:73 +0x42
graphql/server/handlers.queryLogger.func1(0x18f4360, 0xc00001e660, 0xc0004c21a0, 0xc0004c21a0)
	/Users/danish/Projects/datascale/insights-graphql/server/handlers/graphql.go:74 +0xae
github.com/99designs/gqlgen/graphql/executor.aroundOpFunc.InterceptOperation(0xc0002f8630, 0x18f4360, 0xc00001e660, 0xc0004c21a0, 0x20)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:124 +0x44
github.com/99designs/gqlgen/graphql/executor.processExtensions.func4(0x18f4360, 0xc00001e660, 0xc0004c2180, 0x18d34c0)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/extensions.go:72 +0xa3
github.com/99designs/gqlgen/graphql/executor.(*Executor).DispatchOperation(0xc0001c2870, 0x18f42a0, 0xc00059a4c0, 0xc00010ab00, 0x1657544, 0xc000396d20, 0x18f4360)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/executor/executor.go:93 +0xf3
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1(0xc00010ab00, 0x18f42a0, 0xc00059a4c0, 0xc0002860a0, 0xc00059a480, 0xc0006c2700)
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/handler/transport/websocket.go:236 +0xd1
created by github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe
	/Users/danish/go/pkg/mod/github.com/99designs/gqlgen@v0.11.2/graphql/handler/transport/websocket.go:229 +0x751

After some debugging I found that InterceptField is being called before InterceptResponse for the apollo.Tracer, hence the extension is never registered.

What did you expect?

No panic for using Apollo Tracing with Subscriptions.

Minimal graphql.schema and models to reproduce

schema {
    query: Query

    mutation: Mutation

    subscription: Subscription
}

type Subscription {
    uploadStatus(id: ID!): Status!
}

enum Status {
    PENDING
    PROGRESS
    FAILED
    COMPLETE
}

versions

  • gqlgen version v0.11.2
  • go version? go version go1.14 darwin/amd64
  • dep or go modules? go modules
@stale
Copy link

stale bot commented May 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 13, 2020
@stale stale bot closed this as completed May 20, 2020
@jacksontj
Copy link

jacksontj commented Jun 3, 2020

I just ran into this issue today and there seems to be no real solution here, can we get this re-opened (as it already has all the detail)?

cc @vektah

@macnibblet
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants