jaedb / Iris

Discover, explore and manage your music library across multiple sources with this beautiful web-based interface. Iris is a Mopidy frontend extension.
Apache License 2.0
1.13k stars 132 forks source link

Getting 'flags0x5000: not a directory' when using docker #944

Open masiv1001 opened 7 months ago

masiv1001 commented 7 months ago

Iris version

:latest :master

Operating system(s) affected

Browser(s) affected

What happened?

I'm getting the following error when trying to deploy the docker container both standalone with docker compose up and withing Portainer. I suspect it has to do with the files being directly linked in the volumes area, but trying to create them manually and add them later (as directories, or as files) only resulted in non-working setups.

Here's my docker-compose file, the other two files (mopidy.conf, snapserver.conf) were created with default config in their respective directories. I changed the branch to master, container names and music directory just in case but nothing worked.

version: "3"
services:
  snapserver:
    container_name: snapppppserver
    image: jaedb/snapserver:master
    depends_on:
      mopidy:
        condition: service_healthy
    ports:
      - 1704
      - 1705
      - 1780
    volumes:
      - /tmp/snapserver:/tmp
      - ./docker/snapserver/snapserver.conf:/etc/snapserver.conf
      - ./docker/snapserver/snapserver.json:/root/.config/snapserver/server.json
  mopidy:
    container_name: irissssssss
    image: jaedb/iris:master
    environment:
      - PIP_PACKAGES=Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient
    ports:
      - 6600
      - 6680
    healthcheck:
      test: curl -f http://localhost:6680/iris/http/get_config || exit 1
      timeout: 5s
      retries: 5
    volumes:
      # - ./mopidy/iris:/iris/mopidy/iris # To use a locally-built UI 
      - ./docker/mopidy/iris:/var/lib/mopidy/iris # Iris-specific storage
      - ./docker/mopidy/m3u:/var/lib/mopidy/m3u # To persist local playlists
      - ./docker/mopidy/mopidy.conf:/config/mopidy.conf
      - ./music:/var/lib/mopidy/media
      - /tmp/snapserver:/tmp

Logs

[redacted]@[redacted]:/mnt/docker/containers/music-server$ sudo docker compose up
[+] Running 2/0
 ✔ Container irissssssss     Created                                                                                                                 0.1s 
 ✔ Container snapppppserver  Created                                                                                                                 0.0s 
Attaching to irissssssss, snapppppserver
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/mnt/docker/containers/music-server/docker/mopidy/mopidy.conf" to rootfs at "/config/mopidy.conf": mount /mnt/docker/containers/music-server/docker/mopidy/mopidy.conf:/config/mopidy.conf (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
masiv1001 commented 7 months ago

I've successfully got it working by first creating both the folders and files and attaching them as folders with the proper file contents (server.json, mopidy.conf & snapserver.conf), the contents of server.json I just copy pasted the ones of snapserver.conf. Note that even this setup might work, it requires extra setup on the end user and potentially introduces a security risk (or at least unnecessary file exposure) by exposing such folder's content. It also prevents the automatic deployment with just the use of docker.