slimtoolkit / slimtoolkit/slim

API error (404): Could not find the file /opt/dockerslim/artifacts/creport.json in container

Open
#292 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

  • Docker-slim should minify a 5GB docker image

Actual Behavior

  • level=fatal msg="docker-slim: failure" error="API error (404): Could not find the file /opt/dockerslim/artifacts/creport.json in container c6558fa8fa08e1ccbfd7c28bd23da098788d369fb42e9e57d991bf1bafb1d5eb" stack="goroutine 1

Steps to Reproduce the Problem

  1. Grab this docker file, from here
  2. Build docker image (standard) docker build -t rembg
  3. This will produce a 5.0 GB rembd docker image
  4. Invoke docker-slim to minify this image docker-slim build rembg --http-probe=false

Specifications

  • Version: 1.37.3
  • Platform: MacOS - Darwin

Logs

$ docker-slim build rembg --http-probe=false
docker-slim: message='join the Gitter channel to ask questions or to share your feedback' info='https://gitter.im/docker-slim/community'
docker-slim: message='join the Discord server to ask questions or to share your feedback' info='https://discord.gg/9tDyxYS'
docker-slim: message='Github discussions' info='https://github.com/docker-slim/docker-slim/discussions'
cmd=build info=exec message='changing continue-after from probe to nothing because http-probe is disabled'
cmd=build info=exec message='changing continue-after to enter'
cmd=build state=started
cmd=build info=params target.type='image' target='rembg' continue.mode='enter' rt.as.user='true' keep.perms='true' tags=''
cmd=build state=image.inspection.start
cmd=build info=image size.human='5.1 GB' id='sha256:ebf916f1382706af6dc7f172e4dd10db8e53c4016accdfe759e678a44a6c9951' size.bytes='5086630999'
cmd=build info=image.stack index='0' name='rembg:latest' id='sha256:ebf916f1382706af6dc7f172e4dd10db8e53c4016accdfe759e678a44a6c9951'
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container status='created' name='dockerslimk_24613_20220222043146' id='c6558fa8fa08e1ccbfd7c28bd23da098788d369fb42e9e57d991bf1bafb1d5eb'
cmd=build info=cmd.startmonitor status='sent'
cmd=build info=event.startmonitor.done status='received'
cmd=build info=container id='c6558fa8fa08e1ccbfd7c28bd23da098788d369fb42e9e57d991bf1bafb1d5eb' target.port.list='' target.port.info='' message='YOU CAN USE THESE PORTS TO INTERACT WITH THE CONTAINER' name='dockerslimk_24613_20220222043146'
cmd=build info=continue.after mode='enter' message='provide the expected input to allow the container inspector to continue its execution'
cmd=build prompt='USER INPUT REQUIRED, PRESS <ENTER> WHEN YOU ARE DONE USING THE CONTAINER'

cmd=build state=container.inspection.finishing
time="2022-02-22T10:04:54+05:30" level=error msg="ipc.Client.GetEvent(): event channel error = EOF\n"
time="2022-02-22T10:04:54+05:30" level=warning msg="docker-slim: warning" error=EOF stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.WarnOn({0x19cd600, 0xc0001960f0})\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:38 +0x5e\ngithub.com/docker-slim/docker-slim/pkg/app/master/inspectors/container.(*Inspector).FinishMonitoring(0xc0002f2000)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/inspectors/container/container_inspector.go:1104 +0x205\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(_, _, {_, _}, _, {_, _}, {_, _}, {0x0, ...}, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:1079 +0x5937\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0xc0005689a0)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:629 +0x4166\ngithub.com/urfave/cli.HandleAction({0x176ff00, 0x18cef98}, 0x5)\n\tgithub.com/urfave/cli@v1.22.4/app.go:526 +0xa8\ngithub.com/urfave/cli.Command.Run({{0x18878cf, 0x5}, {0x0, 0x0}, {0x1f96dd0, 0x1, 0x1}, {0x18c20a3, 0x6c}, {0x0, ...}, ...}, ...)\n\tgithub.com/urfave/cli@v1.22.4/command.go:174 +0x652\ngithub.com/urfave/cli.(*App).Run(0xc00041e000, {0xc0001a4040, 0x4, 0x4})\n\tgithub.com/urfave/cli@v1.22.4/app.go:279 +0x80c\ngithub.com/docker-slim/docker-slim/pkg/app/master.Run()\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/app.go:15 +0x38\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:8 +0x17\n" version="darwin|Transformer|1.37.3|latest|latest"
time="2022-02-22T10:04:54+05:30" level=error msg="channel.CommandClient.Call: c.Read error = EOF"
time="2022-02-22T10:04:54+05:30" level=error msg="ipc.Client.SendCommand() cmd channel call error=EOF\n"
time="2022-02-22T10:04:54+05:30" level=error msg="dockerutil.CopyFromContainer: dclient.DownloadFromContainer() error = API error (404): Could not find the file /opt/dockerslim/artifacts/creport.json in container c6558fa8fa08e1ccbfd7c28bd23da098788d369fb42e9e57d991bf1bafb1d5eb"
time="2022-02-22T10:04:54+05:30" level=fatal msg="docker-slim: failure" error="API error (404): Could not find the file /opt/dockerslim/artifacts/creport.json in container c6558fa8fa08e1ccbfd7c28bd23da098788d369fb42e9e57d991bf1bafb1d5eb" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn({0x19cd920, 0xc00037a720})\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x5e\ngithub.com/docker-slim/docker-slim/pkg/app/master/inspectors/container.(*Inspector).ShutdownContainer(0xc0002f2000)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/inspectors/container/container_inspector.go:1023 +0x18a\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(_, _, {_, _}, _, {_, _}, {_, _}, {0x0, ...}, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:1082 +0x5992\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0xc0005689a0)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:629 +0x4166\ngithub.com/urfave/cli.HandleAction({0x176ff00, 0x18cef98}, 0x5)\n\tgithub.com/urfave/cli@v1.22.4/app.go:526 +0xa8\ngithub.com/urfave/cli.Command.Run({{0x18878cf, 0x5}, {0x0, 0x0}, {0x1f96dd0, 0x1, 0x1}, {0x18c20a3, 0x6c}, {0x0, ...}, ...}, ...)\n\tgithub.com/urfave/cli@v1.22.4/command.go:174 +0x652\ngithub.com/urfave/cli.(*App).Run(0xc00041e000, {0xc0001a4040, 0x4, 0x4})\n\tgithub.com/urfave/cli@v1.22.4/app.go:279 +0x80c\ngithub.com/docker-slim/docker-slim/pkg/app/master.Run()\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/app.go:15 +0x38\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:8 +0x17\n" version="darwin|Transformer|1.37.3|latest|latest"

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 with pkg/app/master/inspectors/container/container_inspector.go at FinishMonitoring and ShutdownContainer, then trace the build flow in pkg/app/master/commands/build/handler.go. Reproduce with the rembg Dockerfile, a 5GB image, and docker-slim build rembg --http-probe=false; done means the inspection completes without the missing creport.json 404 and the image is minified successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.