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

NFS volume not mounted using podman-compose #15939

Closed
Blindfreddy opened this issue Sep 26, 2022 · 2 comments
Closed

NFS volume not mounted using podman-compose #15939

Blindfreddy opened this issue Sep 26, 2022 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@Blindfreddy
Copy link

Blindfreddy commented Sep 26, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Although #4303 claims to have been fixed by #4305, nfs volumes are not mounted, at least not with podman-compose.

Steps to reproduce the issue:

  1. create docker-compose.yaml with following content:
version: '3'
services:
  nginx:
    image: nginxinc/nginx-unprivileged
    container_name: nginxu
    ports:
      - 8888:8080 
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /docker_volumes/config/nginx:/config
      - "nfs-data:/data"
    restart: unless-stopped
volumes:
  nfs-data:
    driver: local
    driver_opts:
      type: nfs
      o: nfsvers=4,addr=<my obfuscated IP>,rw
      device: ":/mnt/seagate4tb/testnfs"

Note: it can be any image, I chose nginx-unprivileged, arbitrarily; the important lines are in the section nfs-data.

  1. execute podman-compose up -d
podman-compose up -d
['podman', '--version', '']
using podman version: 4.2.0
** excluding:  set()
podman volume inspect root_nfs-data || podman volume create root_nfs-data
['podman', 'volume', 'inspect', 'root_nfs-data']
Error: inspecting object: no such volume root_nfs-data
['podman', 'volume', 'create', '--label', 'io.podman.compose.project=root', '--label', 'com.docker.compose.project=root', 'root_nfs-data']
['podman', 'volume', 'inspect', 'root_nfs-data']
['podman', 'network', 'exists', 'root_default']
podman run --name=nginxu -d --label io.podman.compose.config-hash=123 --label io.podman.compose.project=root --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=root --label com.docker.compose.project.working_dir=/root --label com.docker.compose.project.config_files=docker-compose.yaml --label com.docker.compose.container-number=1 --label com.docker.compose.service=nginx -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -v /docker_volumes/config/nginx:/config -v root_nfs-data:/data --net root_default --network-alias nginx -p 8888:8080 --restart unless-stopped nginxinc/nginx-unprivileged
e836a4f2c88aa4a0da5933a05109e6fd3999086943156421ad769526bd152267
exit code: 0

Note the line with error message: Error: inspecting object: no such volume root_nfs-data

  1. Execute mount | grep nfs to verify that nfs was mounted - or rather, that is was NOT mounted:
mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

Note that missing nfs mount.

Describe the results you received:
Volume root_nfs-data was created but the specified nfs volume was not mounted.
To verify that the nfs mount itself works outside of podman, I ran the following:

mount -t nfs <my hostname>:/mnt/seagate4tb/testnfs testnfs
ls testnfs
foo  foo1  foobar  foobaz

Also checked podman inspect root_nfs-data:

podman  inspect root_nfs-data
[
     {
          "Name": "root_nfs-data",
          "Driver": "local",
          "Mountpoint": "/var/lib/containers/storage/volumes/root_nfs-data/_data",
          "CreatedAt": "2022-09-26T10:35:47.245872463-04:00",
          "Labels": {
               "com.docker.compose.project": "root",
               "io.podman.compose.project": "root"
          },
          "Scope": "local",
          "Options": {},
          "UID": 101,
          "GID": 101,
          "MountCount": 0,
          "NeedsCopyUp": true
     }
]

Note that the nfs mount options from the docker-compose.yaml file are missing.

Describe the results you expected:

Same commands using docker-compose and docker inspect show how it should be:

docker inspect andrev_nfs-data
[
    {
        "CreatedAt": "2022-09-19T18:27:58+01:00",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "andrev",
            "com.docker.compose.volume": "nfs-data"
        },
        "Mountpoint": "/var/lib/docker/volumes/andrev_nfs-data/_data",
        "Name": "andrev_nfs-data",
        "Options": {
            "device": ":/mnt/seagate4tb/testnfs",
            "o": "nfsvers=4,addr=<my obfuscated ip>,rw",
            "type": "nfs"
        },
        "Scope": "local"
    }
]

and to prove that the nfs mount occurred:

$ mount | grep nfs
:/mnt/seagate4tb/testnfs on /var/lib/docker/volumes/andrev_nfs-data/_data type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.178.215,local_lock=none,addr=192.168.178.220)
$ docker exec -it nginxu /bin/bash
nginx@6bb2044a7412:/$ ls /data
foo  foo1  foobar  foobaz
nginx@6bb2044a7412:/$ 

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Refer above: 4.2.0

Output of podman info:

podman info
host:
  arch: arm64
  buildahVersion: 1.27.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.4-2.fc36.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.4, commit: '
  cpuUtilization:
    idlePercent: 98.35
    systemPercent: 1.01
    userPercent: 0.63
  cpus: 4
  distribution:
    distribution: fedora
    variant: server
    version: "36"
  eventLogger: journald
  hostname: rpi8.fritz.box
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.19.10-200.fc36.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 6598569984
  memTotal: 8206974976
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.6-2.fc36.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.6
      commit: 18cf2efbb8feb2b2f20e316520e0fd0b6c41ef4d
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 8206151680
  swapTotal: 8206151680
  uptime: 5h 14m 18.00s (Approximately 0.21 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 1
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 22340960256
  graphRootUsed: 4157538304
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 1
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.2.0
  Built: 1660228991
  BuiltTime: Thu Aug 11 10:43:11 2022
  GitCommit: ""
  GoVersion: go1.18.4
  Os: linux
  OsArch: linux/arm64
  Version: 4.2.0

Package info (e.g. output of rpm -q podman or apt list podman):

dnf list | grep podman
cockpit-podman.noarch                                                                    53-1.fc36                                                        @updates             
podman.aarch64                                                                           4:4.2.0-2.fc36                                                   @updates             
podman-compose.noarch                                                                    1.0.3-6.fc36                                                     @updates             
podman-gvproxy.aarch64                                                                   4:4.2.0-2.fc36                                                   @updates             
podman-plugins.aarch64                                                                   4:4.2.0-2.fc36                                                   @updates             
ansible-collection-containers-podman.noarch                                              1.9.4-1.fc36                                                     updates              
pcp-pmda-podman.aarch64                                                                  5.3.7-4.fc36                                                     updates              
podman-docker.noarch                                                                     4:4.2.0-2.fc36                                                   updates              
podman-remote.aarch64                                                                    4:4.2.0-2.fc36                                                   updates              
podman-tests.aarch64                                                                     4:4.2.0-2.fc36                                                   updates              
podman-tui.aarch64                                                                       0.5.0-2.fc36                                                     updates              
python3-molecule-podman.noarch                                                           1.0.1-2.fc36                                                     fedora               
python3-podman.noarch                                                                    3:4.2.0-6.fc36                                                   updates              
python3-podman-api.noarch                                                                0.0.0-0.12.20200614gitd4b8263.fc36                               fedora      ```

**Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)**


Yes

**Additional environment details (AWS, VirtualBox, physical, etc.):**
`
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 26, 2022
@mheon
Copy link
Member

mheon commented Sep 26, 2022

This seems like a podman-compose bug, as Podman is not getting any volume options passed to it. As this is not the podman-compose repo, I'm going to close this. Please reopen against the podman-compose Github,

@mheon mheon closed this as completed Sep 26, 2022
@Blindfreddy
Copy link
Author

Recreated as containers/podman-compose#561 in podman-compose.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

2 participants