jfrog-cli icon indicating copy to clipboard operation
jfrog-cli copied to clipboard

jf build-scan results in "index out of range" panic error

Open bgardner-noggin opened this issue 2 years ago • 0 comments

Describe the bug

Invoking jf build-scan results in the following error using 2.52.10

panic: runtime error: index out of range [0] with length 0

Note that this does not occur when using 2.52.9

Current behavior

08:47:37 [Debug] JFrog CLI version: 2.52.10
08:47:37 [Debug] OS/Arch: linux/amd64
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
[github.com/jfrog/jfrog-cli-core/v2/plugins/common.CreateBuildConfiguration(0xc0003c5e00)](http://github.com/jfrog/jfrog-cli-core/v2/plugins/common.CreateBuildConfiguration(0xc0003c5e00))
	/root/go/pkg/mod/github.com/jfrog/jfrog-cli-core/[email protected]/plugins/common/config.go:17 +0x166
[github.com/jfrog/jfrog-cli-security/cli.BuildScan(0xc0003c5e00)](http://github.com/jfrog/jfrog-cli-security/cli.BuildScan(0xc0003c5e00))
	/root/go/pkg/mod/github.com/jfrog/[email protected]/cli/scancommands.go:276 +0x30
[github.com/jfrog/jfrog-cli-core/v2/plugins/components.getActionFunc.func1(0xc0002a4580?)](http://github.com/jfrog/jfrog-cli-core/v2/plugins/components.getActionFunc.func1(0xc0002a4580?))
	/root/go/pkg/mod/github.com/jfrog/jfrog-cli-core/[email protected]/plugins/components/conversionlayer.go:372 +0x54
[github.com/urfave/cli.HandleAction](http://github.com/urfave/cli.HandleAction)({0xfb74a0?, 0xc0003dc990?}, 0xa?)
	/root/go/pkg/mod/github.com/urfave/[email protected]/app.go:522 +0xb0
[github.com/urfave/cli.Command.Run](http://github.com/urfave/cli.Command.Run)({{0x110ee89, 0xa}, {0x0, 0x0}, {0xc0003dc560, 0x1, 0x1}, {0x0, 0x0}, {0xc0001655c0, ...}, ...}, ...)
	/root/go/pkg/mod/github.com/urfave/[email protected]/command.go:175 +0x67b
[github.com/urfave/cli.(*App](http://github.com/urfave/cli.(*App)).Run(0xc00017c700, {0xc000132040, 0x4, 0x4})
	/root/go/pkg/mod/github.com/urfave/[email protected]/app.go:277 +0xb87
main.execMain()
	/var/jenkins_home/workspace/eco-system/release/jfrog-cli-release/temp/jfrog-cli/main.go:139 +0x4b3
main.main()
	/var/jenkins_home/workspace/eco-system/release/jfrog-cli-release/temp/jfrog-cli/main.go:78 +0x25

Reproduction steps

Using an NPM based package. The following commands are being run inside a docker container based on the container

amazon/aws-lambda-nodejs:18

jf npm ci
jf rt upload "src/*" "${NGJFROG_LOCAL_REPOSITORY}/"
jf rt upload package.json "${NGJFROG_LOCAL_REPOSITORY}/"
jf rt build-add-git
jf rt build-publish
jf build-scan --format=simple-json --rescan=true

Expected behavior

No response

JFrog CLI version

2.52.9

Operating system type and version

Amazon linux 2

JFrog Artifactory version

No response

JFrog Xray version

No response

bgardner-noggin avatar Jan 28 '24 23:01 bgardner-noggin