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

Flow pod panics when returning event results #650

Closed
jalfvort opened this issue Jul 28, 2022 · 0 comments
Closed

Flow pod panics when returning event results #650

jalfvort opened this issue Jul 28, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jalfvort
Copy link
Contributor

jalfvort commented Jul 28, 2022

Describe the bug
Flow pod panics when calling the events api with no queries or a bad query.
UPDATED: It has nothing to do with queries. A panic happens when events.results is not empty. So offset=8 would run fine if there were less then 8 total results, but offset=0 would fail if there was atleast 1 result.

  • Runs fine: curl http://localhost/api/namespaces/fvff/events?offset=8
  • Causes panic curl http://localhost/api/namespaces/fvff/events?bad=8
  • Causes panic curl http://localhost/api/namespaces/fvff/events

To Reproduce
Steps to reproduce the behavior:

  1. Run curl http://localhost/api/namespaces/NAMESPACE/events

Additional context
Built hash: 902c8fc
Stacetrace:

{"level":"info","timestamp":"2022-07-28T01:03:11Z","caller":"flow/server.go:281","msg":"Flow server started.","component":"flow","build":"902c8fc"}
panic: reflect: call of reflect.Value.NumField on map Value

goroutine 227 [running]:
reflect.flag.mustBe(...)
	/home/jon/.gvm/gos/go1.18.3/src/reflect/value.go:223
reflect.Value.NumField({0x1f925e0?, 0x0?, 0x1dfff5c?})
	/home/jon/.gvm/gos/go1.18.3/src/reflect/value.go:1893 +0x8d
github.com/direktiv/direktiv/pkg/flow.atobStructBuilder({0x266af80, 0x1f925e0}, {0x1f925e0?, 0x0?, 0x110?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:134 +0xec
github.com/direktiv/direktiv/pkg/flow.atobBuilder({0x1f925e0?, 0x0?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:223 +0x2e6
github.com/direktiv/direktiv/pkg/flow.atobStructBuilder({0x266af80, 0x2202bc0}, {0x2202bc0?, 0xc0009ac180?, 0x110?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:166 +0x3fa
github.com/direktiv/direktiv/pkg/flow.atobBuilder({0x2202bc0?, 0xc0009ac180?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:223 +0x2e6
github.com/direktiv/direktiv/pkg/flow.atobStructBuilder({0x266af80, 0x2192660}, {0x2192660?, 0xc000a800d0?, 0x7fe39d1db108?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:166 +0x3fa
github.com/direktiv/direktiv/pkg/flow.atobBuilder({0x2101660?, 0xc000a800d0?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:223 +0x2e6
github.com/direktiv/direktiv/pkg/flow.atobSliceBuilder({0x1e7e280?, 0xc000bc2210?}, {0x1e7e280?, 0xc000bc2210?, 0x1?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:189 +0x194
github.com/direktiv/direktiv/pkg/flow.atobBuilder({0x1e7e280?, 0xc000bc2210?})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:212 +0x332
github.com/direktiv/direktiv/pkg/flow.atob({0x1e7e280?, 0xc000bc2210?}, {0x1e53560, 0xc00077e260})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/data.go:237 +0x2d
github.com/direktiv/direktiv/pkg/flow.(*flow).EventHistoryStream(0xc000bbd710, 0xc0007803c0, {0x265eb50, 0xc00090e420})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/events.go:817 +0x3e7
github.com/direktiv/direktiv/pkg/flow/grpc._Flow_EventHistoryStream_Handler({0x2296500?, 0xc000bbd710}, {0x265d858, 0xc000938000})
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/grpc/protocol_grpc.pb.go:3891 +0xd3
github.com/direktiv/direktiv/pkg/flow.streamInterceptor({0x2296500?, 0xc000bbd710?}, {0x265d858?, 0xc000938000?}, 0x1e6d2a0?, 0xc00090e240?)
	/home/jon/Documents/projects/go/github.com/direktiv/direktiv/pkg/flow/server.go:438 +0x30
google.golang.org/grpc.(*Server).processStreamingRPC(0xc0003476c0, {0x2662378, 0xc000d1e680}, 0xc000314360, 0xc000bbd890, 0x375c940, 0x0)
	/home/jon/.gvm/pkgsets/go1.18.3/global/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:1547 +0xeae
google.golang.org/grpc.(*Server).handleStream(0xc0003476c0, {0x2662378, 0xc000d1e680}, 0xc000314360, 0x0)
	/home/jon/.gvm/pkgsets/go1.18.3/global/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:1620 +0x9d6
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	/home/jon/.gvm/pkgsets/go1.18.3/global/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/home/jon/.gvm/pkgsets/go1.18.3/global/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:919 +0x28a
@jalfvort jalfvort changed the title Flow pod panics when receiving bad queries. Flow pod panics when receiving bad queries Jul 28, 2022
@jalfvort jalfvort added this to the 0.7.0 milestone Jul 28, 2022
@jalfvort jalfvort added the bug Something isn't working label Jul 28, 2022
@jalfvort jalfvort changed the title Flow pod panics when receiving bad queries Flow pod panics when returning event results Jul 28, 2022
@alankm alankm closed this as completed in 9cb5e6b Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants