anybox / buttervolume

BTRFS Volume plugin for Docker
Apache License 2.0
81 stars 11 forks source link

Cannot enable plugin: No btrfs.sock created #34

Open crakkhead opened 3 years ago

crakkhead commented 3 years ago

I'm getting an error when installing or enabling the buttervolume plugin. I've tried to install the plugin through the repository:

> docker plugin install anybox/buttervolume
...
Error response from daemon: dial unix /run/docker/plugins/<uuid>/btrfs.sock: connect: no such file or directory

The plugin was installed but cannot be enabled.

> docker plugin ls
ID          NAME                         DESCRIPTION                      ENABLED
<ID>        anybox/buttervolume:latest   BTRFS Volume Plugin for Docker   false

Trying to enable it returns the same error:

> docker plugin enable anybox/buttervolume:latest 
Error response from daemon: dial unix /run/docker/plugins/<uuid>/btrfs.sock: connect: no such file or directory

Apparently the btrfs.sock file isn't created during the installation.

ccomb commented 3 years ago

Hi, thanks for reporting this case, do you have any more information in the logs? Using something like sudo journalctl -f -u docker.service Also what are your version of Docker?

crakkhead commented 3 years ago

Sorry for not providing this basic information in the first place. I'm using Docker version 19.03.11. In the logs this is the output I get when trying to enable the plugin:

Oct 29 13:09:10 hostname dockerd[2126]: time="2020-10-29T13:09:10+01:00" level=error msg="standard_init_linux.go:211: exec user process caused \"exec format error\"" plugin=8ecb7051759b4b32d0006fc8481723c892dcbd9f30f33eeed9790390e61e4b3e
Oct 29 13:09:11 hostname dockerd[2126]: time="2020-10-29T13:09:11+01:00" level=error msg="standard_init_linux.go:211: exec user process caused \"exec format error\"" plugin=8ecb7051759b4b32d0006fc8481723c892dcbd9f30f33eeed9790390e61e4b3e
Oct 29 13:09:23 hostname dockerd[2126]: time="2020-10-29T13:09:23.315028080+01:00" level=error msg="Sending SIGTERM to plugin failed with error: process already finished: not found"
Oct 29 13:09:23 hostname dockerd[2126]: time="2020-10-29T13:09:23.315152929+01:00" level=error msg="Handler for POST /v1.40/plugins/anybox/buttervolume:latest/enable returned error: dial unix /run/docker/plugins/8ecb7051759b4b32d0006fc8481723c892dcbd9f30f33eeed9790390e61e4b3e/btrfs.sock: connect: no such file or directory"
Oct 29 13:09:23 hostname dockerd[2126]: time="2020-10-29T13:09:23.761398911+01:00" level=error msg="Sending SIGTERM to plugin failed with error: process already finished: not found"
crakkhead commented 3 years ago

One more thing: I'm getting the error on a Raspberry Pi 4. I've tried the plugin in a x86 VM and it worked. Is the arm architecture the problem here?

crakkhead commented 3 years ago

I've sorted out the issue. It was indeed due to the arm architecture of the Pi. Specifically the link to the github repo of tini points to the amd64 version of the binary. Changing this to the arm64 version fixed the issue. Otherwise the plugin seems to run well on arm64. Thanks for providing this plugin!

ccomb commented 3 years ago

Thanks a lot for finding the issue. I'm reopening because someone else can find this problem when using arm64 or another arch. It is not obvious in the first place. There should be a way to automate de selection of the arch, or to build tini during the build, or to not use tini at all?

ccomb commented 3 years ago

In the Tini doc I can read

NOTE: If you are using Docker 1.13 or greater, Tini is included in Docker itself. This includes all versions of Docker CE. To enable Tini, just pass the --init flag to docker run.

crakkhead commented 3 years ago

In the Tini doc I can read

NOTE: If you are using Docker 1.13 or greater, Tini is included in Docker itself. This includes all versions of Docker CE. To enable Tini, just pass the --init flag to docker run.

I managed to run the plugin with the docker-init binary provided by my docker installation. I didn't find an equivalent --init option for plugins, so I copied the docker-init from the host into the rootfs directory before plugin creation and adjusted the entrypoint.sh and Dockerfile. Haven't yet tested this setup much, but the tests run fine with the --init option enabled.