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

panic on insert command when the specified engine doesn't exist #331

Closed
yaziine opened this issue Nov 19, 2020 · 3 comments
Closed

panic on insert command when the specified engine doesn't exist #331

yaziine opened this issue Nov 19, 2020 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@yaziine
Copy link
Collaborator

yaziine commented Nov 19, 2020

What version of Genji are you using?

$ genji version
Genji v0.10.0
Genji CLI (devel)

Does this issue reproduce with the latest release?

Yes

What did you do?

Note the wrong engine

genji insert -engine bar --db my.db -table foo '{"a": 1}' '{"a": 2}'

What did you expect to see?

Nothing. Only the command being successfully executed.

What did you see instead?

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

goroutine 1 [running]:
github.com/genjidb/genji/database.New(0x46e24a0, 0xc00002a088, 0x0, 0x0, 0x46de520, 0x49e87f0, 0x0, 0x0, 0x0)
	/Users/yassine/code/github.com/genjidb/genji/database/database.go:48 +0xdc
github.com/genjidb/genji.New(0x46e24a0, 0xc00002a088, 0x0, 0x0, 0xa, 0xc00002ad20, 0xf)
	/Users/yassine/code/github.com/genjidb/genji/new.go:15 +0x68
main.runInsertCommand(0x46e24a0, 0xc00002a088, 0x7ffeefbffaae, 0x4, 0x7ffeefbffab8, 0x5, 0x7ffeefbffac5, 0x3, 0xc000105d00, 0xc00000fca0, ...)
	/Users/yassine/code/github.com/genjidb/genji/cmd/genji/insert.go:140 +0x1f6
main.main.func1(0xc000068b40, 0x5, 0x8)
	/Users/yassine/code/github.com/genjidb/genji/cmd/genji/main.go:87 +0x227
github.com/urfave/cli/v2.(*Command).Run(0xc000114ea0, 0xc0000688c0, 0x0, 0x0)
	/Users/yassine/dev/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:163 +0x4ed
github.com/urfave/cli/v2.(*App).RunContext(0xc000105a00, 0x46e24a0, 0xc00002a088, 0xc0000200a0, 0xa, 0xa, 0x0, 0x0)
	/Users/yassine/dev/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:313 +0x81f
github.com/urfave/cli/v2.(*App).Run(...)
	/Users/yassine/dev/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:224
main.main()
	/Users/yassine/code/github.com/genjidb/genji/cmd/genji/main.go:185 +0x87d
@yaziine yaziine added the bug Something isn't working label Nov 19, 2020
@yaziine yaziine added this to the v0.10.0 milestone Nov 19, 2020
@tzzed
Copy link
Contributor

tzzed commented Nov 19, 2020

What do you think about returning an error if the engine doesn't exists?

@yaziine yaziine added the good first issue Good for newcomers label Nov 19, 2020
@yaziine
Copy link
Collaborator Author

yaziine commented Nov 19, 2020

Yes we just need to check if the given engine is currently supported and return an error otherwise.

@asdine asdine modified the milestones: v0.10.0, v0.11.0 Jan 26, 2021
@tzzed
Copy link
Contributor

tzzed commented Mar 13, 2021

@asdine you can close this issue, it solved by #366.

@asdine asdine closed this as completed Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants