Backports.ssl-match-hostname - Ubuntu

What am I missing here? All relevant packages (appear to be) installed. Cannot even get mopidy --version to run without this error. Defaults in the ~/.config/mopidy/mopidy.conf file. Disabled httpd and got same.

Ubuntu 14.xx 32 bit on a craptastic dual core.

[12:41 wes@MediaCenter ~] > mopidy
Traceback (most recent call last):
  File "/usr/bin/mopidy", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: backports.ssl-match-hostname

How did you install Mopidy?

Can you run mopidy deps?

Both installation from pip and from apt-get should install backports.ssl-match-hostname by default. It’s one of Tornado’s dependencies, thus a transitive dependency of Mopidy.

Went right down the page here using ap-get:

http://docs.mopidy.com/en/latest/installation/debian/

I cannot run any switches for mopidy at all, deps, --help, --version, --letsforceanerror

All lead right back to the exact same message.

The error context seems to point to a missing or incorrect version of some dependency, but nothing was prompted in the install and the ubuntu-dev-tools and python-testtools are installed.

Just ran this. Seems like pip at least gets that installed or at least gets mopidy able to find it. Going to tackle the certifi next I guess.

[13:27 wes@MediaCenter ~] > sudo pip install backports.ssl-match-hostname
Downloading/unpacking backports.ssl-match-hostname
Downloading backports.ssl_match_hostname-3.4.0.2.tar.gz
Running setup.py (path:/tmp/pip_build_root/backports.ssl-match-hostname/setup.py) egg_info for package backports.ssl-match-hostname

Installing collected packages: backports.ssl-match-hostname
Running setup.py install for backports.ssl-match-hostname

Successfully installed backports.ssl-match-hostname
Cleaning up…
[13:27 wes@MediaCenter ~] > mopidy
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 5, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2749, in
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 444, in _build_master
ws.require(requires)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 725, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: certifi

[13:27 wes@MediaCenter ~] > sudo pip install certifi
Downloading/unpacking certifi
Downloading certifi-14.05.14.tar.gz (168kB): 168kB downloaded
Running setup.py (path:/tmp/pip_build_root/certifi/setup.py) egg_info for package certifi

Installing collected packages: certifi
Running setup.py install for certifi

Successfully installed certifi
Cleaning up…

and then

[13:30 wes@MediaCenter ~] > mopidy
INFO Starting Mopidy 0.19.4
INFO Loading config from: builtin defaults, /etc/xdg/mopidy/mopidy.conf, /home/wes/.config/mopidy/mopidy.conf, command line options
INFO Enabled extensions: spotify, mpd, softwaremixer, local, stream
INFO Disabled extensions: http
INFO Starting Mopidy mixer: SoftwareMixer
INFO Mixing using GStreamer software mixing
INFO Starting Mopidy audio
INFO Starting Mopidy backends: LocalBackend, StreamBackend, SpotifyBackend
INFO Loaded 0 local playlists from /home/wes/.local/share/mopidy/local/playlists
INFO No local library metadata cache found at /home/wes/.local/share/mopidy/local/library.json.gz. Please run mopidy local scan to index your local music library. If you do not have a local music collection, you can disable the local backend to hide this message.
INFO Loaded 0 local tracks using json
INFO Audio output set to "autoaudiosink"
INFO Mopidy uses SPOTIFY® CORE
INFO Starting Mopidy core
INFO Starting Mopidy frontends: MpdFrontend
INFO MPD server running at [::ffff:127.0.0.1]:6600
ERROR Spotify login error: Needs a premium account
INFO Disconnected from Spotify

Premium account?! womp womp womp…

So bottom line some things are not being picket up by apt-get, but I can go get them with pip and get it running. Hopefully the output here will help anyone else encountering this and get it corrected in the package (assuming the problem is not on my end, but not sure how…)

What does mopidy deps print now?

I’m curious what combination of apt- and pip-installed dependencies you’ve ended up with. Everything should work with just sudo apt-get install mopidy on Ubuntu 14.04.

Looks good now. I see the backports ssl listed. I wish it would have run before for comparison, but oh well.

[13:46 wes@MediaCenter ~] > mopidy deps
Platform: Linux-3.13.0-30-generic-i686-with-Ubuntu-14.04-trusty
Python: CPython 2.7.6 from /usr/lib/python2.7
Mopidy: 0.19.4 from /usr/share/mopidy
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  tornado>=2.3: 4.0.1 from /usr/local/lib/python2.7/dist-packages
    certifi: 14.05.14 from /usr/local/lib/python2.7/dist-packages
    backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/dist-packages
Mopidy-SoundCloud: 1.2.5 from /usr/share/mopidy
  Mopidy>=0.18: 0.19.4 from /usr/share/mopidy
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 4.0.1 from /usr/local/lib/python2.7/dist-packages
      certifi: 14.05.14 from /usr/local/lib/python2.7/dist-packages
      backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  requests>=2.0.0: 2.2.1 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify: 1.2.0 from /usr/share/mopidy
  Mopidy>=0.18: 0.19.4 from /usr/share/mopidy
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 4.0.1 from /usr/local/lib/python2.7/dist-packages
      certifi: 14.05.14 from /usr/local/lib/python2.7/dist-packages
      backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  pyspotify>=1.9,<1.999: 1.11 from /usr/lib/pymodules/python2.7
GStreamer: 0.10.36.0 from /usr/lib/python2.7/dist-packages/gst-0.10/gst
  Detailed information:
    Python wrapper: gst-python 0.10.22.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        flump3dec
        id3demux
        id3v2mux
        lame
        mad
        mp3parse
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        none
[19:39 wes@MediaCenter ~] >

The explanation here can probably be read in the paths the packages are imported from. pip on Ubuntu installs dependencies into /usr/local/lib/python2.7. apt-get install Python libraries into /usr/lib/python2.7 and Python applications into /usr/share/{application}.

To me, it looks like you had Tornado 4.0.1 installed from pip before installing Mopidy, but was missing its dependencies certifi and backports.ssl-match-hostname.

Ubuntu 14.04 comes with Tornado 3.1.1, which does not depend on certifi and backports.ssl-match-hostname. Those where new dependencies in Tornado 4.0. The mopidy package depends on the python-tornado package from Ubuntu.

To confirm that the problem here is your existing uncomplete installation of Tornado, can you try to uninstall your global pip-install of Tornado so that Python will find Tornado from apt instead? /usr/lib/python2.7 is later on your PYTHONPATH than /usr/local/lib/python2.7, so pip shadows apt.

To confirm that you already have Tornado 3.1.1 installed from apt, since it’s one of the mopidy package’s dependencies:

dpkg -l | grep python-tornado

To uninstall your global Tornado install with friends:

sudo pip uninstall tornado certifi backports.ssl-match-hostname

To confirm that Mopidy still works and now use apt-get install-ed Tornado:

mopidy deps

Thanks for reporting this and spending the time to find the root cause :slight_smile:

Thanks! Great summary on the root cause analysis and once Google indexes this page it should help anyone else out there using mopidy on Ubuntu 14.04.