alpine-qbittorrent-openvpn icon indicating copy to clipboard operation
alpine-qbittorrent-openvpn copied to clipboard

Attempting to start the container for the first time fails when downloading and configuring OpenVPN configuration and download directory on an NFS mount.

Open ndizazzo opened this issue 3 years ago • 0 comments

Information

When attempting to start the container for the first time, it fails when configuring OpenVPN (02-setup-openvpn) and download directory on an NFS mount.

cp: can't preserve ownership of '/config/openvpn/config.ovpn': Operation not permitted
chown: /config/openvpn/config.ovpn: Operation not permitted
[cont-init.d] 02-setup-openvpn: exited 1.

Permalink to the offending source lines: https://github.com/guillaumedsde/alpine-qbittorrent-openvpn/blob/229684b7c328c3c03bb661954a68e3cb2c0f2d35/rootfs/etc/cont-init.d/02-setup-openvpn#L73-L76

Current setup

docker image tag (ex: python, latest, 32242d1 ...) latest
docker image hash (ex: 603b78e07727) 28b3f5d6c9ce

NFS mounts:

host path container path NFS FS owner NFS FS group
/nfs/downloads /downloads 1000 100
/nfs/applications/qbittorrent-openvpn /config 1000 100

ls -la output in /nfs/applications/qbittorrent-openvpn after first run of the container:

drwx------  2 1000 100 4096 Apr  4 21:13 openvpn
drwx------  2 1000 100 4096 Apr  4 19:24 qBittorrent
drwxrwxr-x  4 1000 100 4096 Apr  4 19:24 .
drwxrwxr-x 12 1000 100 4096 Apr  4 19:15 ..

docker-compose.yml file or docker run command

version: "3.3"
services:
  alpine-qbittorrent-openvpn:
    volumes:
      - "/nfs/downloads:/downloads"
      - "/nfs/applications/qbittorrent-openvpn:/config"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - OPENVPN_PROVIDER=NORDVPN
      - NORDVPN_COUNTRY=CA
      - OPENVPN_USERNAME=imnotposting
      - OPENVPN_PASSWORD=myuserandpasshere
      - PUID=1000
      - PGID=100
      - LAN=192.168.0.0/16
    ports:
      - "8009:8080"
    cap_add:
      - NET_ADMIN
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest

Attempted Fix(es)

  • I tried swapping the PGID and PUID to see if those were reversed
  • I did chmod ugo+rwx on /nfs/applications/qbittorrent-openvpn to give it more permissions during intialization. Those permissions end up getting overwritten by these lines and so it doesn't matter

Workarounds

  • Putting the qbittorrent-openvpn directory outside of a NFS mount works.

ndizazzo avatar Apr 05 '21 01:04 ndizazzo