Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permission denied ": unknown" #90

Open
mrmason opened this issue Oct 1, 2019 · 10 comments

Comments

@mrmason
Copy link

commented Oct 1, 2019

Hi,

I'm using Fedora 30

**$ docker --version**
Docker version 19.03.2, build 6a30dfc
**$ docker-slim -v**
docker-slim version linux|Transformer|1.25.3|b5aef546a575de242b2c3ace97e1fc11f028b137|2019-08-04_04:31:18PM
**$ which docker-slim** 
/usr/local/bin/docker-slim

on a totally clean install of docker, I'm seeing the following error.

**docker pull ubuntu:14.04**

14.04: Pulling from library/ubuntu
a7344f52cb74: Pull complete 
515c9bb51536: Pull complete 
e1eabe0537eb: Pull complete 
4701f1215c13: Pull complete 
Digest: sha256:2f7c79927b346e436cc14c92bd4e5bd778c3bd7037f35bc639ac1589a7acfa90
Status: Downloaded newer image for ubuntu:14.04
docker.io/library/ubuntu:14.04



 **$ sudo docker-slim build ubuntu:14.04**

docker-slim[build]: info=http.probe message='using default probe'
docker-slim[build]: state=started
docker-slim[build]: info=params target=ubuntu:14.04 continue.mode=enter
docker-slim[build]: state=image.inspection.start
docker-slim[build]: info=image id=sha256:2c5e00d77a67934d5e39493477f262b878f127b9c01b491f06d8f06f78819578 size.bytes=188195735 size.human=188 MB
docker-slim[build]: info=image.stack index=0 name='ubuntu:14.04' id='sha256:2c5e00d77a67934d5e39493477f262b878f127b9c01b491f06d8f06f78819578'
docker-slim[build]: state=image.inspection.done
docker-slim[build]: state=container.inspection.start
docker-slim[build]: info=container status=created id=f71c98947c6b7e309625dfb295c2a1996cedf7ee798c3fa99ad5ecfe1bfeb923
time="2019-10-01T11:33:46+01:00" level=fatal msg="docker-slim: failure" error="API error (400): {"message":"OCI runtime create failed: container_linux.go:345: starting container process caused \"exec: \\\"/opt/dockerslim/bin/sensor\\\": permission denied\": unknown"}
" stack="goroutine 1 [running]:
runtime/debug.Stack(0x1, 0xc0001e6480, 0xc00002f400)
	/usr/local/Cellar/go/1.11.1/libexec/src/runtime/debug/stack.go:24 +0xa7
github.com/docker-slim/docker-slim/pkg/util/errutil.FailOn(0x98ad80, 0xc0004a8080)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:14 +0x51
github.com/docker-slim/docker-slim/internal/app/master/commands.OnBuild(0x86d701, 0x0, 0x0, 0x0, 0xc00022e280, 0xe, 0xc0001760c0, 0x0, 0x0, 0x7ffc41ee0743, ...)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/commands/build.go:216 +0xfc0
github.com/docker-slim/docker-slim/internal/app/master.init.0.func6(0xc000182140, 0x0, 0xc000182140)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/cli.go:682 +0x1310
github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli.HandleAction(0x85c9c0, 0x920a38, 0xc000182140, 0xc00017a000, 0x0)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli/app.go:485 +0xc8
github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli.Command.Run(0x900af0, 0x5, 0x0, 0x0, 0xc000067870, 0x1, 0x1, 0x919408, 0x3e, 0x0, ...)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli/command.go:207 +0x991
github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli.(*App).Run(0xc0000aab60, 0xc00001c090, 0x3, 0x3, 0x0, 0x0)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli/app.go:250 +0x6ea
github.com/docker-slim/docker-slim/internal/app/master.runCli()
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/cli.go:1027 +0x55
github.com/docker-slim/docker-slim/internal/app/master.Run()
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/app.go:6 +0x25
main.main()
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/cmd/docker-slim/main.go:8 +0x20
" version="linux|Transformer|1.25.3|b5aef546a575de242b2c3ace97e1fc11f028b137|2019-08-04_04:31:18PM" 

I have also tried running docker-slim as my user, from a local binary, with the correct permissions and I'm getting the same error.

I have asked collegues to test this, and they're seeing the same thing on other OS as well, Pop OS specifically.

Is there any more information I can provide to try and find the source of this problem ?

@mrmason

This comment has been minimized.

Copy link
Author

commented Oct 1, 2019

docker-slim --debug version
time="2019-10-01T12:02:18+01:00" level=debug msg="sysinfo => system.SystemInfo{Sysname:"Linux", Nodename:"tom-x1c6", Release:"5.2.15-200.fc30.x86_64", Version:"#1 SMP Mon Sep 16 15:17:36 UTC 2019", Machine:"x86_64", Domainname:"(none)", OsName:"Fedora 30 (Workstation Edition)", OsBuild:""}" 
time="2019-10-01T12:02:18+01:00" level=debug msg="docker-slim: new Docker client (default) [6]" 
time="2019-10-01T12:02:18+01:00" level=debug msg="docker-slim: configured DOCKER_HOST env var" 
docker-slim[version]: linux|Transformer|1.25.3|b5aef546a575de242b2c3ace97e1fc11f028b137|2019-08-04_04:31:18PM
time="2019-10-01T12:02:19+01:00" level=debug msg="version.Check: http status = 200 OK" app=docker-slim 
Version Status: your have the latest version
host:
OsName=Fedora 30 (Workstation Edition)
OsBuild=
Version=#1 SMP Mon Sep 16 15:17:36 UTC 2019
Release=5.2.15-200.fc30.x86_64
Sysname=Linux
docker:
Name=tom-x1c6
KernelVersion=5.2.15-200.fc30.x86_64
OperatingSystem=Fedora 30 (Workstation Edition)
OSType=linux
ServerVersion=19.03.2
Architecture=x86_64
ApiVersion=1.40
MinAPIVersion=1.12
BuildTime=2019-08-29T05:28:12.000000000+00:00
GitCommit=6a30dfc
@kcq

This comment has been minimized.

Copy link
Member

commented Oct 5, 2019

@mrmason Thank you for reporting this! Sorry for the headaches! There are a few things going on here that could contribute to the results (directly or indirectly)...

The error itself might indicate that the sensor executable mounted to the target container is missing the execute permission or mounting the sensor failed for some reason. Can you double check that the docker-slim-sensor executable on your local machine (where you installed docker-slim) has the execute bit set... and can you also check if /opt/dockerslim/bin/sensor exists in the temporary container docker-slim created.

It also looks like you are trying to minify a base ubuntu 14.04 image, which isn't the best use case for docker-slim. docker-slim is more useful when you have an application container image otherwise there won't be much left in the minified container.

Fedora is also not a tested host environment and there might be unexpected side effects related to how Redhat sets up their OS (they are known for it... had problems with CentOS, for example).

@mrmason

This comment has been minimized.

Copy link
Author

commented Oct 8, 2019

It looks like /opt/dockerslim/bin/sensor is a folder in the slim image, so I'm guessing that's the issue ?

$ root@6880a6b80bab:/opt/dockerslim/bin/sensor# ls -la
total 8
drwxr-xr-x. 2 root root 4096 Oct  8 08:02 .
drwxr-xr-x. 3 root root 4096 Oct  8 08:02 ..
@mrmason

This comment has been minimized.

Copy link
Author

commented Oct 8, 2019

permisisons seem fine on the executable on the host machine

$ ls -la /usr/local/bin/docker-slim
-rwxr-xr-x. 1 root root 9246368 Sep 30 09:52 /usr/local/bin/docker-slim
@kcq

This comment has been minimized.

Copy link
Member

commented Oct 9, 2019

Thanks for checking @mrmason ! Somehow the sensor mount failed and the target container ended up with a dummy folder instead of the sensor binary. I'd like to repro the condition. Is there anything special in your Docker installation on Fedora?

@mrmason

This comment has been minimized.

Copy link
Author

commented Oct 9, 2019

Nothing special at all - here are the exact versions

$ rpm -qa | grep 'docker'
docker-ce-cli-19.03.2-3.fc30.x86_64
docker-ce-19.03.2-3.fc30.x86_64
@mrmason

This comment has been minimized.

Copy link
Author

commented Oct 9, 2019

This is also happening on our gitlab-ci runners, using ubuntu as a base, and then running docker:latest which is alpine.

root@ubuntu:~# docker -v
Docker version 18.06.3-ce, build d7080c1
root@ubuntu:~# docker images | grep 'docker'
docker                                                  latest                                     b40e5afd78f5        4 weeks ago         216MB

gitlab failure output

$ /builds/docker-slim --state-path '/builds/docker-slim-state/' build --tag $CI_COMMIT_SHA-slim --http-probe=false $CI_COMMIT_SHA-fat
docker-slim[build]: state=started
docker-slim[build]: info=params target=f420ff468062d5d82809c11eb058df79e87e9aad-fat continue.mode=enter
docker-slim[build]: state=image.inspection.start
docker-slim[build]: info=image id=sha256:aba6c6f38bd6117484e0ff3d47d0a70e035b7556d48822df0755448ab03d6645 size.bytes=473075818 size.human=473 MB
docker-slim[build]: info=image.users exe='nexus' all='nexus'
docker-slim[build]: info=image.stack index=0 name='ruby:2.5.3-slim' id='sha256:77ae629291813ec3ba2c91d9437d5deadbb83e29ed77f6d649a9d79159f3b6d7'
docker-slim[build]: info=image.stack index=1 name='f420ff468062d5d82809c11eb058df79e87e9aad-fat:latest' id='sha256:aba6c6f38bd6117484e0ff3d47d0a70e035b7556d48822df0755448ab03d6645'
docker-slim[build]: info=image.exposed_ports list='3000'
docker-slim[build]: state=image.inspection.done
docker-slim[build]: state=container.inspection.start
docker-slim[build]: info=container status=created id=e4023444046665e0414ac6c18f9b57178f0ecfb66544f4710372a2c317633dda
time="2019-10-01T11:37:27Z" level=fatal msg="docker-slim: failure" error="API error (400): {"message":"OCI runtime create failed: container_linux.go:348: starting container process caused \"exec: \\\"/opt/dockerslim/bin/sensor\\\": permission denied\": unknown"}
" stack="goroutine 1 [running]:
runtime/debug.Stack(0x5, 0xc00013cf00, 0xc000198300)
	/usr/local/Cellar/go/1.11.1/libexec/src/runtime/debug/stack.go:24 +0xa7
github.com/docker-slim/docker-slim/pkg/util/errutil.FailOn(0x98ad80, 0xc000294c60)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:14 +0x51
github.com/docker-slim/docker-slim/internal/app/master/commands.OnBuild(0x86d701, 0x0, 0x0, 0x0, 0x7fff0e04e216, 0x1a, 0xc000071b90, 0x0, 0x0, 0x7fff0e04e27e, ...)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/commands/build.go:216 +0xfc0
github.com/docker-slim/docker-slim/internal/app/master.init.0.func6(0xc0000d4b40, 0x100, 0xc0000d4b40)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/cli.go:682 +0x1310
github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli.HandleAction(0x85c9c0, 0x920a38, 0xc0000d4b40, 0xc000064600, 0x0)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli/app.go:485 +0xc8
github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli.Command.Run(0x900af0, 0x5, 0x0, 0x0, 0xc000031740, 0x1, 0x1, 0x919408, 0x3e, 0x0, ...)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli/command.go:207 +0x991
github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli.(*App).Run(0xc00008ab60, 0xc00001c080, 0x8, 0x8, 0x0, 0x0)
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/vendor/github.com/codegangsta/cli/app.go:250 +0x6ea
github.com/docker-slim/docker-slim/internal/app/master.runCli()
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/cli.go:1027 +0x55
github.com/docker-slim/docker-slim/internal/app/master.Run()
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/internal/app/master/app.go:6 +0x25
main.main()
	/Users/q/docker-slim/docker-slim/_gopath/src/github.com/docker-slim/docker-slim/cmd/docker-slim/main.go:8 +0x20
" version="linux|Transformer|1.25.3|b5aef546a575de242b2c3ace97e1fc11f028b137|2019-08-04_04:31:18PM" 
ERROR: Job failed: exit code 1
@kcq

This comment has been minimized.

Copy link
Member

commented Oct 11, 2019

Not surprised about the gitlab-ci environment. The official support for that is coming soon (in 1.26).

@kcq

This comment has been minimized.

Copy link
Member

commented Oct 11, 2019

So you are running Fedora and you installed/copied the docker-slim executables to the /usr/local/bin directory, right?

@mrmason

This comment has been minimized.

Copy link
Author

commented Oct 11, 2019

I have tried installing it there, and also in my own user environment, and also locally to the project - same problem with all 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.