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

[regression] panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without or with - or -- arguments #1872

Closed
apupier opened this issue Dec 31, 2020 · 3 comments · Fixed by #1873
Milestone

Comments

@apupier
Copy link
Contributor

apupier commented Dec 31, 2020

(base) [apupier@linux camel-k-client-1.3.0-linux-64bit]$ ./kamel
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x18084b6]

goroutine 1 [running]:
github.com/spf13/cobra.(*Command).Name(0x0, 0xc0001181b0, 0x0)
	github.com/spf13/cobra@v1.0.0/command.go:1258 +0x26
github.com/apache/camel-k/pkg/cmd.createKamelWithModelineCommand(0x2161020, 0xc0007bc540, 0xc0001181b0, 0x0, 0x0, 0xc0007b4df0, 0x1, 0xc0000cb2b0, 0x315fa00, 0x7f62a78e3108, ...)
	github.com/apache/camel-k/pkg/cmd/modeline.go:92 +0xf7
github.com/apache/camel-k/pkg/cmd.NewKamelWithModelineCommand(0x2161020, 0xc0007bc540, 0xc0001181b0, 0x1, 0x1, 0xc00014df48, 0x445efa, 0x30dbae0, 0xc000000180, 0xc00014df78, ...)
	github.com/apache/camel-k/pkg/cmd/modeline.go:64 +0x9b
main.main()
	github.com/apache/camel-k/cmd/kamel/main.go:45 +0x163
@apupier apupier changed the title panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without arguments Dec 31, 2020
@apupier
Copy link
Contributor Author

apupier commented Dec 31, 2020

it occurs also when using -- or - version of commands:

(base) [apupier@linux camel-k-client-1.3.0-linux-64bit]$ ./kamel --help
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x18084b6]

goroutine 1 [running]:
github.com/spf13/cobra.(*Command).Name(0x0, 0xc00000e070, 0x1)
	github.com/spf13/cobra@v1.0.0/command.go:1258 +0x26
github.com/apache/camel-k/pkg/cmd.createKamelWithModelineCommand(0x2161020, 0xc0006204c0, 0xc00000e070, 0x1, 0x1, 0xc00075c700, 0x1, 0xc0001a5c70, 0x315fa00, 0x7f3bcfcdf108, ...)
	github.com/apache/camel-k/pkg/cmd/modeline.go:92 +0xf7
github.com/apache/camel-k/pkg/cmd.NewKamelWithModelineCommand(0x2161020, 0xc0006204c0, 0xc00000e060, 0x2, 0x2, 0xc0000e3f48, 0x445efa, 0x30dbae0, 0xc000000180, 0xc0000e3f78, ...)
	github.com/apache/camel-k/pkg/cmd/modeline.go:64 +0x9b
main.main()
	github.com/apache/camel-k/cmd/kamel/main.go:45 +0x163

although kamel help is working fine

@apupier apupier changed the title panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without arguments panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without arguments or with - or -- arguments Dec 31, 2020
@apupier apupier changed the title panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without arguments or with - or -- arguments panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without or with - or -- arguments Dec 31, 2020
@apupier
Copy link
Contributor Author

apupier commented Dec 31, 2020

last line in kamel code is:

isLocalCreate := target.Parent().Name() == localCmdName && target.Name() == createCmdName

not able to make the project working locally (was never able to make any go project working correctly yet) but suspecting that the target has no Parent? causing target.Parent().name() is throwing this error?

@apupier apupier changed the title panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without or with - or -- arguments [regression] panic: runtime error: invalid memory address or nil pointer dereference with version 1.3.0 when calling without or with - or -- arguments Jan 4, 2021
@apupier
Copy link
Contributor Author

apupier commented Jan 21, 2021

I think that this issue should have the Milestone 1.3.1 set. 2d0a6f3

@astefanutti astefanutti added this to the 1.3.1 milestone Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants