core: Last.fm integration errors
The problem
I get a lot of errors regarding the last.fm integration in the log and it’s often slow to update.
Environment
- Home Assistant Core release with the issue: 0.112.2
- Last working Home Assistant Core release (if known): Unknown. It’s been like this as long as I’ve used it. At least 10 months.
- Operating environment (OS/Container/Supervised/Core): Supervised
- Integration causing this issue: Last.fm
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/lastfm/
Problem-relevant configuration.yaml
# Last.fm
sensor:
- platform: lastfm
api_key: !secret last_fm_api_key
users:
- tigattack
- various
- other
- users
Traceback/Error logs
Logger: homeassistant.helpers.entity
Source: components/lastfm/sensor.py:90
First occurred: 7 July 2020, 18:36:51 (163 occurrences)
Last logged: 7 July 2020, 19:04:36
Update for sensor.lastfm_tigattack fails
Update for sensor.various fails
Update for sensor.other fails
Update for sensor.users fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
self.update # type: ignore
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/lastfm/sensor.py", line 90, in update
recent_tracks = self._user.get_recent_tracks(limit=2)
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 2365, in get_recent_tracks
params,
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 2797, in _collect_nodes
raise e
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 2793, in _collect_nodes
doc = sender._request(method_name, cacheable, params)
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 1118, in _request
return _Request(self.network, method_name, params).execute(cacheable)
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 951, in execute
response = self._download_response()
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 940, in _download_response
self._check_response_for_errors(response_text)
File "/usr/local/lib/python3.7/site-packages/pylast/__init__.py", line 970, in _check_response_for_errors
raise WSError(self.network, status, details)
pylast.WSError: Operation failed - Most likely the backend service failed. Please try again.
Additional information
There are a lot of similar but slightly differing errors around the lastfm integration. The above is the most common. Please let me know if you’d like tracebacks from all of the other errors.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 29 (6 by maintainers)
@ZL1LAC can you create a separate issue for this? I just tried it and for me it worked.
I suspect the Last.fm API is just quite unreliable. I’ve witnessed this in other projects too. It would be nice if the code owner could make the integration handle these issues a bit better though, so our logs aren’t spammed with LFM errors.