mopidy / mopidy

Mopidy is an extensible music server written in Python
https://mopidy.com
Apache License 2.0
8.06k stars 686 forks source link

zerconf randomly stops working #1543

Open bjornfor opened 8 years ago

bjornfor commented 8 years ago

I've been running mopidy version 2.0.0 on NixOS for a few days and experience these errors that I believe is the reason for zeroconf to stop working[1]:

mopidy[1216]: ERROR    Unable to set arguments (-1, -1, dbus.UInt32(0L), None, u'_mpd._tcp', u'', u'', dbus.UInt16(6600), dbus.Array([], signature=dbus.Signature('ay'))) according to signature u'iiussssqaay': <type 'exceptions.TypeError'>: Expected a string or unicode object
mopidy[1216]: ERROR    Unhandled exception in MpdFrontend (urn:uuid:55b4d474-fc74-4543-81ba-da45235cf93b):
mopidy[1216]: Traceback (most recent call last):
mopidy[1216]:   File "/nix/store/pvdqvlxj644v3znzbciv529swbm9bppa-python2.7-pykka-1.2.0/lib/python2.7/site-packages/pykka/actor.py", line 191, in _actor_loop
mopidy[1216]:     self.on_start()
mopidy[1216]:   File "/nix/store/6qiif5s1hihmis8ghvhsdahsrbz1i1w2-mopidy-2.0.0/lib/python2.7/site-packages/mopidy/mpd/actor.py", line 71, in on_start
mopidy[1216]:     self.zeroconf_service.publish()
mopidy[1216]:   File "/nix/store/6qiif5s1hihmis8ghvhsdahsrbz1i1w2-mopidy-2.0.0/lib/python2.7/site-packages/mopidy/zeroconf.py", line 116, in publish
mopidy[1216]:     _convert_text_list_to_dbus_format(self.text))
mopidy[1216]:   File "/nix/store/0rj8raqc4nbzbswgsbi1na9z6qpfjaxl-dbus-python-1.2.4/lib/python2.7/site-packages/dbus/proxies.py", line 70, in __call__
mopidy[1216]:     return self._proxy_method(*args, **keywords)
mopidy[1216]:   File "/nix/store/0rj8raqc4nbzbswgsbi1na9z6qpfjaxl-dbus-python-1.2.4/lib/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
mopidy[1216]:     **keywords)
mopidy[1216]:   File "/nix/store/0rj8raqc4nbzbswgsbi1na9z6qpfjaxl-dbus-python-1.2.4/lib/python2.7/site-packages/dbus/connection.py", line 641, in call_blocking
mopidy[1216]:     message.append(signature=signature, *args)
mopidy[1216]: TypeError: Expected a string or unicode object
mopidy[1216]: INFO     New MPD connection from [::ffff:127.0.0.1]:59412

The MPD part of mopidy still works though. I haven't figured out what triggers this issue, it seemingly happens "at random".

[1]: avahi-browse -at | grep mopidy no longer yields a result, "Mopidy Mobile" Android app doesn't find any servers.

UPDATE: Fixed a clipped line from the log.

bjornfor commented 8 years ago

Related to https://github.com/mopidy/mopidy/issues/1424.

sorvakko commented 8 years ago

After running some updates (on Ubuntu 14.04 LTS with Mopidy installed from the Mopidy apt repository) I hit the same issue. For me, the HTTP frontend times out completely. The MPD interface stays usable.

I'd be glad to assist in gathering debugging info or trying out solutions.

kingosticks commented 8 years ago

@sorvakko do you see the same traceback? Are you saying the http frontend doesn't work even in a browser or just the Mopidy-mobile app doesn't work? Also please provide mopidy deps output.

sorvakko commented 8 years ago

The HTTP frontend doesn't work at all, even in a browser. The connection just times out (even though netstat or ss -lp |grep mopidy shows the mopidy process as listening. Seems very much like the same traceback:

2016-11-13 13:19:19,202 ERROR [27382:HttpFrontend-15] dbus.connection: Unable to set arguments (-1, -1, dbus.UInt32(0L), None, u'_mopidy-http._tcp', u'', u'', dbus.UInt16(6680), dbus.Array([], signature=dbus.Signature('ay'))) according to signature u'iiussssqaay': <type 'exceptions.TypeError'>: Expected a string or unicode object

2016-11-13 13:19:19,202 ERROR [27382:HttpFrontend-15] pykka: Unhandled exception in HttpFrontend (urn:uuid:425e768d-7786-4a77-ab46-fd9f6386a299):
Traceback (most recent call last):  
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 192, in _actor_loop  
    self.on_start()
  File "/usr/lib/python2.7/dist-packages/mopidy/http/actor.py", line 68, in on_start
    self.zeroconf_mopidy_http.publish()  
  File "/usr/lib/python2.7/dist-packages/mopidy/zeroconf.py", line 116, in publish  
    _convert_text_list_to_dbus_format(self.text))
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__ 
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 641, in call_blocking
    message.append(signature=signature, *args)  
