invalid memory address or nil pointer dereference
诊断一次default下的pod是否有存在的风险 Running: kubectl get pods -n default -o wide
Running: kubectl describe pod -n default
Running: scan_image_with_trivy(image=ringtail/rcapi:0.1)
Do you want to proceed ?
- Yes
- Yes, and don't ask me again
- No Enter your choice (1,2,3): 1 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x40 pc=0x105976aa4]
goroutine 1 [running]: github.com/GoogleCloudPlatform/kubectl-ai/pkg/agent.(*Conversation).RunOneRound(0x1400052e180, {0x1061378d0, 0x106ab8d00}, {0x140003af1c0, 0x34}) github.com/GoogleCloudPlatform/kubectl-ai/pkg/agent/conversation.go:323 +0x1114 main.(*session).answerQuery(0x14000275898, {0x1061378d0?, 0x106ab8d00?}, {0x140003af1c0?, 0x140003559b0?}) github.com/GoogleCloudPlatform/kubectl-ai/cmd/main.go:575 +0x528 main.(*session).repl(0x140009e5898, {0x1061378d0, 0x106ab8d00}, {0x16af773eb?, 0x0?}) github.com/GoogleCloudPlatform/kubectl-ai/cmd/main.go:521 +0x1cc main.RunRootCommand({0x1061378d0, 0x106ab8d00}, {{0x16af773cc, 0x6}, {0x16af773db, 0xf}, 0x0, 0x0, 0x0, 0x0, ...}, ...) github.com/GoogleCloudPlatform/kubectl-ai/cmd/main.go:432 +0x900 main.BuildRootCommand.func1(0x14000536000?, {0x14000354420?, 0x4?, 0x105a19acd?}) github.com/GoogleCloudPlatform/kubectl-ai/cmd/main.go:60 +0x80 github.com/spf13/cobra.(*Command).execute(0x14000534008, {0x140000300d0, 0x3, 0x3}) github.com/spf13/[email protected]/command.go:1015 +0x844 github.com/spf13/cobra.(*Command).ExecuteC(0x14000534008) github.com/spf13/[email protected]/command.go:1148 +0x384 github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/[email protected]/command.go:1071 github.com/spf13/cobra.(*Command).ExecuteContext(...) github.com/spf13/[email protected]/command.go:1064 main.run({0x1061378d0, 0x106ab8d00}) github.com/GoogleCloudPlatform/kubectl-ai/cmd/main.go:272 +0x29c main.main() github.com/GoogleCloudPlatform/kubectl-ai/cmd/main.go:233 +0xb8
It looks like this issue has been resolved in version 0.0.12. I encountered it earlier, but after updating, I now see the correct error message: Error: executing action: exec: "trivy": executable file not found in $PATH. Can you confirm if you're seeing the same behavior?
@duffqiu can you share model and llm provider you are using ? I am surprised that the LLM suggested to use trivy tool in response to your query.
/cc @noahlwest (mainly to track the model and llm-provider).
@duffqiu can you share model and llm provider you are using ? I am surprised that the LLM suggested to use trivy tool in response to your query.
This happens quite commonly at least on openai based LLM calls, usually when deploying a new pod
I got the nil pointer exception too but solved it in a previous PR, before trivy, not sure 100% if that fixes this issue but worth checking in my opinion
https://github.com/GoogleCloudPlatform/kubectl-ai/commit/49755aed57b69803fa6d2cd1e69869f1359f7e16
@duffqiu tried reproducing this today, no success, seems like the commit mentioned fixed the issue, can you give it a go?