slimtoolkit / slimtoolkit/slim

"wait timeout" error when i slim nginx image

Open
#305 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm having the following problem while shrinking nginx images with docker slim. I'm not sure if I'm doing it correctly and hope I can get an answer in this issue. Thanks!
My environment: Ubuntu 21.04 VMware virtual machine

>>> build --target nginx:latest --http-probe true
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=param.http.probe message='using default probe'
cmd=build state=started
cmd=build info=params target.type='image' target='nginx:latest' continue.mode='probe' rt.as.user='true' keep.perms='true' tags=''
cmd=build state=image.inspection.start
cmd=build info=image size.human='142 MB' id='sha256:f2f70adc5d89aa922836e9cc6801980a12a7ff9012446cc6edf52ef8798a67bd' size.bytes='141523072'
cmd=build info=image.stack index='0' name='nginx:latest' id='sha256:f2f70adc5d89aa922836e9cc6801980a12a7ff9012446cc6edf52ef8798a67bd'
cmd=build info=image.exposed_ports list='80'
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container status='created' name='dockerslimk_20108_20220329014545' id='90a147e3615bcde72dac825e293bd88a250054cf869def19a6b9b861b65f5b23'
cmd=build info=container status='running' name='dockerslimk_20108_20220329014545' id='90a147e3615bcde72dac825e293bd88a250054cf869def19a6b9b861b65f5b23'
cmd=build info=container message='obtained IP address' ip='172.17.0.2'
time="2022-03-29T09:46:08+08:00" level=error msg="channel.Client.Read: read error (read tcp 127.0.0.1:35068->127.0.0.1:49173: read: connection reset by peer), exiting..."
time="2022-03-29T09:46:08+08:00" level=error msg="channel.NewCommandClient: channel verify error = read tcp 127.0.0.1:35068->127.0.0.1:49173: read: connection reset by peer"
time="2022-03-29T09:46:34+08:00" level=error msg="channel.Client.Read: read error (read tcp 127.0.0.1:35076->127.0.0.1:49173: read: connection reset by peer), exiting..."
time="2022-03-29T09:46:34+08:00" level=error msg="channel.NewCommandClient: channel verify error = read tcp 127.0.0.1:35076->127.0.0.1:49173: read: connection reset by peer"
time="2022-03-29T09:47:00+08:00" level=error msg="channel.Client.Read: read error (read tcp 127.0.0.1:35084->127.0.0.1:49173: read: connection reset by peer), exiting..."
time="2022-03-29T09:47:00+08:00" level=error msg="channel.NewCommandClient: channel verify error = read tcp 127.0.0.1:35084->127.0.0.1:49173: read: connection reset by peer"
time="2022-03-29T09:47:05+08:00" level=error msg="ipc.NewClient init error = wait timeout"
cmd=build info=report file='slim.report.json'
time="2022-03-29T09:47:05+08:00" level=fatal msg="docker-slim: failure" error="wait timeout" stack="goroutine 1 [running]:\nruntime/debug.Stack(0xc000274b20, 0xf658f4, 0xc00033c360)\n\truntime/debug/stack.go:24 +0x9f\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn(0x10cb3c0, 0xc0002f9450)\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x54\ngithub.com/docker-slim/docker-slim/pkg/app.(*ExecutionContext).FailOn(0xc0000bb160, 0x10cb3c0, 0xc0002f9450)\n\tgithub.com/docker-slim/docker-slim/pkg/app/execontext.go:49 +0x3a\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(0xc0000bb160, 0xc00050c080, 0xc0000364c0, 0xc, 0x0, 0x0, 0x1748a78, 0x0, 0x0, 0x0, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:1061 +0x3175\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0xc0002a1100, 0x86, 0x130)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:662 +0x3688\ngithub.com/urfave/cli/v2.(*Command).Run(0x16dee00, 0xc0000b0ec0, 0x0, 0x0)\n\tgithub.com/urfave/cli/v2@v2.3.0/command.go:163 +0x4ed\ngithub.com/urfave/cli/v2.(*App).RunContext(0xc000032340, 0x10e2d20, 0xc0000aa010, 0xc0000ae720, 0x6, 0x6, 0x0, 0x0)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81f\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:224\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands.(*InteractiveApp).execute(0xc00019e0f0, 0xc00003f9e0, 0x2e)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/cliprompt.go:101 +0x3c5\ngithub.com/c-bata/go-prompt.(*Prompt).Run(0xc00050df80)\n\tgithub.com/c-bata/go-prompt@v0.2.3/prompt.go:85 +0x838\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands.(*InteractiveApp).Run(...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/cliprompt.go:187\ngithub.com/docker-slim/docker-slim/pkg/app/master.newCLI.func4(0xc0000b0c80, 0xc0005bb500, 0x0)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/cli.go:172 +0x79\ngithub.com/urfave/cli/v2.(*App).RunContext(0xc000032340, 0x10e2d20, 0xc0000aa010, 0xc000096190, 0x1, 0x1, 0x0, 0x0)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:322 +0x70d\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:224\ngithub.com/docker-slim/docker-slim/pkg/app/master.Run()\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/app.go:15 +0x6c\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:15 +0x54\n" version="linux|Transformer|1.37.5|86fbd29ab3549fa564e87e4770178480cb0542d3|2022-03-21_06:10:20AM"

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/commands/build/handler.go around line 1061, then trace the ipc.NewClient timeout and channel.Client connection-reset errors shown in the report. Reproduce the docker-slim build --target nginx:latest --http-probe true command and determine whether the build completes or reports a clear actionable failure instead of wait timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, nginx, ubuntu
Domain
devops, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.