TypeError: Expected a string or unicode object

mopidy deps:

Executable: /usr/bin/mopidy  
Platform: Linux-4.4.0-47-generic-x86_64-with-Ubuntu-14.04-trusty
Python: CPython 2.7.6 from /usr/lib/python2.7
Mopidy: 2.0.1 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
  tornado>=2.3: 4.4.2 from /usr/local/lib/python2.7/dist-packages
    backports.ssl_match_hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
    singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
      six: 1.10.0 from /usr/local/lib/python2.7/dist-packages
    certifi: 2016.9.26 from /usr/local/lib/python2.7/dist-packages
    backports_abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
Mopidy-Moped: 0.7.0 from /usr/local/lib/python2.7/dist-packages
  setuptools: 28.8.0 from /usr/local/lib/python2.7/dist-packages
  Mopidy>=1.0.0: 2.0.1 from /usr/lib/python2.7/dist-packages  
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
    tornado>=2.3: 4.4.2 from /usr/local/lib/python2.7/dist-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
      singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
        six: 1.10.0 from /usr/local/lib/python2.7/dist-packages  
      certifi: 2016.9.26 from /usr/local/lib/python2.7/dist-packages
      backports_abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
Mopidy-Spotify-Tunigo: 1.0.0 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.19.0: 2.0.1 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
    tornado>=2.3: 4.4.2 from /usr/local/lib/python2.7/dist-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages 
      singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
        six: 1.10.0 from /usr/local/lib/python2.7/dist-packages
      certifi: 2016.9.26 from /usr/local/lib/python2.7/dist-packages
      backports_abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
  Mopidy-Spotify>=1.2.0: 3.0.0 from /usr/lib/python2.7/dist-packages
    Mopidy>=2.0: 2.0.1 from /usr/lib/python2.7/dist-packages
      Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
      requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
      tornado>=2.3: 4.4.2 from /usr/local/lib/python2.7/dist-packages
        backports.ssl_match_hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
        singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
          six: 1.10.0 from /usr/local/lib/python2.7/dist-packages
        certifi: 2016.9.26 from /usr/local/lib/python2.7/dist-packages
        backports_abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    pyspotify>=2.0.5: 2.0.5 from /usr/lib/python2.7/dist-packages
      cffi>=1.0.0: 1.1.2 from /usr/lib/python2.7/dist-packages
        pycparser: 2.10 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  tunigo>=1.0.0: 1.0.0 from /usr/lib/python2.7/dist-packages
    requests>=2.0.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
Mopidy-Youtube: 2.0.2 from /usr/local/lib/python2.7/dist-packages
  Mopidy>=1.0: 2.0.1 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
    tornado>=2.3: 4.4.2 from /usr/local/lib/python2.7/dist-packages  
      backports.ssl_match_hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
      singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
        six: 1.10.0 from /usr/local/lib/python2.7/dist-packages
      certifi: 2016.9.26 from /usr/local/lib/python2.7/dist-packages
      backports_abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  requests>=2.2.1: 2.11.1 from /usr/local/lib/python2.7/dist-packages
  setuptools: 28.8.0 from /usr/local/lib/python2.7/dist-packages
  pafy>=0.3.35: 0.5.0 from /usr/local/lib/python2.7/dist-packages
Mopidy-Spotify: 3.0.0 from /usr/lib/python2.7/dist-packages
  Mopidy>=2.0: 2.0.1 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
    tornado>=2.3: 4.4.2 from /usr/local/lib/python2.7/dist-packages  
      backports.ssl_match_hostname: 3.5.0.1 from /usr/local/lib/python2.7/dist-packages
      singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/dist-packages
        six: 1.10.0 from /usr/local/lib/python2.7/dist-packages
      certifi: 2016.9.26 from /usr/local/lib/python2.7/dist-packages
      backports_abc>=0.4: 0.5 from /usr/local/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  pyspotify>=2.0.5: 2.0.5 from /usr/lib/python2.7/dist-packages
    cffi>=1.0.0: 1.1.2 from /usr/lib/python2.7/dist-packages
      pycparser: 2.10 from /usr/lib/python2.7/dist-packages
  requests>=2.0: 2.11.1 from /usr/local/lib/python2.7/dist-packages
GStreamer: 1.2.4.0 from /usr/lib/python2.7/dist-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.12.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mad
        mpegaudioparse
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mpg123audiodec
sorvakko commented 8 years ago

Did some monkey debugging (read the signature in the stacktrace and noted there's a None where the signature expects a string, so I gave it a string (self.name in zeroconf.py seems to be set to None) ). This made the stacktrace disappear. The HTTP server is still unresponsive, though :/

Any debug logging I could / should enable?

sorvakko commented 8 years ago

I can now confirm that the web frontend not being visible was due to an unrelated issue (had some really screwy problem with the loopback interface of my host, affecting many other things beside Mopidy).

The stacktrace issue still stands (and was fixed by setting self.name = "test" in zeroconf.py).