SoundCloud ConnectionError only on boot not on restart, when running Mopidy as a service

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):
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/", line 237, in _actor_error_handling
  File "/usr/lib/python2.7/dist-packages/mopidy/", line 385, in start_backends
    config=config, audio=audio).proxy()
  File "/usr/lib/python2.7/dist-packages/pykka/", line 94, in start
    obj = cls(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/", line 21, in __init__
    self.remote = SoundCloudClient(config['soundcloud'])
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/", line 78, in __init__
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/", line 234, in _get
    res = self.http_client.get(url)
  File "/usr/lib/python2.7/dist-packages/requests/", line 469, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/", line 457, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/", line 569, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/", 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] 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):
2016-09-22 20:10:17,187 INFO [1039:MainThread] mopidy.commands: Starting Mopidy core

Maybe 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?

My hypothesis is that the service runs too early (before an internet connection), even though it shouldn’t. This behaviour seems consistent on boot and when I restart the service afterwards, everything is fine.

Have you tried enabling the “Wait for Network at Boot” option in raspi-config?