slim icon indicating copy to clipboard operation
slim copied to clipboard

profile command not running on M1 macs

Open adirook opened this issue 3 years ago • 3 comments

Expected Behavior

Start profiling a container


Actual Behavior

Container failed to start with the following error

cmd=profile info=container status='created' name='dockerslimk_15864_20220623051144' id='e3169e9807fc621ef310d3caae78dc9f08a17e2b87ebe81ab74316bb971a28a1' 
time="2022-06-23T08:11:44+03:00" level=fatal msg="docker-slim: failure" error="API error (400): failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: \"/opt/dockerslim/bin/docker-slim-sensor\": stat /opt/dockerslim/bin/docker-slim-sensor: no such file or directory: unknown" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x68\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn({0x102ff33d8, 0x1400000d0b0})\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x3c\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/profile.OnCommand(_, _, {_, _}, _, {_, _}, {_, _}, {_, ...}, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/profile/handler.go:311 +0x1ce4\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/profile.glob..func1(0x1400019db00)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/profile/cli.go:354 +0x15d0\ngithub.com/urfave/cli/v2.(*Command).Run(0x10359d140, 0x1400019c540)\n\tgithub.com/urfave/cli/[email protected]/command.go:163 +0x50c\ngithub.com/urfave/cli/v2.(*App).RunContext(0x14000188680, {0x102ffaac8?, 0x14000038098}, {0x1400019c080, 0x4, 0x4})\n\tgithub.com/urfave/cli/[email protected]/app.go:313 +0x888\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/[email protected]/app.go:224\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands.(*InteractiveApp).execute(0x14000095ef0, {0x14000042360?, 0x102ea4301?})\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/cliprompt.go:101 +0x330\ngithub.com/c-bata/go-prompt.(*Prompt).Run(0x1400019e380)\n\tgithub.com/c-bata/[email protected]/prompt.go:85 +0x6f8\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(0x1400058cd80?)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/cli.go:172 +0x58\ngithub.com/urfave/cli/v2.(*App).RunContext(0x14000188680, {0x102ffaac8?, 0x14000038098}, {0x14000030200, 0x1, 0x1})\n\tgithub.com/urfave/cli/[email protected]/app.go:322 +0x700\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/[email protected]/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 +0x50\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:15 +0x1c8\n" version="darwin|Transformer|1.37.5|latest|latest"


Steps to Reproduce the Problem

  1. run the profile command on an M1 mac

Specifications

cmd=version info=app version='darwin|Transformer|1.37.5|latest|latest' container=false dsimage=false
cmd=version info=app outdated=true current=1.37.6 verdict='your installed version is OUTDATED (local=1.37.5 current=1.37.6)'
cmd=version info=app location='/opt/homebrew/bin'
cmd=version info=host osname='other'
cmd=version info=host osbuild=21F79
cmd=version info=host version=' Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000'
cmd=version info=host release=21.5.0
cmd=version info=host sysname=darwin
cmd=version info=docker name=docker-desktop
cmd=version info=docker kernel_version=5.10.104-linuxkit
cmd=version info=docker operating_system=Docker Desktop
cmd=version info=docker ostype=linux
cmd=version info=docker server_version=20.10.14
cmd=version info=docker architecture=aarch64
cmd=version info=dclient api_version=1.41
cmd=version info=dclient min_api_version=1.12
cmd=version info=dclient build_time=2022-03-24T01:45:44.000000000+00:00
cmd=version info=dclient git_commit=87a90dc

adirook avatar Jun 23 '22 05:06 adirook

Thank you for opening the issue @adirook ! Looks like there's a problem mounting the sensor into the temp container... Is it only with the profile command or do you get the same with the build command too?

kcq avatar Jul 06 '22 04:07 kcq

Same on build command :

➜  ~ docker-slim build nginx                   
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 rt.as.user='true' keep.perms='true' tags='' target.type='image' target='nginx' continue.mode='probe' 
cmd=build state=image.inspection.start
cmd=build info=image id='sha256:7bbc8783b8ecfdb6453396805cc0fb5fcdaf1b16cbb907c8ab1b8685732d50a4' size.bytes='102757429' size.human='103 MB' 
cmd=build info=image.stack name='nginx:1.14.2' id='sha256:7bbc8783b8ecfdb6453396805cc0fb5fcdaf1b16cbb907c8ab1b8685732d50a4' index='0' 
cmd=build info=image.exposed_ports list='80' 
cmd=build state=image.inspection.done
cmd=build state=container.inspection.start
cmd=build info=container name='dockerslimk_7450_20220706065224' id='19ae7a72983084f0d3e9609d8e3639b657e432350acbde0d9bfbe9816969a2fc' status='created' 
cmd=build info=report file='slim.report.json' 
time="2022-07-06T09:52:25+03:00" level=fatal msg="docker-slim: failure" error="API error (400): failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: \"/opt/dockerslim/bin/docker-slim-sensor\": stat /opt/dockerslim/bin/docker-slim-sensor: no such file or directory: unknown" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x68\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn({0x10180f3d8, 0x140006a8fd8})\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x3c\ngithub.com/docker-slim/docker-slim/pkg/app.(*ExecutionContext).FailOn(0x140004ef080?, {0x10180f3d8?, 0x140006a8fd8?})\n\tgithub.com/docker-slim/docker-slim/pkg/app/execontext.go:49 +0x48\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(_, _, {_, _}, _, _, _, _, _, _, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:1061 +0x4da4\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0x140000c2780)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:662 +0x37e0\ngithub.com/urfave/cli/v2.(*Command).Run(0x101db8600, 0x14000090580)\n\tgithub.com/urfave/cli/[email protected]/command.go:163 +0x50c\ngithub.com/urfave/cli/v2.(*App).RunContext(0x14000003380, {0x101816ac8?, 0x140001a0008}, {0x14000194090, 0x3, 0x3})\n\tgithub.com/urfave/cli/[email protected]/app.go:313 +0x888\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/[email protected]/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 +0x50\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:15 +0x1c8\n" version="darwin|Transformer|1.37.5|latest|latest"

adirook avatar Jul 06 '22 06:07 adirook

Thanks for confirming! That's what i expected... Can you share the list of your docker volumes (the ones that include docker-slim in their name) and then can you list their content (eg docker run -it --rm -v docker-slim-sensor.1.37.6:/dss alpine ls -lh /dss)

kcq avatar Jul 07 '22 06:07 kcq