@knex666 The problem is that iris expects sudo to exist, but sudo is missing from the docker (understandable, user in the docker is root):
INFO SELF.PATH: /usr/local/lib/python2.7/dist-packages/mopidy_iris
INFO Running system action: local_scan file: /usr/local/lib/python2.7/dist-packages/mopidy_iris/system.py
INFO SELFPATH: /usr/local/lib/python2.7/dist-packages/mopidy_iris
ERROR global name 'path' is not defined
/bin/sh: 1: sudo: not found <--------------------
Exception in thread Thread-14:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/mopidy_iris/system.py", line 40, in run
output = subprocess.check_output(["sudo " + filepath + "/system.sh " + self.action], shell=True)
File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '[u'sudo /usr/local/lib/python2.7/dist-packages/mopidy_iris/system.sh local_scan']' returned non-zero exit status 127
The 'ERROR global name 'path' is not defined' log is coming out of '/usr/local/lib/python2.7/dist-packages/mopidy_iris/system.py' but it's not fatal.
The command does launch after I manually remove 'sudo' from the command in '/usr/local/lib/python2.7/dist-packages/mopidy_iris/system.py':
# diff system.py.ORIG system.py
36c36
< output = subprocess.check_output(["sudo "+self.path+"/system.sh "+self.action], shell=True)
---
> output = subprocess.check_output([self.path+"/system.sh "+self.action], shell=True)
However when it does launch the wrong mopidy.conf it being read (note that my library *is* populated, configured via /etc/mopidy.conf):
INFO Running system action: local_scan
ERROR global name 'path' is not defined
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf local scan" as user mopidy
/usr/lib/python2.7/dist-packages/mopidy/ext.py:202: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
extension_class = entry_point.load(require=False)
INFO Starting Mopidy 2.2.1
INFO Loading config from builtin defaults
INFO Loading config from /etc/mopidy/mopidy.conf
INFO Loading config from command line options
ERROR Loading logging config '/etc/mopidy/logging.conf' failed. [Errno 13] Permission denied: '/var/log/mopidy/mopidy.log'
INFO Enabled extensions: mopify, local-sqlite, mpd, http, stream, spotify_tunigo, m3u, youtube, simple-webclient, local-images, softwaremixer, file, musicbox_webclient, party, api_explorer, iris, local, tunein
INFO Disabled extensions: spotify, scrobbler, soundcloud
WARNING Found scrobbler configuration errors, the extension has been automatically disabled:
WARNING scrobbler/username must be set.
WARNING scrobbler/password must be set.
WARNING Found soundcloud configuration errors, the extension has been automatically disabled:
WARNING soundcloud/auth_token must be set.
WARNING Found spotify configuration errors, the extension has been automatically disabled:
WARNING spotify/username must be set.
WARNING spotify/client_secret must be set.
WARNING spotify/password must be set.
WARNING spotify/client_id must be set.
WARNING Please fix the extension configuration errors or disable the extensions to silence these messages.
INFO Found 0 files in media_dir. <--------------------
INFO Checking 0 tracks from library.
INFO Removing 0 missing tracks.
INFO Found 0 tracks which need to be updated.
INFO Scanning...
INFO Scanned 0 of 0 files in 0s.
INFO Done scanning.
iris is using 'mopidyctl' to launch the commands, and from the logs mopidyctl is using '/etc/mopidy/mopidy.conf'. This also happens to be the config file recommended when running mpd as a service (https://docs.mopidy.com/en/latest/service/).
I also hit a similar 'wrong config' issue running 'mopidy local scan' in the docker, which is most likely what @Lammy hit:
root@d46c51e4da38:/# mopidy local scan
/usr/local/lib/python2.7/dist-packages/mopidy/ext.py:202: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
extension_class = entry_point.load(require=False)
INFO Starting Mopidy 2.2.2
INFO Loading config from builtin defaults
INFO Loading config from /root/.config/mopidy/mopidy.conf <--------------------
INFO Loading config from command line options
INFO Enabled extensions: mopify, iris, mpd, http, stream, spotify_tunigo, m3u, youtube, simple-webclient, tunein, local-images, softwaremixer, file, musicbox_webclient, party, api_explorer, local-sqlite
INFO Disabled extensions: spotify, local, scrobbler, soundcloud
WARNING Found local configuration errors, the extension has been automatically disabled:
WARNING local/media_dir must be set.
WARNING Found scrobbler configuration errors, the extension has been automatically disabled:
WARNING scrobbler/username must be set.
WARNING scrobbler/password must be set.
WARNING Found soundcloud configuration errors, the extension has been automatically disabled:
WARNING soundcloud/auth_token must be set.
WARNING Found spotify configuration errors, the extension has been automatically disabled:
WARNING spotify/username must be set.
WARNING spotify/client_secret must be set.
WARNING spotify/password must be set.
WARNING spotify/client_id must be set.
WARNING Please fix the extension configuration errors or disable the extensions to silence these messages.
ERROR Unable to run command provided by disabled extension local
To successfully launch a scan I had to specific the --config option:
root@d46c51e4da38:/# mopidy --config /etc/mopidy.conf local scan
/usr/local/lib/python2.7/dist-packages/mopidy/ext.py:202: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
extension_class = entry_point.load(require=False)
INFO Starting Mopidy 2.2.2
INFO Loading config from builtin defaults
INFO Loading config from /etc/mopidy.conf
INFO Loading config from command line options
INFO Enabled extensions: mopify, iris, mpd, http, stream, m3u, simple-webclient, tunein, local-images, softwaremixer, file, musicbox_webclient, party, api_explorer, local, local-sqlite
INFO Disabled extensions: spotify, youtube, scrobbler, soundcloud, spotify_tunigo
<Successful scan>
So the root cause of all this is that mopidy.conf is mapped to /etc/mopidy.conf, which is (no longer?) the expected location when mopidy is running as a user process or as a daemon.
I had the following questions:
- Would it be possible to include the 'sudo' command in the docker, even though the user inside the docker is root?
- Was there a specific need to map the config to '/etc/mopidy.conf'? Could the docker be reworked to map it to a different location? If you map to '/etc/mopidy/mopidy.conf', you could explain in the readme that mopidyctl must be used to scan the library.
Thanks for all the work on this.