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

MPD: Exception when trying to play many podcasts #1265

Closed
fatg3erman opened this Issue Aug 22, 2015 · 2 comments

Comments

2 participants
@fatg3erman
Contributor

fatg3erman commented Aug 22, 2015

I'm adding podcast URIs to the playlist (NOT using mopidy-podcast, just adding the URIs directly)

INFO     2015-08-22 22:19:26,991 [855:MpdSession-31] mopidy.mpd.session
  New MPD connection from [::ffff:127.0.0.1]:50701
DEBUG    2015-08-22 22:19:26,993 [855:MpdSession-31] mopidy.mpd.session
  Request from [::ffff:127.0.0.1]:50701: command_list_begin
DEBUG    2015-08-22 22:19:26,993 [855:MpdSession-31] mopidy.mpd.session
  Request from [::ffff:127.0.0.1]:50701: add "http://feedproxy.google.com/~r/WelcomeToNightVale/~5/tXeJa4IGs-8/23-EternalScouts.mp3"
DEBUG    2015-08-22 22:19:26,994 [855:MpdSession-31] mopidy.mpd.session
  Request from [::ffff:127.0.0.1]:50701: play "0"
DEBUG    2015-08-22 22:19:26,994 [855:MpdSession-31] mopidy.mpd.session
  Request from [::ffff:127.0.0.1]:50701: command_list_end
DEBUG    2015-08-22 22:19:28,176 [855:Core-27] mopidy.core.tracklist
  Triggering event: tracklist_changed()
DEBUG    2015-08-22 22:19:28,177 [855:MainThread] mopidy.listener
  Sending tracklist_changed to CoreListener: {}
DEBUG    2015-08-22 22:19:28,177 [855:Core-27] mopidy.core.playback
  Changing state: stopped -> playing
DEBUG    2015-08-22 22:19:28,177 [855:Core-27] mopidy.core.playback
  Triggering playback state change event
DEBUG    2015-08-22 22:19:28,179 [855:MainThread] mopidy.listener
  Sending playback_state_changed to CoreListener: {'old_state': u'stopped', 'new_state': u'playing'}
DEBUG    2015-08-22 22:19:28,179 [855:Audio-2] mopidy.audio.gst
  State change to GST_STATE_READY: result=GST_STATE_CHANGE_SUCCESS
DEBUG    2015-08-22 22:19:28,179 [855:MainThread] mopidy.audio.gst
  Got state-changed message: old=GST_STATE_NULL new=GST_STATE_READY     pending=GST_STATE_VOID_PENDING
INFO     2015-08-22 22:19:34,545 [855:MpdSession-32] mopidy.mpd.session
  New MPD connection from [::ffff:127.0.0.1]:50713
DEBUG    2015-08-22 22:19:34,547 [855:MpdSession-32] mopidy.mpd.session
  Request from [::ffff:127.0.0.1]:50713: status
ERROR    2015-08-22 22:19:38,324 [855:MpdSession-31] pykka
  Unhandled exception in MpdSession (urn:uuid:8a894042-6120-4236-a944-cd336bd7c8b3):
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 304, in _handle_receive
    return self.on_receive(message)
  File "/usr/local/lib/python2.7/site-packages/mopidy/internal/network.py", line 370, in on_receive
    self.on_line_received(line)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/session.py", line 34, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 47, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 76, in     _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 86, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 105, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 134, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 147, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 159, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 174, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 180, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 158, in validate
    return func(**callargs)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/protocol/command_list.py", line 42, in command_list_end
    command, current_command_list_index=index)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 47, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 76, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 86, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 105, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 134, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 147, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 159, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 174, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 180, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 158, in validate
    return func(**callargs)
  File "/usr/local/lib/python2.7/site-packages/mopidy/mpd/protocol/playback.py", line 181, in play
    return context.core.playback.play(tl_track).get()
  File "/usr/local/lib/python2.7/site-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/local/lib/python2.7/site-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/local/lib/python2.7/site-packages/mopidy/core/playback.py", line 305, in play
    self._play(tl_track=tl_track, tlid=tlid, on_error_step=1)
  File "/usr/local/lib/python2.7/site-packages/mopidy/core/playback.py", line 348, in _play
    backend.playback.change_track(tl_track.track).get() and
  File "/usr/local/lib/python2.7/site-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/local/lib/python2.7/site-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/local/lib/python2.7/site-packages/mopidy/backend.py", line 245, in change_track
    uri = self.translate_uri(track.uri)
  File "/usr/local/lib/python2.7/site-packages/mopidy/stream/actor.py", line 90, in translate_uri
    tracks = list(playlists.parse(content))
  File "/usr/local/lib/python2.7/site-packages/mopidy/internal/playlists.py", line 28, in parse
    return parse_urilist(data)  # Fallback
  File "/usr/local/lib/python2.7/site-packages/mopidy/internal/playlists.py", line 125, in parse_urilist
    if not line.strip() or line.startswith('#'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 154: ordinal not in range(128)
DEBUG    2015-08-22 22:19:38,326 [855:Audio-2] mopidy.audio.actor
  Position query failed

This is on OSX running Mopidy 1.1 from homebrew, but it also happens on Ubuntu running from the PPA.

Adding the same URI to MPD, it plays fine.

@jodal jodal added the C-bug label Aug 22, 2015

@jodal jodal added this to the v1.1.1 - Bugfixes milestone Aug 22, 2015

@jodal jodal self-assigned this Aug 22, 2015

@jodal

This comment has been minimized.

Member

jodal commented Aug 22, 2015

On my system, this URI is identified by the Mopidy scanner to be of MIME type application/x-id3, which shouldn't hit this code path in StreamPlaybackProvider.translate_uri():

$ python -m mopidy.audio.scan "http://feedproxy.google.com/~r/WelcomeToNightVale/~5/tXeJa4IGs-8/23-EternalScouts.mp3" | grep mime
mime                   application/x-id3

Anyway, there's a bug in the playlist parsing code here, checking if a bytestring (line) starts with a unicode string (#).

jodal added a commit that referenced this issue Aug 22, 2015

@jodal

This comment has been minimized.

Member

jodal commented Aug 22, 2015

Fixed in v1.1.x branch, and soon in develop.

@jodal jodal closed this Aug 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment