docker / docker/scout-cli

docker scout quickview crashes if an image is not specified

Open
#125 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
454
Forks
134
PR merge metrics
No merged PRs in 30d

Description

The quickview crashes if you do not specify an image.

docker scout version
version: v1.9.3 (go1.22.3 - darwin/arm64)
git commit: e3dbad31cfc7736809470453fc317c22d361c207

docker scout quickview
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x78 pc=0x1017949e0]

goroutine 1 [running]:
github.com/google/go-containerregistry/pkg/v1.(*ConfigFile).Platform(...)
/home/runner/go/pkg/mod/github.com/google/go-containerregistry@v0.19.1/pkg/v1/config.go:46
github.com/docker/scout-cli-plugin/internal/dockercli.(*Store).GetNewest(0x1400026cfb0, {0x102d4b4b0, 0x14000c251d0})
/home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/dockercli/localstore.go:183 +0x9f0
github.com/docker/scout-cli-plugin/images.(*ImgService).GetNewestSource(0x14000f2cc00?, {0x102d4b4b0?, 0x14000c251d0?})
/home/runner/work/scout-cli-plugin/scout-cli-plugin/images/images.go:311 +0x34
github.com/docker/scout-cli-plugin/internal/commands/quickview.NewCmd.func2(0x0?, {0x0?, 0x0?, 0xaf03198e00000000?})
/home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/commands/quickview/quickview.go:170 +0x610
github.com/docker/cli/cli-plugins/plugin.RunPlugin.func1.1.2(0x14000798f08, {0x104110c00, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/docker/cli@v26.1.3+incompatible/cli-plugins/plugin/plugin.go:69 +0x68
github.com/spf13/cobra.(*Command).execute(0x14000798f08, {0x14000510f50, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x140008bbb08)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0x14000960000, 0x14000798008, {{0x101c82cc2, 0x5}, {0x101cac97f, 0xb}, {0x140013168b6, 0x6}, {0x101cb99b9, 0xc}, ...})
/home/runner/go/pkg/mod/github.com/docker/cli@v26.1.3+incompatible/cli-plugins/plugin/plugin.go:84 +0x138
main.runPlugin(0x14000960000)
/home/runner/work/scout-cli-plugin/scout-cli-plugin/cmd/docker-scout/main.go:29 +0x104
main.main()
/home/runner/work/scout-cli-plugin/scout-cli-plugin/cmd/docker-scout/main.go:53 +0x130

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack-trace locations in internal/dockercli/localstore.go, images/images.go, and internal/commands/quickview/quickview.go. Run docker scout quickview without an image and trace the nil value through GetNewest and GetNewestSource; done means the command no longer panics when no image is specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.