slimtoolkit / slimtoolkit/slim

Unable Xray an target image

Open
#693 27 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.4k
Forks
840
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

run slim x nginx:latest --debug --verbose
should return xray reports


Actual Behavior

It gives an API error(500)

md=xray state=started
cmd=xray info=params target='nginx:latest' add-image-manifest='false' add-image-config='false' rm-file-artifacts='false'
cmd=xray state=image.api.inspection.start
cmd=xray info=image size.human='68 MB' architecture='arm64' id='sha256:0f04e4f646a3f14bf31d8bc8d885b6c951fdcf42589d06845f64d18aec6a3c4d' size.bytes='67668418'
cmd=xray info=image.stack index='0' name='nginx:latest' id='sha256:0f04e4f646a3f14bf31d8bc8d885b6c951fdcf42589d06845f64d18aec6a3c4d' instructions='17' message='see report file for details'
cmd=xray info=image.exposed_ports list='80/tcp'
cmd=xray state=image.api.inspection.done
cmd=xray state=image.data.inspection.start
cmd=xray info=image.data.inspection.save.image.start
time="2024-06-13T21:03:44+08:00" level=error msg="dockerutil.SaveImage: dclient.ExportImage() error = API error (500): invalid repository name (0f04e4f646a3f14bf31d8bc8d885b6c951fdcf42589d06845f64d18aec6a3c4d), cannot specify 64-byte hexadecimal strings"
time="2024-06-13T21:03:44+08:00" level=fatal msg="slim: failure" error="API error (500): invalid repository name (0f04e4f646a3f14bf31d8bc8d885b6c951fdcf42589d06845f64d18aec6a3c4d), cannot specify 64-byte hexadecimal strings" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x64\ngithub.com/slimtoolkit/slim/pkg/util/errutil.FailOn({0x102b5ff98, 0x140005220a8})\n\tgithub.com/slimtoolkit/slim/pkg/util/errutil/errutil.go:32 +0x38\ngithub.com/slimtoolkit/slim/pkg/app/master/command/xray.OnCommand(0x140004c0d68, 0x140004c8480, 0x140004c0d88, {0x16f252d37, 0xc}, 0x1, {0x0, 0x0}, {0x0, 0x0}, ...)\n\tgithub.com/slimtoolkit/slim/pkg/app/master/command/xray/handler.go:374 +0x21e0\ngithub.com/slimtoolkit/slim/pkg/app/master/command/xray.glob..func1(0x140000bfa80)\n\tgithub.com/slimtoolkit/slim/pkg/app/master/command/xray/cli.go:337 +0x1710\ngithub.com/urfave/cli/v2.(*Command).Run(0x103c731c0, 0x140000beac0)\n\tgithub.com/urfave/cli/v2@v2.3.0/command.go:163 +0x4a8\ngithub.com/urfave/cli/v2.(*App).RunContext(0x140002c51e0, {0x102b7e098?, 0x103cf1e60}, {0x14000116050, 0x5, 0x5})\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:313 +0x808\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:224\ngithub.com/slimtoolkit/slim/pkg/app/master.Run()\n\tgithub.com/slimtoolkit/slim/pkg/app/master/app.go:15 +0x4c\nmain.main()\n\tgithub.com/slimtoolkit/slim/cmd/slim/main.go:15 +0x194\n" version="darwin/arm64|Transformer|1.40.11|latest|latest"

Specifications

  • Version: slim version darwin/arm64|Transformer|1.40.11|latest|latest
  • Platform: macOS 14.5
  • Docker info
$ docker info
Client:
Version:    26.1.3
Context:    orbstack
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
  Version:  v0.14.1
  Path:     /Users/devlocal/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
  Version:  v2.27.1
  Path:     /Users/devlocal/.docker/cli-plugins/docker-compose

Server:
Containers: 4
Running: 1
Paused: 0
Stopped: 3
Images: 51
Server Version: 26.1.4
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3a4de459a68952ffb703bbe7f2290861a75b6b67
runc version: 51d5e94601ceffbbd85688df1c928ecccbfa4685
init version: de40ad0
Security Options:
seccomp
 Profile: builtin
cgroupns
Kernel Version: 6.9.3-orbstack-00146-g1a8d02c90788
Operating System: OrbStack
OSType: linux
Architecture: aarch64
CPUs: 12
Total Memory: 15.59GiB
Name: orbstack
ID: ed3c0974-9b58-465e-906c-ea982b257a80
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Default Address Pools:
 Base: 192.168.215.0/24, Size: 24
 Base: 192.168.228.0/24, Size: 24
 Base: 192.168.247.0/24, Size: 24
 Base: 192.168.207.0/24, Size: 24
 Base: 192.168.167.0/24, Size: 24
 Base: 192.168.107.0/24, Size: 24
 Base: 192.168.237.0/24, Size: 24
 Base: 192.168.148.0/24, Size: 24
 Base: 192.168.214.0/24, Size: 24
 Base: 192.168.165.0/24, Size: 24
 Base: 192.168.227.0/24, Size: 24
 Base: 192.168.181.0/24, Size: 24
 Base: 192.168.158.0/24, Size: 24
 Base: 192.168.117.0/24, Size: 24
 Base: 192.168.155.0/24, Size: 24
 Base: 192.168.147.0/24, Size: 24
 Base: 192.168.229.0/24, Size: 24
 Base: 192.168.183.0/24, Size: 24
 Base: 192.168.156.0/24, Size: 24
 Base: 192.168.97.0/24, Size: 24
 Base: 192.168.171.0/24, Size: 24
 Base: 192.168.186.0/24, Size: 24
 Base: 192.168.216.0/24, Size: 24
 Base: 192.168.242.0/24, Size: 24
 Base: 192.168.166.0/24, Size: 24
 Base: 192.168.239.0/24, Size: 24
 Base: 192.168.223.0/24, Size: 24
 Base: 192.168.164.0/24, Size: 24
 Base: 192.168.163.0/24, Size: 24
 Base: 192.168.172.0/24, Size: 24
 Base: 172.17.0.0/16, Size: 16
 Base: 172.18.0.0/16, Size: 16
 Base: 172.19.0.0/16, Size: 16
 Base: 172.20.0.0/14, Size: 16
 Base: 172.24.0.0/14, Size: 16
 Base: 172.28.0.0/14, Size: 16

Contributor guide

Open the contributing guide

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 by reproducing slim x nginx:latest --debug --verbose, then inspect pkg/app/master/command/xray/handler.go around line 374 and the reported dockerutil.SaveImage failure. Trace how the image ID is passed to Docker's export operation; done means the command completes and returns Xray reports for the target image without the API error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.