mondoohq / cnquery

open source, cloud-native, graph-based asset inventory

Home Page:https://cnquery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

recording of container scans panics

czunker opened this issue · comments

Describe the bug

cnspec scan container image ubuntu:23.04 --record /tmp/eol_ubunut_23_04.json 
→ loaded configuration from /etc/opt/mondoo/mondoo.yml using source default
→ using service account credentials
→ discover related assets for 1 asset(s)
→ reported panic to Mondoo platform
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x1094049]

goroutine 1 [running]:
go.mondoo.com/cnquery/v10/providers-sdk/v1/upstream/health.ReportPanic({0x1eb4f1f, 0x6}, {0x25677fc, 0x6}, {0x25681b0, 0x7}, {0x0, 0x0, 0x0?})
	/home/runner/go/pkg/mod/go.mondoo.com/cnquery/v10@v10.7.1/providers-sdk/v1/upstream/health/errors.go:30 +0x16c
panic({0x1bac8c0?, 0x3470d30?})
	/home/runner/_work/_tool/go/1.22.0/x64/src/runtime/panic.go:770 +0x132
go.mondoo.com/cnquery/v10/providers.(*recording).EnsureAsset(0xc0007ee0c0, 0xc000e09180, {0xc0007a9e30, 0x25}, 0x1, 0xc0005b41e0)
	/home/runner/go/pkg/mod/go.mondoo.com/cnquery/v10@v10.7.1/providers/recording.go:450 +0x89
go.mondoo.com/cnquery/v10/providers.(*Runtime).Connect(0xc001b15700, 0xc000ac6060)
	/home/runner/go/pkg/mod/go.mondoo.com/cnquery/v10@v10.7.1/providers/runtime.go:236 +0x2fb
go.mondoo.com/cnquery/v10/explorer/scan.createRuntimeForAsset(0xc001b22140, 0xc000144d00, {0x25919f0, 0xc0007ee0c0})
	/home/runner/go/pkg/mod/go.mondoo.com/cnquery/v10@v10.7.1/explorer/scan/discovery.go:187 +0x1ca
go.mondoo.com/cnquery/v10/explorer/scan.DiscoverAssets({0xc000146000?, 0x1f08383?}, 0xc000fd06c0, 0xc000144d00, {0x25919f0, 0xc0007ee0c0})
	/home/runner/go/pkg/mod/go.mondoo.com/cnquery/v10@v10.7.1/explorer/scan/discovery.go:104 +0x338
go.mondoo.com/cnspec/v10/policy/scan.(*LocalScanner).distributeJob(0xc001020cc0, 0xc000218d90, {0x258cf18, 0xc000a7d0e0}, 0xc000144d00)
	/home/runner/_work/cnspec/cnspec/policy/scan/local_scanner.go:280 +0x147

To Reproduce
Steps to reproduce the behavior:

  1. Run above command
  2. Note the error

Expected behavior
Create recording.

Desktop (please complete the following information):

  • cnspec 10.7.1

Additional context

Recording of a local scan works:

cnspec scan --record /tmp/eol_ubunut_23_04.json