添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I am running Mopidy as a service on my Raspberry Pi (3) with Mopidy-SoundCloud as my most important extension.

Somehow, it seems every time I boot the system, I am not able to load any SoundCloud Sets. The logs show that Mopidy-SoundCloud throws an error:

2016-09-22 20:09:55,704 INFO [575:MainThread] urllib3.connectionpool: Starting new     HTTPS connection (1): api.soundcloud.com
2016-09-22 20:09:55,711 ERROR [575:MainThread] mopidy.commands: Got un-handled exception from SoundCloudBackend
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 237, in _actor_error_handling
    yield
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 385, in start_backends
    config=config, audio=audio).proxy()
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 94, in start
    obj = cls(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/actor.py", line 21, in __init__
    self.remote = SoundCloudClient(config['soundcloud'])
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 78, in __init__
    self._get('me.json')
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 234, in _get
    res = self.http_client.get(url)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 469, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 407, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', gaierror(-2, 'Name or service not known'))
2016-09-22 20:09:55,754 INFO [575:Audio-2] mopidy.audio.actor: Audio output set to "alsasink"
2016-09-22 20:09:55,794 INFO [575:MainThread] mopidy.commands: Starting Mopidy core

When I just restart the service, no errors seem to occur, though:

2016-09-22 20:10:17,009 INFO [1039:MainThread] urllib3.connectionpool: Starting new HTTPS connection (1): api.soundcloud.com
2016-09-22 20:10:17,187 INFO [1039:MainThread] mopidy.commands: Starting Mopidy core

Maybe api.soundcloud.com cannot be reached when the service is started on boot? Seems weird to me that it has anything to do with the service being started too early, since the service should only start after networking becoming available, I think.

Anyone has any suggestions?