question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New error after updating HA to 2022.8.1 (or possibly 2022.8.0)

See original GitHub issue

I hadn’t tried in 2022.8.0, so there’s that…

After updating to 2022.8.1, I noticed that my media pages involving Spotify not only stopped showing devices to play to, but also stopped showing playlists that can be selected. I AM on the latest version of spotcast installed via HACS (v3.6.29) So, I started looking at the log files. I see a constant repeating stream of:

`2022-08-05 17:20:22.447 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/spotcast/spotcast_controller.py", line 146, in get_spotify_token
    self._access_token, self._token_expires = st.start_session(
  File "/usr/local/lib/python3.10/site-packages/spotify_token.py", line 20, in start_session
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://open.spotify.com/get_access_token?reason=transport&productType=web_player&_authfailed=1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/config/custom_components/spotcast/helpers.py", line 91, in run
    return await loop.run_in_executor(executor, pfunc)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/spotcast/__init__.py", line 98, in get_devices
    client = spotcast_controller.get_spotify_client(account)
  File "/config/custom_components/spotcast/spotcast_controller.py", line 183, in get_spotify_client
    return spotipy.Spotify(auth=self.get_token_instance(account).access_token)
  File "/config/custom_components/spotcast/spotcast_controller.py", line 140, in access_token
    self.ensure_token_valid()
  File "/config/custom_components/spotcast/spotcast_controller.py", line 136, in ensure_token_valid
    self.get_spotify_token()
  File "/config/custom_components/spotcast/spotcast_controller.py", line 155, in get_spotify_token
    raise HomeAssistantError("Could not get spotify token.")
homeassistant.exceptions.HomeAssistantError: Could not get spotify token.
2022-08-05 17:20:22.458 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved`

…for each time I try to click anything on the Spotify panel or any custom panels using spotcast.

This used to work flawlessly prior to updating HA. I’ve checked and update my sp_dc and sp_key values in my secrets.yaml file, to no avail. I have zero issues logging in to spotify on any other device. Where else should I look or what more info can I provide?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
accelle17commented, Aug 8, 2022

Fix, I had to renew the sp_dc and sp_key, probably this is the only one needed to fix it.

0reactions
hmmbobcommented, Aug 9, 2022

get_access_token

I’ve been trying to filter this one too on incognito but it’s zero result. I checked application instead of network and it displayed the cookies of spotify and that’s where I found the dc and keys.

I’ve taken a go to better explain the steps needed in https://github.com/fondberg/spotcast/pull/342

Read more comments on GitHub >

github_iconTop Results From Across the Web

2022.8: You can fix it! - Home Assistant
First-class support for Bluetooth, get notified about detected issues and how to repair them, find integrations by brand name, and maps with ...
Read more >
Unable to start after upgrade 2022.8.0 #76178 - GitHub
I am running homeassistant from PYPI in venv inside docker and after updating HA installation in docker image to 2022.8 it crashes ...
Read more >
First look at Tesla software update 2022.12
Tesla releases a major software update about once every four weeks. The latest public update is 2022.8. About 65% of owners are now...
Read more >
Anyone apply the 2022.8.10.5 update yet? | Tesla Motors Club
Just got notification for an available update to 2022.8.10.5. I'm still on MCU1 with AP1. Can't find any release notes online to see...
Read more >
2022.12.1 Release Notes : r/teslamotors - Reddit
The original and largest Tesla community on Reddit! ... I'll have already driven 11 hours, I might need to hop in the Tesla...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found