Error setting up Spotify in HA 2021.4.4

Hello,
My Spotify integration stopped working due to issue 174, with spotcast. So I removed the Spotify and spotcast config, and upgraded to HA 2021.4.4.
I am now getting an issue re-adding the Spotify integration.

When adding the Spotify integration back via the the FrontEnd Configuration/Integrations/Add Integration, the Spotify call-back URL is called, but HA reports

500 Internal Server Error

I see in the logs:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/forwarded.py", line 71, in forwarded_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/ban.py", line 74, in ban_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/auth.py", line 135, in auth_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/view.py", line 131, in handle
result = await result
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/config/config_entries.py", line 146, in get
return await super().get(request, flow_id)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/data_entry_flow.py", line 93, in get
result = await self._flow_mgr.async_configure(flow_id)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 156, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 214, in _async_handle_step
result: dict = await getattr(flow, method)(user_input)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/config_entry_oauth2_flow.py", line 307, in async_step_creation
return await self.async_oauth_create_entry(
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/spotify/config_flow.py", line 43, in async_oauth_create_entry
spotify = Spotify(auth=data["token"]["access_token"])
File "/srv/homeassistant/lib/python3.9/site-packages/spotipy/client.py", line 166, in __init__
self._build_session()
File "/srv/homeassistant/lib/python3.9/site-packages/spotipy/client.py", line 193, in _build_session
retry = urllib3.Retry(
TypeError: __init__() got an unexpected keyword argument 'allowed_methods'

I’ve triple checked the callback URL, and client ID / secret.

Any suggestions what the allowed_methods issue is, or how I can trace this.

Looks like the issue is reported in the Home Assistant Core as well.
In my case, resolved with a pip install --upgrade spotipy.

I am having exactly the same problem as you @ColinRobbins the only issue is that updating spotipy (pip install --upgrade spotipy) to build 2.18.0 didn’t solve the problem. Also the latest update tot 2021.4.5 didn’t solve anything… are there more options to make the integration work again?

How are you running HA?
I’m running HA in a Python venv - so must run the pip install in the venv too.
Having said that going to 2021.4.5 should have fixed that.
I’ve also found sometimes when HA bumps a library dependency, it takes two restarts of HA to fix it.

I run HA on Ubuntu 16.4 in a venv environment. Strangely enough after I upgraded Spotipy - and restarted HA several times - it still says it’s getting itself into trouble error 500.