Mopidy 1.0.1 doesn't emit events over WS when using Tornado 2.3

Hi,
there seems to be an error in the new version 1.0.1 that I just got via apt-get on my RPi2 running the latetest Raspbian.

I got the following error messages after starting the server:

ERROR Unhandled exception in HttpFrontend (urn:uuid:960cdc73-7676-4d45-b546-208573be538c):
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pykka/actor.py”, line 200, in _actor_loop
response = self._handle_receive(message)
File “/usr/lib/python2.7/dist-packages/pykka/actor.py”, line 294, in _handle_receive
return callee(*message[‘args’], **message[‘kwargs’])
File “/usr/lib/python2.7/dist-packages/mopidy/http/actor.py”, line 77, in on_event
on_event(name, **data)
File “/usr/lib/python2.7/dist-packages/mopidy/http/actor.py”, line 84, in on_event
handlers.WebSocketHandler.broadcast(message)
File “/usr/lib/python2.7/dist-packages/mopidy/http/handlers.py”, line 93, in broadcast
loop = tornado.ioloop.IOLoop.current()
AttributeError: type object ‘IOLoop’ has no attribute 'current’
WARNING Das Element kann diesen Datenstrom nicht verarbeiten. Bitte schicken Sie einen Fehlerbericht.

I got the last warning during streaming from Spotify.

But despite the error messages streaming from Spotify worked.

Thanks and best regards,
Dieter

What version of tornado do you have installed? mopidy deps should show this.

This is what I get:

pi@raspberrypi ~ $ mopidy deps
WARNING /home/pi/.config/mopidy/mopidy.conf has errors, line 5, 13 has been ignored.
Executable: /usr/bin/mopidy
Platform: Linux-3.18.7-v7±armv7l-with-debian-7.8
Python: CPython 2.7.3 from /usr/lib/python2.7
Mopidy: 1.0.1 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
Mopidy-MusicBox-Webclient: 2.0.0 from /usr/local/lib/python2.7/dist-packages
setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
Mopidy>=0.19: 1.0.1 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify: 1.3.0 from /usr/share/mopidy
Mopidy>=1.0: 1.0.1 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 2.3 from /usr/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
id3demux
id3v2mux
lame
mad
mp3parse
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
flump3dec

Thanks, as I suspected this is a rather old tornado. We run our HTTP tests against this version of Tornado, so it’s odd that it didn’t catch this before release. Anyway, try replacing current() with instance() and I think this will work.

We’ll file a bug for this and try and release a 1.0.2 rather quickly if the fix works.

Thanks for the quick answer.

I do an apt-get update+upgrade almost every day, So it seems that the official Raspbian distribution currently uses an old tornado version.

It seems that everything works, though. I have tested streaming, MPD and HTTP access. So it no real emergency. The only thing I haven’t test is playing local mp3 files.

https://github.com/mopidy/mopidy/commit/a72c9c88c9e4c71382a96d320cea9e6ca9036d71 should fix this.

Hi Adam,
risking that I’m going on your nerves there seem to be new errors with version 1.0.2. Maybe you want to have a look at these:

INFO Starting Mopidy 1.0.2
INFO Loading config from builtin defaults
INFO Loading config from /home/pi/.config/mopidy/mopidy.conf
INFO Loading config from command line options
INFO Enabled extensions: spotify, mpd, http, stream, m3u, softwaremixer, musicbox_webclient, local
INFO Disabled extensions: none
INFO Starting Mopidy mixer: SoftwareMixer
INFO Starting Mopidy audio
INFO Starting Mopidy backends: SpotifyBackend, StreamBackend, M3UBackend, LocalBackend
INFO Mopidy uses SPOTIFY® CORE
INFO Audio output set to "autoaudiosink"
INFO Loaded 0 M3U playlists from /home/pi/.local/share/mopidy/m3u
INFO Connected to Spotify
INFO Loaded 4382 local tracks using json
INFO Starting Mopidy core
INFO Starting Mopidy frontends: MpdFrontend, HttpFrontend
INFO MPD server running at [0.0.0.0]:6600
INFO HTTP server running at [0.0.0.0]:6680
INFO Loaded 21 Spotify playlists
ERROR Unhandled exception in HttpFrontend (urn:uuid:21710c38-3fe8-4ba3-ab22-0dae4f2d9011):
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pykka/actor.py”, line 200, in _actor_loop
response = self._handle_receive(message)
File “/usr/lib/python2.7/dist-packages/pykka/actor.py”, line 294, in _handle_receive
return callee(*message[‘args’], **message[‘kwargs’])
File “/usr/lib/python2.7/dist-packages/mopidy/http/actor.py”, line 77, in on_event
on_event(name, **data)
File “/usr/lib/python2.7/dist-packages/mopidy/http/actor.py”, line 84, in on_event
handlers.WebSocketHandler.broadcast(message)
File “/usr/lib/python2.7/dist-packages/mopidy/http/handlers.py”, line 100, in broadcast
loop.add_callback(_send_broadcast, client, msg)
TypeError: add_callback() takes exactly 2 arguments (4 given)
WARNING Das Element kann diesen Datenstrom nicht verarbeiten. Bitte schicken Sie einen Fehlerbericht.

It may be coincidence, but it seems that my MPD clients on my Android Phone (MPDroid and Remotedy) produces error messages. Remotedy doesn’t show anything anymore under “Currently Playing”.

Thanks,
Dieter

Just to be on the save side I removed mopidy and mopidy-spotify using apt-get remove and then did a clean new installation. So I guess my installation is o.k.

In case that’s important, here is my “mopidy deps” information again:

pi@raspberrypi ~ $ mopidy deps
Executable: /usr/bin/mopidy
Platform: Linux-3.18.7-v7±armv7l-with-debian-7.8
Python: CPython 2.7.3 from /usr/lib/python2.7
Mopidy: 1.0.2 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
Mopidy-MusicBox-Webclient: 2.0.0 from /usr/local/lib/python2.7/dist-packages
setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
Mopidy>=0.19: 1.0.2 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify: 1.3.0 from /usr/share/mopidy
Mopidy>=1.0: 1.0.2 from /usr/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 2.3 from /usr/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
id3demux
id3v2mux
lame
mad
mp3parse
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
flump3dec
pi@raspberrypi ~ $

Hi,

We botched the fix in 1.0.2 and will be releasing a 1.0.3 with a verified fix within about an hour :slight_smile: That’s what I get for ignoring that the tests don’t verify that things work with 2.3 and neglecting to manually double check.

https://github.com/mopidy/mopidy/pull/1154

(And on a quick side note Adamcik is my last name, this seems to happen every now and then so no worries)

Sorry about the wrong name. If you want, I can test the new fix before you upload it into the repository. In the meantime I found out how to install just the handlers.py file from Github.

1.0.3 has been released. And I manually installed an old Tornado version to test things this time. So this particular issue should be fixed. So just go ahead an try 1.0.3 and let us know if we still missed something :slight_smile:

I had a quick try before leaving for work. It seems to work, the error messages are come. Everything like HTTP browser access and MDP access seemed to work properly.

I had only one single warning left (in yellow), no more bloody red error messages:
WARNING Das Element kann diesen Datenstrom nicht verarbeiten. Bitte schicken Sie einen Fehlerbericht.

(WARNING: The element cannot process this data stream, Please send bug report)