NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
21.76k stars 2.52k forks source link

Support ZFS #676

Open tophee opened 3 years ago

tophee commented 3 years ago

I'm not sure if this should rather be classified as a bug but since zfs is not explicitly supported, I'm putting it as a feature request:

Currently, the container will not work if you map /config onto a zfs volume. The logs will look like this:

[s6-finish] sending all processes the TERM signal.,
[s6-finish] sending all processes the KILL signal and exiting.,
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 00-app-niceness.sh: executing... ,
[cont-init.d] 00-app-niceness.sh: exited 0.,
[cont-init.d] 00-app-script.sh: executing... ,
[cont-init.d] 00-app-script.sh: exited 0.,
[cont-init.d] 00-app-user-map.sh: executing... ,
[cont-init.d] 00-app-user-map.sh: exited 0.,
[cont-init.d] 00-clean-logmonitor-states.sh: executing... ,
[cont-init.d] 00-clean-logmonitor-states.sh: exited 0.,
[cont-init.d] 00-clean-tmp-dir.sh: executing... ,
[cont-init.d] 00-clean-tmp-dir.sh: exited 0.,
[cont-init.d] 00-set-app-deps.sh: executing... ,
[cont-init.d] 00-set-app-deps.sh: exited 0.,
[cont-init.d] 00-set-home.sh: executing... ,
[cont-init.d] 00-set-home.sh: exited 0.,
[cont-init.d] 00-take-config-ownership.sh: executing... ,
[cont-init.d] 00-take-config-ownership.sh: exited 0.,
[cont-init.d] 00-xdg-runtime-dir.sh: executing... ,
[cont-init.d] 00-xdg-runtime-dir.sh: exited 0.,
[cont-init.d] nginx-proxy-manager.sh: executing... ,
[cont-init.d] nginx-proxy-manager.sh: Initializing database data directory...,
[cont-init.d] nginx-proxy-manager.sh: exited 1.,
[services.d] stopping services,
[services.d] stopping s6-fdholderd...,
[cont-finish.d] executing container finish scripts...,
[cont-finish.d] done.,
[s6-finish] syncing disks.,
[s6-finish] sending all processes the TERM signal.,
[s6-finish] sending all processes the KILL signal and exiting.,
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 00-app-niceness.sh: executing... ,
[cont-init.d] 00-app-niceness.sh: exited 0.,
[cont-init.d] 00-app-script.sh: executing... ,
[cont-init.d] 00-app-script.sh: exited 0.,
[cont-init.d] 00-app-user-map.sh: executing... ,
[cont-init.d] 00-app-user-map.sh: exited 0.,
[cont-init.d] 00-clean-logmonitor-states.sh: executing... ,
[cont-init.d] 00-clean-logmonitor-states.sh: exited 0.,
[cont-init.d] 00-clean-tmp-dir.sh: executing... ,
[cont-init.d] 00-clean-tmp-dir.sh: exited 0.,
[cont-init.d] 00-set-app-deps.sh: executing... ,
[cont-init.d] 00-set-app-deps.sh: exited 0.,
[cont-init.d] 00-set-home.sh: executing... ,
[cont-init.d] 00-set-home.sh: exited 0.,
[cont-init.d] 00-take-config-ownership.sh: executing... ,
[cont-init.d] 00-take-config-ownership.sh: exited 0.,
[cont-init.d] 00-xdg-runtime-dir.sh: executing... ,
[cont-init.d] 00-xdg-runtime-dir.sh: exited 0.,
[cont-init.d] nginx-proxy-manager.sh: executing... ,
[cont-init.d] nginx-proxy-manager.sh: Initializing database data directory...,
[cont-init.d] nginx-proxy-manager.sh: exited 1.,
[services.d] stopping services,
[services.d] stopping s6-fdholderd...,
[cont-finish.d] executing container finish scripts...,
[cont-finish.d] done.,
[s6-finish] syncing disks.,
[s6-finish] sending all processes the TERM signal.,

It took me a felt eternity to figure out that the reason why this wasn't working was that I was using the "wrong" filesystem. zfs doesn't work because apparently it doesn't support fallocate (which NPM seems to use).

So if it is possible to avoid fallocate, that would make NPM compatible with zfs. I can see, though, that this is probably not a priority for you so I'd like to suggest to warn users about this (either in the instructions) or, ideally, by detecting that fallocate is not working and issuing and error about this (and possibly stopping the container).

Wadera commented 3 years ago

Are you sure that you configured docker correctly? Mine works as expected.

Check this:

root@myhost:~# docker info | grep zfs
 Storage Driver: zfs

https://docs.docker.com/storage/storagedriver/zfs-driver/

tophee commented 3 years ago

Maybe there is a missunderstanding: by "zfs volume", I didn't mean a docker volume (strictly speaking) but a binding to a zfs directory on the host). Like this:

image

If I missunderstood, could you explain some more? docker info | grep zfs returns nothing. So does docker info | grep storage

Wadera commented 3 years ago

If it doesn't show nothing - that's mean you didn't have configured ZFS storage driver. It's not NPM issue, but docker configuration. More about Docker ZFS support here: https://docs.docker.com/storage/storagedriver/zfs-driver/

tophee commented 3 years ago

If it doesn't show nothing - that's mean you didn't have configured ZFS storage driver.

I'm not sure why I would need the ZFS storage driver. I'm running about 15 docker containers, all of which use the zfs storage without any issues.

You never said anything about this:

zfs doesn't work because apparently it doesn't support fallocate (which NPM seems to use).

So if it is possible to avoid fallocate, that would make NPM compatible with zfs.

Is it not possible to avoid fallocate?

chaptergy commented 3 years ago

At least the sqlite3 npm package seems to use fallocate, which is a database option via knex. If anyone wants to try and prevent usage of this when sqlite is not used to see if it helps, PRs are welcome.

github-actions[bot] commented 5 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: