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

Docker service not starting with ZFS storage driver. #10127

Closed
Nekroze opened this issue Sep 29, 2015 · 6 comments
Closed

Docker service not starting with ZFS storage driver. #10127

Nekroze opened this issue Sep 29, 2015 · 6 comments

Comments

@Nekroze
Copy link
Contributor

Nekroze commented Sep 29, 2015

Hello. First issue here so bare with me please.

I am using the unstable channel of NixOS and have my root partition on ZFS. Naturally i wanted to use the ZFS storage driver for Docker however when I set the option virtualisation.docker.storageDriver the docker systemd service fails to start and gives this error:

Error starting daemon: error initializing graphdriver: driver not supported

It appears the only storageDriver option I can set and have docker work is devicemapper.

My apologies if I am missing something here but I even tried to create a new ZFS volume for docker and mounted it on /var/lib/docker with no change in error. I looked at the source code for what triggers the error and noticed a different error is shown if your filesystem is wrong or what not and that this error appears specific to docker not supporting it as if its components were not installed.

Perhaps I am missing the obvious in that docker just does not have zfs support however it is listed as a valid option for the virtualisation.docker.storageDriver option. If this is the case then it should be removed from the valid options there.

Thank you for all your work on the awesomeness that is Nix/NixOS!

@Nekroze
Copy link
Contributor Author

Nekroze commented Sep 29, 2015

I did end playing around with this more and noticed that I can successfully start the docker daemon so long as I use the command in the systemd file in a shell as root. however systemd executing the same thing fails and causes the error. Oddly enough I am now getting a different error from the systemd service, the one that shows that docker is capable of using the specified storage driver but that something else went wrong.

Error starting daemon: error initializing graphdriver: prerequisites for driver not satisfied (wrong filesystem?)

The part that is confusing me, and I think the crux of the issue, is that I can start the daemon in a shell as root but systemd can't.

@offlinehacker
Copy link
Contributor

Hmm, i haven't tried with zfs, but it wirks for example with brtfs just fine. Are you running same version in shell as with systemd?

@Nekroze
Copy link
Contributor Author

Nekroze commented Oct 1, 2015

@offlinehacker Indeed i have tried running the executable mentioned in systemd by specifying the full path. Just dont understand why systemd fails to start the service when I can run the command it says is failing.

@Nekroze Nekroze changed the title Docker package does not support ZFS storage driver. Docker service not starting with ZFS storage driver. Oct 2, 2015
@cransom
Copy link
Contributor

cransom commented Oct 4, 2015

I can confirm this. The issue is that the ZFS storage driver makes calls to the zfs binary which doesn't exist in the systemd $PATH when this is started.

cransom pushed a commit to cransom/nixpkgs that referenced this issue Oct 4, 2015
When using the ZFS storagedriver in docker, it shells out for the ZFS
commands. The path configuration for the systemd task does not include
ZFS, so if the driver is set to ZFS, add ZFS utilities to the PATH.

This will resolve NixOS#10127
bjornfor pushed a commit that referenced this issue Oct 4, 2015
When using the ZFS storagedriver in docker, it shells out for the ZFS
commands. The path configuration for the systemd task does not include
ZFS, so if the driver is set to ZFS, add ZFS utilities to the PATH.

This will resolve #10127

[Bjørn: prefix commit message with "nixos/docker:", remove extra space
before ';']

(cherry picked from commit 791b600)
@Nekroze
Copy link
Contributor Author

Nekroze commented Oct 5, 2015

@cransom Thanks for figuring this one out and resolving, Cheers mate!

@Nekroze
Copy link
Contributor Author

Nekroze commented Oct 16, 2015

Hi,

I am now using the docker version that has since been patched however I have the same issue.

Currently I have a version with this change. I am not a nix expression writer (yet) but perhaps this is causing it to now work again?

I was not able to get in and test it before the channel moved on to this sadly so I cannot confirm that it was working with your change @cransom so it may not be that change that causes the issue to persist.

Would appreciate any assistance!

adrianpk added a commit to adrianpk/nixpkgs that referenced this issue May 31, 2024
When using the ZFS storagedriver in docker, it shells out for the ZFS
commands. The path configuration for the systemd task does not include
ZFS, so if the driver is set to ZFS, add ZFS utilities to the PATH.

This will resolve NixOS#10127

[Bjørn: prefix commit message with "nixos/docker:", remove extra space
before ';']

(cherry picked from commit 791b600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants