Skip to content

Panic in API #13

@romshark

Description

@romshark

Setup: default quick-start starwars setup.

GraphQL ggproxy API Request:

query {
 service(id:"starwars") {
  matchAll(
   query: "query($e: Episode!) {hero(episode: $e) {id}}",
   operationName: null,
   variablesJSON:  "{\"e\": \"EMPIRE\"}"
  ) {
   forwarded, templates {id}
   timeParsingNS, timeMatchingNS
  }
 }
}

Request HTTP headers:

User-Agent: Thunder Client (https://www.thunderclient.com)
Accept: application/json
Content-Type: application/json
Accept-Language: en-GB,en;q=0.9
Accept-Encoding: gzip, deflate
Connection: keep-alive

Panic:

runtime error: index out of range [1] with length 1

goroutine 20 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x1c
github.com/99designs/gqlgen/graphql.DefaultRecover({0x1028e167f?, 0x1b?}, {0x102957a00?, 0x1400012e6d8?})
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/recovery.go:17 +0x78
github.com/99designs/gqlgen/graphql.(*OperationContext).Recover(0x102ed0f18?, {0x102986600, 0x140002eac60}, {0x102957a00?, 0x1400012e6d8?})
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/context_operation.go:114 +0x44
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Service_matchAll.func1()
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:1654 +0x68
panic({0x102957a00, 0x1400012e6d8})
        /usr/local/go/src/runtime/panic.go:884 +0x204
github.com/graph-guard/ggproxy/engines/rmap/pquery.(*Maker).ParseQuery(0x140003cc010, {0x1400000c858, 0x1, 0x102492274?}, 0x1, {0x140003c88e0, 0xa, 0x14000364480?}, 0x14000166470)
        /Volumes/ramdisk/work/ggproxy/engines/rmap/pquery/pquery.go:88 +0x2714
github.com/graph-guard/ggproxy/engines/rmap.(*RulesMap).FindMatch(0x140003cc000, {0x1400000c858, 0x1, 0x1}, 0x140001664e8?, {0x140003c88e0, 0xa, 0x19}, 0x140001664e0)
        /Volumes/ramdisk/work/ggproxy/engines/rmap/rmap.go:615 +0x108
github.com/graph-guard/ggproxy/engines/rmap.(*RulesMap).MatchAll(0x14000166578?, {0x1400000c858?, 0x102c67760?, 0x140003c8860?}, 0x1?, {0x140003c88e0?, 0x14000166578?, 0x1027242e8?}, 0x102988460?)
        /Volumes/ramdisk/work/ggproxy/engines/rmap/rmap.go:596 +0x44
github.com/graph-guard/ggproxy/api/graph.(*serviceResolver).MatchAll.func1({0x1400000c858, 0x1, 0x1}, {0x140003c8800, 0x11, 0x20}, {0x140003c88e0, 0xa, 0x19})
        /Volumes/ramdisk/work/ggproxy/api/graph/schema.resolvers.go:75 +0x110
github.com/graph-guard/ggproxy/gqlparse.(*Parser).Parse(0x140003b4000, {0x14000148fc0, 0x2c, 0x30}, {0x0, 0x0, 0x0}, {0x140001275d0, 0xf, 0x10}, ...)
        /Volumes/ramdisk/work/ggproxy/gqlparse/gqlparse.go:561 +0xeb8
github.com/graph-guard/ggproxy/api/graph.(*serviceResolver).MatchAll(0x14000120328, {0x140002eaba0?, 0x10280881e?}, 0x140003b6000, {0x14000402039, 0x2c}, 0x0, 0x14000500200)
        /Volumes/ramdisk/work/ggproxy/api/graph/schema.resolvers.go:66 +0x1b4
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Service_matchAll.func2({0x102986600?, 0x140002eac60})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:1660 +0x170
github.com/99designs/gqlgen/graphql/executor.processExtensions.func4({0x102986600?, 0x140002eac60?}, 0x140002de460?)
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/executor/extensions.go:72 +0x2c
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Service_matchAll(0x140005000c0, {0x102986600, 0x140002eab10}, {0x140003b6580?, {0x140001ab840?, 0xeb45d49fa193bda8?, 0x1400014d460?}}, 0x140003b6000)
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:1658 +0x1f4
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Service.func1({0x102986600?, 0x140002eab10?})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4780 +0x90
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Service.func2()
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4788 +0x2c
github.com/99designs/gqlgen/graphql.(*FieldSet).Dispatch(0x1400010cfa0)
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/fieldset.go:34 +0x94
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Service(0x140005000c0, {0x102986600?, 0x140002eab10}, {0x140005000e0, 0x1, 0x1}, 0x140003b6000)
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4835 +0x1b0
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext).marshalOService2ᚖgithubᚗcomᚋgraphᚑguardᚋggproxyᚋapiᚋgraphᚋmodelᚐService(...)
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:5948
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Query_service(0x140005000c0, {0x102986600, 0x140002ea9f0}, {0x140003b6500?, {0x140005000e0?, 0x10244be4c?, 0x5000?}})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:1066 +0x264
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Query.func7({0x102986600?, 0x140002ea9f0?})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4655 +0x84
github.com/99designs/gqlgen/graphql/executor.processExtensions.func3({0x102986600?, 0x140002ea9f0?}, 0x102ed0a68?)
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/executor/extensions.go:69 +0x2c
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Query.func8({0x102986600?, 0x140002ea9f0?})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4660 +0x38
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Query.func9()
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4664 +0x2c
github.com/99designs/gqlgen/graphql.(*FieldSet).Dispatch(0x1400010cf50)
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/fieldset.go:34 +0x94
github.com/graph-guard/ggproxy/api/graph/generated.(*executionContext)._Query(0x140005000c0, {0x102986600, 0x140002ea960}, {0x14000068450, 0x1, 0x1})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:4705 +0x1e8
github.com/graph-guard/ggproxy/api/graph/generated.(*executableSchema).Exec.func1({0x102986600?, 0x140002ea930?})
        /Volumes/ramdisk/work/ggproxy/api/graph/generated/generated.go:436 +0x8c
github.com/99designs/gqlgen/graphql/executor.(*Executor).DispatchOperation.func1.1.1({0x102986600, 0x140002ea930})
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/executor/executor.go:108 +0x2c
github.com/99designs/gqlgen/graphql/executor.processExtensions.func2({0x102986600?, 0x140002ea930?}, 0x1028f5940?)
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/executor/extensions.go:66 +0x2c
github.com/99designs/gqlgen/graphql/executor.(*Executor).DispatchOperation.func1.1({0x102986600, 0x140002ea870})
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/executor/executor.go:107 +0x118
github.com/99designs/gqlgen/graphql/handler/transport.POST.Do({}, {0x1029860c0, 0x140001a21c0}, 0x14000194400, {0x102985d00, 0x140003d40a0})
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/handler/transport/http_post.go:55 +0x2bc
github.com/99designs/gqlgen/graphql/handler.(*Server).ServeHTTP(0x140000720e0, {0x1029860c0, 0x140001a21c0}, 0x14000194400)
        /Users/romshark/go/pkg/mod/github.com/99designs/gqlgen@v0.17.13/graphql/handler/server.go:120 +0x194
github.com/graph-guard/ggproxy/server.(*API).handleGraph.func1(0x140001275a0?, {0x1029860c0?, 0x140001a21c0?}, 0x1?)
        /Volumes/ramdisk/work/ggproxy/server/api.go:91 +0xe0
github.com/graph-guard/ggproxy/server.(*API).handleGraph(0x1400012ab21?, {0x1029860c0?, 0x140001a21c0?}, 0x1400017ac60?)
        /Volumes/ramdisk/work/ggproxy/server/api.go:92 +0x24
net/http.HandlerFunc.ServeHTTP(...)
        /usr/local/go/src/net/http/server.go:2109
github.com/graph-guard/ggproxy/server.makeBasicAuth.func1({0x1029860c0, 0x140001a21c0}, 0x1400007aaa8?)
        /Volumes/ramdisk/work/ggproxy/server/api.go:189 +0x1a8
github.com/graph-guard/ggproxy/server.(*API).ServeHTTP(0x0?, {0x1029860c0, 0x140001a21c0}, 0x10269f224?)
        /Volumes/ramdisk/work/ggproxy/server/api.go:100 +0x94
net/http.serverHandler.ServeHTTP({0x102984e00?}, {0x1029860c0, 0x140001a21c0}, 0x14000194300)
        /usr/local/go/src/net/http/server.go:2947 +0x2c4
net/http.(*conn).serve(0x140002e4b40, {0x102986600, 0x140000a2330})
        /usr/local/go/src/net/http/server.go:1991 +0x560
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:3102 +0x444

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions