convoy icon indicating copy to clipboard operation
convoy copied to clipboard

Gracefully exiting the server panics

Open subomi opened this issue 3 years ago • 0 comments

I tried to gracefully exit my instance and the following happened:

> ./convoy server -w=false
[2022-07-30 21:39:23]  WARN maximum response size of 51200kb too large, using default value of 50kb
[2022-07-30 21:39:23]  INFO Starting Convoy server...
[2022-07-30 21:39:23]  INFO Started convoy server in 6.750417ms
[2022-07-30 21:39:23]  INFO Server running on port 5005
^C[2022-07-30 21:39:24]  INFO Stopping server
[2022-07-30 21:39:24]  INFO Server exiting
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104cd9fc8]

goroutine 1 [running]:
go.mongodb.org/mongo-driver/mongo.(*Database).Client(...)
        /Users/subomioluwalana/go/pkg/mod/go.mongodb.org/[email protected]/mongo/database.go:91
github.com/frain-dev/convoy/datastore/mongo.(*Client).Disconnect(...)
        /Users/subomioluwalana/Code/convoy/datastore/mongo/mongo.go:109
main.postRun.func1(0x1400032a280?, {0x104ce22ee?, 0x1?, 0x1?})
        /Users/subomioluwalana/Code/convoy/cmd/main.go:266 +0x38
github.com/spf13/cobra.(*Command).execute(0x1400032a280, {0x1400007ed50, 0x1, 0x1})
        /Users/subomioluwalana/go/pkg/mod/github.com/spf13/[email protected]/command.go:871 +0x598
github.com/spf13/cobra.(*Command).ExecuteC(0x14000272280)
        /Users/subomioluwalana/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/subomioluwalana/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
main.(*ConvoyCli).Execute(...)
        /Users/subomioluwalana/Code/convoy/cmd/main.go:319
main.main()
        /Users/subomioluwalana/Code/convoy/cmd/main.go:60 +0x140

subomi avatar Jul 30 '22 20:07 subomi