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 Compose Failed start up #886

Closed
zanish opened this issue Feb 3, 2023 · 14 comments
Closed

Docker Compose Failed start up #886

zanish opened this issue Feb 3, 2023 · 14 comments

Comments

@zanish
Copy link

zanish commented Feb 3, 2023

Using Docker on a Debian LXC container.

I cannot get Iris to start up using the docker compose in the getting started due to multiple errors.

  1. meta_mopidy is nowhere to be found in the repo. As a new user to snapserver I don't ever really know where I should find this.
  2. start up breaks due to no server.json anywhere.
  3. Location of mopidy.conf is incorrect in the "getting started"

I'm trying to use docker since as I understand the Pip install still has the broken version of the spotify lib? The pip version installed easily but Docker seems to be impossible to spin up using the getting started section.

@shad-lp
Copy link

shad-lp commented Feb 8, 2023

For the meta_mopidy.py file, you can get it there : https://github.com/badaix/snapcast/blob/master/server/etc/plug-ins/meta_mpd.py

I don't need any server.json file to spin up my containers.

The mopidy.conf file is mounted where you write it to be mounted :
image

@jaedb
Copy link
Owner

jaedb commented Feb 11, 2023

This has been pending a new release of Snapcast, which happened just a few days ago. I have updated the Snapcast docker image so this will use this new version, which contains meta_mpd.py baked-in.

You will need to read the documentation of Snapcast to explore all the options, but when defining your snapcast output in your Snapserver config (eg /etc/snapserver.conf) you can pass additional parameters to the control script definition to specify where your Mopidy server is running.

Last I checked it worked something like this (but you will need to confirm the exact syntax yourself):

stream = pipe:///tmp/snapfifo?name=Default&sampleformat=48000:16:2&controlscript=meta_mopidy.py&controlscriptparams=mopidy-host:my_hostname

Iris' out-of-box docker-compose.yml works without needing to tinker with these settings (you just need to rename the -sample files included in this repository).

@zanish
Copy link
Author

zanish commented Feb 11, 2023

Good Afternoon, I see you are running under docker exec and I am running docker compose. This is a freshly pulled repo and I get the following output.
image

So OOTB it's not running on docker compose as of today without tinkering. I don't know if this is due to newer releases of docker compose that are conflicting with your set up but this is fresh as of today.

EDIT: I should state I have downloaded the Python file sent in the first comment and so that error is not present but I can show fresh install without the python script and it will show more errors like this.

@jaedb
Copy link
Owner

jaedb commented Feb 11, 2023

When I say out-of-the-box, you still need to configure some elements of the docker stack. Have you tried creating an empty snapserver.json (or omited it from your docker-compose.yml bindings)?

@shad-lp
Copy link

shad-lp commented Feb 11, 2023

@jaedb the syntax has changed a bit for the controlscriptparams, see here : https://github.com/badaix/snapcast/blob/develop/doc/configuration.md#sources

e.g.
source = pipe:///tmp/snapfifo?name=Default&sampleformat=48000:16:2&controlscript=meta_mopidy.py&controlscriptparams=--mopidy-host=my_hostname%20--mopidy-port=16680

You could close #883 too btw.

@remus-selea
Copy link

remus-selea commented Mar 31, 2023

I have an issue with mopidy web interface not being accessible. I am running docker on a Debian LXC on proxmox. I should be able to access the web interface at an ip like 192.168.10.12.

I followed the installation instructions at https://github.com/jaedb/Iris/wiki/Getting-started#installing, installed it with pip directly in the LXC. Even with this installation method I was not able to access the web interface.
I managed to get it working after some time by modifying the /etc/mopidy/mopidy.conf file where I have added

[http]
enabled = true
hostname = 192.168.10.12

I was then able to see the interface at http://192.168.10.12:6680/iris/

However I would like to get it running using docker. But I cannot get it to work with the compose example file and the ./docker/mopidy/mopidy.conf file. The web UI just doesn't become accessible at all.

Here's my compose file:

version: "3"
services:
  snapserver:
    image: jaedb/snapserver:latest
    ports:
      - 1704:1704
      - 1705:1705
      - 1780:1780
    volumes:
      - /tmp/snapserver:/tmp
      - "./docker/snapserver/snapserver.conf:/etc/snapserver.conf"
      - "./docker/snapserver/snapserver.json:/root/.config/snapserver/server.json"

  mopidy:
    image: jaedb/iris:latest
    environment:
      - PIP_PACKAGES=Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient
    build:
      context: .
    depends_on:
      - snapserver
    ports:
      - 6600:6600
      - 6680:6680
    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
      # - ./docker/mopidy/mopidy.conf:/etc/mopidy/mopidy.conf didn't work either
      - /mnt/host-data/data/audio/music:/var/lib/mopidy/media
      - /tmp/snapserver:/tmp

And the ./docker/mopidy/mopidy.conf file:

[core]
data_dir = /var/lib/mopidy

[audio]
#output = tee name=t ! queue ! autoaudiosink t. ! queue ! udpsink host=0.0.0.0 port=5555
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

[http]
enabled = true
hostname = 192.168.10.12
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins = 
csrf_protection = true
default_app = iris

[mpd]
hostname = 192.168.10.12

[spotify]
# Fast startup because we use the Spotify HTTP API to load these instead
# Makes playlists unavailable under Browse > Spotify.
allow_playlists = false

Afterwards I will also need to get it running with Nginx Proxy Manager. But I'm already thinking of trying out alternatives for a music player with a web client for my server after such a headache trying to get this to work.

@jaedb
Copy link
Owner

jaedb commented Apr 1, 2023

@remus-selea I think your issue is a misconfiguration of the hostname settings in your mopidy.conf.

Instead of being the IP address of the server, it is used to restrict access to the webui to specific clients.

In your case I would expect this to be 0.0.0.0

Check out the docs

@remus-selea
Copy link

remus-selea commented Apr 1, 2023

@remus-selea I think your issue is a misconfiguration of the hostname settings in your mopidy.conf.

Instead of being the IP address of the server, it is used to restrict access to the webui to specific clients.

In your case I would expect this to be 0.0.0.0

Check out the docs

I have tried that as well, it was in the default configuration files. I was also confusing running as a service and running from the terminal and thought the config file wasn't applying properly.

I switched back to 0.0.0.0, and after some experimentation I found what i believe to be the real culprit causing it not to work. It's because of the Tidal extension. I noticed that the UI started up after like 5 minutes or so after that times out. Removing it from the compose makes it start instantly.

@remus-selea
Copy link

remus-selea commented Apr 1, 2023

@jaedb When running Iris for the first time with the provided compose file, I encountered some difficulties that I think could be improved.

Firstly, the compose file should create the necessary configuration files in the specified volumes with the content of the example files. This would make it easier for users to get started and edit the files as needed. In my case, I had to figure out why only directories were created instead of the expected files (the directories even had the names of the required configuration files).

Secondly, the documentation could do without mentioning to the user to clone the whole project to be able to run it. This part should be omitted, and maybe mentioned when talking about contribution for developers. This would make it easier for users who just want to use the player and not contribute to its development.

Finally, I had trouble finding an example snapserver.json file, which caused errors when running the compose file. It would be helpful to include an example file or provide a link to it in the documentation.

ris-snapserver-1              | 2023-03-31 21-34-44.475 [Notice] (init) Settings file: "/root/.config/snapserver/server.json"
iris-snapserver-1              | 2023-03-31 21-34-44.476 [Error] (Snapserver) Exception: failed to open file "/root/.config/snapserver/server.json", error 21
iris-snapserver-1              | 2023-03-31 21-34-44.476 [Notice] (Snapserver) Snapserver terminated.

Overall, I think these improvements would make it easier for users to get started with Mopidy-Iris and avoid some of the confusion I experienced. Thanks for your attention and happy listening!

@remus-selea
Copy link

I just noticed that in the Iris settings, there is an upgrade available from version 3.65 to 3.66. However, when I tried to update by running "docker-compose pull" with both "jaedb/iris:latest" and "jaedb/iris:3.66" images, the upgrade did not reflect in the settings and still showed version 3.65. I'm not sure if this is a bug or if there's another step I'm missing.

@shad-lp
Copy link

shad-lp commented Apr 3, 2023

I just noticed that in the Iris settings, there is an upgrade available from version 3.65 to 3.66. However, when I tried to update by running "docker-compose pull" with both "jaedb/iris:latest" and "jaedb/iris:3.66" images, the upgrade did not reflect in the settings and still showed version 3.65. I'm not sure if this is a bug or if there's another step I'm missing.

I opened a post on the mopidy discourse a few weeks, no answer yet : https://discourse.mopidy.com/t/docker-iris-version-different-on-tag-and-inside-container/5702

@casenjo
Copy link

casenjo commented Apr 10, 2023

@remus-selea I think your issue is a misconfiguration of the hostname settings in your mopidy.conf.
Instead of being the IP address of the server, it is used to restrict access to the webui to specific clients.
In your case I would expect this to be 0.0.0.0
Check out the docs

I have tried that as well, it was in the default configuration files. I was also confusing running as a service and running from the terminal and thought the config file wasn't applying properly.

I switched back to 0.0.0.0, and after some experimentation I found what i believe to be the real culprit causing it not to work. It's because of the Tidal extension. I noticed that the UI started up after like 5 minutes or so after that times out. Removing it from the compose makes it start instantly.

Oh man I was wondering about this. I ran into the same issue as you and now that I disabled the Tidal extension it totally worked. Thanks!

@ser
Copy link

ser commented May 30, 2023

I also removed tidal and Iris docker started to work.

@jaedb
Copy link
Owner

jaedb commented Oct 24, 2023

@remus-selea and @shad-lp the version-mismatch issue is covered in #921

Regarding the origional issue of this issue, it seems to be due to the Mopidy-Tidal extension awaiting authentication which blocks startup until user interacts.

@jaedb jaedb closed this as completed Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants