I just had same error but on checking the spotify app page I can see when I copy pasted my local address it did a double http://http://xxx and after fixing it worked - remember to save.
BTW, I’m running HA through Docker is that matters.
17-04-22 10:38:06 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.5/site-packages/aiohttp/web_protocol.py”, line 417, in start
resp = yield from self._request_handler(request)
File “/usr/local/lib/python3.5/site-packages/aiohttp/web.py”, line 289, in _handle
resp = yield from handler(request)
File “/usr/local/lib/python3.5/asyncio/coroutines.py”, line 213, in coro
res = yield from res
File “/usr/local/lib/python3.5/asyncio/coroutines.py”, line 213, in coro
res = yield from res
File “/usr/src/app/homeassistant/components/http/ban.py”, line 58, in ban_middleware_handler
return (yield from handler(request))
File “/usr/src/app/homeassistant/components/http/init.py”, line 422, in handle
result = handler(request, **request.match_info)
File “/usr/src/app/homeassistant/components/media_player/spotify.py”, line 115, in get
self.oauth.get_access_token(request.GET[‘code’])
File “/usr/local/lib/python3.5/site-packages/spotipy/oauth2.py”, line 218, in get_access_token
raise SpotifyOauthError(response.reason)
spotipy.oauth2.SpotifyOauthError: Bad Request
I am getting the same error, i don’t have my homeassistant open to the internet and only use it from a local ip, are you the same? have you found a solution for this error?