crossplane-contrib / crossplane-contrib/function-sequencer

GoPanic after handling inproperly configured function

Open
#104 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
37
Forks
19
Avg merge
1d 14h
Merged PRs (30d)
4

Description

We raised the below gopanic during development of a new function. I guess we forgot/didn't set the `rsp.Desired.Composite.Ready` or have some other weirdness in our function. I'll have to investigate on our end what's really causing this, but still, i think the sequencer shouldn't just die bc/ of that.

I suggest a validation before setting the state, but i wouldn't mind if you close this issue, as it's probably a minor issue for you.

### What happened?

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x15a837f]

goroutine 50 [running]:
main.(*Function).RunFunction(0xc0005584f0, {0x17a4520?, 0x1695e764a?}, 0xc0001708c0)
/fn/fn.go:170 +0x199f
github.com/crossplane/function-sdk-go/proto/v1._FunctionRunnerService_RunFunction_Handler.func1({0x1c35d20?, 0xc00048d170?}, {0x18d9dc0?, 0xc0001708c0?})
/go/pkg/mod/github.com/crossplane/function-sdk-go@v0.5.0/proto/v1/run_function_grpc.pb.go:130 +0xcb
github.com/crossplane/function-sdk-go.Serve.(*ServerMetrics).UnaryServerInterceptor.UnaryServerInterceptor.func5({0x1c35d20, 0xc00048d170}, {0x18d9dc0, 0xc0001708c0}, 0x41d245?, 0xc000010120)
/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.3.0/interceptors/server.go:22 +0x275
github.com/crossplane/function-sdk-go/proto/v1._FunctionRunnerService_RunFunction_Handler({0x17a4520, 0xc0005584f0}, {0x1c35d20, 0xc00048d170}, 0xc00024a500, 0xc000010288)
/go/pkg/mod/github.com/crossplane/function-sdk-go@v0.5.0/proto/v1/run_function_grpc.pb.go:132 +0x143
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00054c908, {0x1c35d20, 0xc0001beff0}, 0xc00024c1a0, 0xc000094ae0, 0x28801f0, 0x0)
/go/pkg/mod/google.golang.org/grpc@v1.78.0/server.go:1428 +0x1192
google.golang.org/grpc.(*Server).handleStream(0xc00054c908, {0x1c36648, 0xc00054ab60}, 0xc00024c1a0)
/go/pkg/mod/google.golang.org/grpc@v1.78.0/server.go:1832 +0xdc6
google.golang.org/grpc.(*Server).serveStreams.func2.1()
/go/pkg/mod/google.golang.org/grpc@v1.78.0/server.go:1063 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 31
/go/pkg/mod/google.golang.org/grpc@v1.78.0/server.go:1074 +0x11d
```

### How can we reproduce it?
I'll try to debug what fields we are setting wrong, but can't promise anything.

### What environment did it happen in?
Function version: 0.5.0

cloud provider or hardware configuration:
* Kubernetes version: 135
* Kubernetes distribution: eks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.