Skip to content

panic: runtime error when running docker scout cves fs://. with gitlab output format #194

@jreeseSoV

Description

@jreeseSoV

This may be similar to issue #113.

I have Docker Scout v1.18.1 installed on Windows and I'm trying to run docker scout cves against a local directory and generate gitlab-formatted output. All other output formats (sarif, spdx, sbom, packages, and markdown) work; only gitlab causes a panic.

This is the output I get when running the command:

docker scout cves fs://. --format gitlab
    v File system read
    v Indexed 201 packages
    x Detected 14 vulnerable packages with a total of 31 vulnerabilities
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x40f2ec1]

goroutine 1 [running]:
github.com/docker/scout-cli-plugin/internal/format/sbom/gitlab.(*GitLab).toGitLab(0xc00190ace8, {0xc00086f508, 0x20, 0x45c9b40?}, 0xc002e0c700)
        /Users/cdupuis/Development/docker/scout-cli-plugin/internal/format/sbom/gitlab/gitlab.go:207 +0x841
github.com/docker/scout-cli-plugin/internal/format/sbom/gitlab.(*GitLab).Print(0xc00190ace8, {0x6?, 0xc0034febd0?}, {0x5e4ef80, 0xc00010c078}, 0x0?, 0xc002e0c700)
        /Users/cdupuis/Development/docker/scout-cli-plugin/internal/format/sbom/gitlab/gitlab.go:120 +0x45
github.com/docker/scout-cli-plugin/internal/commands/cves.NewCmd.func2(0x0?, {0x0?, 0x0?, 0x9cc97c9123667e10?})
        /Users/cdupuis/Development/docker/scout-cli-plugin/internal/commands/cves/cves.go:303 +0xf79
github.com/docker/cli/cli-plugins/plugin.RunPlugin.func1.1.2(0xc0004aaf08, {0xc000e20f30, 0x1, 0x3})
        /Users/cdupuis/Development/go/pkg/mod/github.com/docker/[email protected]+incompatible/cli-plugins/plugin/plugin.go:64 +0x64
github.com/spf13/cobra.(*Command).execute(0xc0004aaf08, {0xc000dee840, 0x3, 0x3})
        /Users/cdupuis/Development/go/pkg/mod/github.com/spf13/[email protected]/command.go:1015 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc000e33508)
        /Users/cdupuis/Development/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x46f
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/cdupuis/Development/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0xc00079a640, 0xc0004aa308, {{0x4ee8d9c, 0x5}, {0x4f17dde, 0xb}, {0xc000688eb0, 0x7}, {0x4f2652b, 0xc}, ...})
        /Users/cdupuis/Development/go/pkg/mod/github.com/docker/[email protected]+incompatible/cli-plugins/plugin/plugin.go:79 +0x145
main.runPlugin(0xc00079a640)
        /Users/cdupuis/Development/docker/scout-cli-plugin/cmd/docker-scout/main.go:30 +0x148
main.main()
        /Users/cdupuis/Development/docker/scout-cli-plugin/cmd/docker-scout/main.go:57 +0x176

Let me know if there's anything I can do to help figure this issue out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions