docker / scout-action

Docker Scout GitHub Action
https://docker.com/products/docker-scout
Other
87 stars 27 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #18

Closed GudditiN closed 1 year ago

GudditiN commented 1 year ago

For this Docker Scout code snippet facing the mentioned below error.

      - name: Docker Scout for image vulnerabilities 
        id: docker-scout
        uses: docker/scout-action@v0.18.1
        with:
          command: quickview,cves,sbom,recommendations
          image: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
        env:
          IMAGE_NAME: ${{ inputs.ECR_REPOSITORY_NAME }}
          IMAGE_TAG: ${{ github.sha }}

getting this error logs at the run time

      ✓ SBOM of image already cached, 902 packages indexed
  panic: runtime error: invalid memory address or nil pointer dereference
  [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x198c3e2]

  goroutine 1 [running]:
  github.com/docker/scout-cli-plugin/internal/mk.DiffVulnSummaryVertical(0xc02ccde870, 0x0)
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/mk/mk.go:295 +0x42
  github.com/docker/scout-cli-plugin/internal/format/recommendations.fillCurrentTag({0xc02cb435a0, 0x9}, {0xc012088718?, 0xa, 0x2?}, 0xc02ce779b8)
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/format/recommendations/markdown.go:216 +0xaf8
  github.com/docker/scout-cli-plugin/internal/format/recommendations.genMk(0xc02cb20750, 0xc02bcb0820, 0xc000076800?, {0xc0?, 0x8c?, {0x0?, 0xc02ce77c78?}}, {0xc00004240c, 0x2d}, {0x1db32ae, ...}, ...)
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/format/recommendations/markdown.go:80 +0x545
  github.com/docker/scout-cli-plugin/internal/format/recommendations.PrintMarkdown({0x2650d60, 0xc02cde8cc0}, 0x4af960?, 0xc00004c110?, 0xc028f4dcc8?, {0x48?, 0xdd?, {0x0?, 0xc0000920c0?}}, {0xc00004240c, ...}, ...)
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/format/recommendations/markdown.go:53 +0x8d
  github.com/docker/scout-cli-plugin/internal/gha.(*recommendationsCmd).Run(0x1b65f60?, {0x265d210, 0xc00004c1f0}, 0xc000bd8840, 0xc00047b6d8?, 0xc0006d2000)
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/gha/recommendations.go:49 +0x279
  github.com/docker/scout-cli-plugin/internal/gha.Run({0x265d210, 0xc00004c1f0}, 0xc000bd8840, {0xc0000423e2, 0xf}, 0xc000006101?, 0xc000072690?)
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/internal/gha/commands.go:101 +0xb0
  main.run()
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/cmd/github-action/main.go:68 +0x4a5
  main.main()
    /home/runner/work/scout-cli-plugin/scout-cli-plugin/cmd/github-action/main.go:79 +0x19
eunomie commented 1 year ago

This should be fixed in the new v1.0.9 release

GudditiN commented 1 year ago

@eunomie , thank you for your quick reply!🚀