music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.31k stars 48 forks source link

Spotify error #2860

Closed boris19 closed 4 days ago

boris19 commented 1 week ago

What version of Music Assistant has the issue?

2.3.0b17

What version of the Home Assistant Integration have you got installed?

2024.8.0

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

After this error stop play song in playlist:

2024-09-02 18:20:17.365 ERROR (MainThread) [music_assistant.streams.media_stream] Failed to stream spotify://track:1qeV7JbH1rv3ygF6AhZ5x3 - error: 1 Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/music_assistant/server/helpers/audio.py", line 192, in _feed_stdin async for chunk in self.audio_input: File "/usr/local/lib/python3.12/site-packages/music_assistant/server/providers/spotify/__init__.py", line 600, in get_audio_stream raise AudioError( music_assistant.common.models.errors.AudioError: Failed to stream spotify://track:1qeV7JbH1rv3ygF6AhZ5x3 - error: 1

How to reproduce

Playing songs.

Music Providers

Spotify

Player Providers

Snapcast

Full log output

music-assistant (1).log

Additional information

No response

What version of Home Assistant Core are your running

2024.8.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Windows

OzGav commented 1 week ago

Yes I have seen this.

marcelveldt commented 1 week ago

please test if this is fixed in 2.3.0b18

boris19 commented 1 week ago

b19 same issue.

boris19 commented 1 week ago

I simulated it in a way that I pressed 3-4 times in a row the next song from the playlist on Spotify. YT MUSIC is fine.

music-assistantb19.log

marcelveldt commented 1 week ago

This is a snapcast issue (your log is full of issues with snapcast!). First fix all the errors with the snapcast server, then look at the spotify issue. Now your log is unreadable due to all snapcast errors. As if you are running two snapcast servers at the same time ?

boris19 commented 1 week ago

Im running snapserver in MA only.

boris19 commented 1 week ago

I found this log today while playing. Yes it looks like two Snapcast servers are running. But in reality only one is running in MA.

2024-09-05 08:50:44.359 WARNING (MainThread) [music_assistant.snapcast] {'code': -32603, 'data': "bind: Address in use [system:98 at /usr/include/boost/asio/detail/reactive_socket_service.hpp:161 in function 'bind']", 'message': 'Internal error'}

boris19 commented 1 week ago

MA puts an extreme load on the CPU and RAM over time. IMG_2151

nikito commented 1 week ago

I'm also seeing this without snapcast, just using the Chromecast player provider.

OzGav commented 1 week ago

I found this log today while playing. Yes it looks like two Snapcast servers are running. But in reality only one is running in MA.

Something else on your network is on this address then. You need to resolve that first.

boris19 commented 1 week ago

Combination of MA version 2.3.0b17 and YT music and Snapcast i have log without any issue and without put load on CPU and RAM after 9hours continuous playback. I will send full log later after end of day in building.

IMG_2170

boris19 commented 1 week ago

I forgot to mention that I completely deleted Spotify from the providers, before that I only had it disabled.

JasperTheMinecraftDev commented 1 week ago

Hey, I have this issue too. Only Chromecast provider. Logs: 2024-09-06 18:24:04.293 ERROR (MainThread) [music_assistant.streams.media_stream] Failed to stream spotify://track:0SWgf5CW30gZB9zlB8E6V - error: 1 Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/music_assistant/server/helpers/audio.py", line 192, in _feed_stdin async for chunk in self.audio_input: File "/usr/local/lib/python3.12/site-packages/music_assistant/server/providers/spotify/init.py", line 601, in get_audio_stream raise AudioError( music_assistant.common.models.errors.AudioError: Failed to stream spotify://track:0SWgf5CW30gZBzZlB8E6V - error: 1 2024-09-06 18:24:09.829 ERROR (MainThread) [music_assistant.streams.media_stream] Failed to stream spotify://track:0AIcr2wW0FiHkNS82AwLE9 - error: None Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/music_assistant/server/helpers/audio.py", line 192, in _feed_stdin async for chunk in self.audio_input: File "/usr/local/lib/python3.12/site-packages/music_assistant/server/providers/spotify/init.py", line 601, in get_audio_stream raise AudioError( music_assistant.common.models.errors.AudioError: Failed to stream spotify://track:0AIcr2wW0FiHkNS82wLE9 - error: None

JasperTheMinecraftDev commented 1 week ago

Also this: 2024-09-06 18:32:15.961 ERROR (MainThread) [music_assistant.streams.media_stream] Failed to stream spotify://track:0AIcr2wW0FiHkNS82AwLE9 - error: None Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/music_assistant/server/helpers/audio.py", line 192, in _feed_stdin async for chunk in self.audio_input: File "/usr/local/lib/python3.12/site-packages/music_assistant/server/providers/spotify/init.py", line 601, in get_audio_stream raise AudioError( music_assistant.common.models.errors.AudioError: Failed to stream spotify://track:0AIcr2wWiHkNSAwLE9 - error: None 2024-09-06 18:32:15.978 DEBUG (MainThread) [music_assistant.streams.media_stream] stream finished (with code 183) for spotify--ieX5yDx8://track/0AIcr2wW0HkNS82AwLE9 - seconds streamed: 0

I see the music title appearing on my TV but then it stops playing and empties the queue.

boris19 commented 1 week ago

So after a full day of playing music in the combination mentioned below the log is clean with no errors. Please see the log stating that it started playing today 2024-09-06 at 8:43 and finished at 20:39, completely without any problems.

logb17.log

Combination of MA version 2.3.0b17 and YT music and Snapcast i have log without any issue and without put load on CPU and RAM after 9hours continuous playback. I will send full log later after end of day in building.

IMG_2170

OzGav commented 1 week ago

For those reporting the error code 1 you need to advise what server version you are running. If you aren’t on beta 19 or 2.2.3 then you need to update

nikito commented 1 week ago

Got the error just now, version 2.3.0b19 2024-09-06 19:40:58.815 ERROR (MainThread) [music_assistant.streams.media_stream] Failed to stream spotify://track:5N8KsYJ8IEMQVw33JvytW8 - error: 1 Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/music_assistant/server/helpers/audio.py", line 192, in _feed_stdin async for chunk in self.audio_input: File "/usr/local/lib/python3.12/site-packages/music_assistant/server/providers/spotify/__init__.py", line 601, in get_audio_stream raise AudioError( music_assistant.common.models.errors.AudioError: Failed to stream spotify://track:5N8KsYJ8IEMQVw33JvytW8 - error: 1

JasperTheMinecraftDev commented 1 week ago

For those reporting the error code 1 you need to advise what server version you are running. If you aren’t on beta 19 or 2.2.3 then you need to update

Latest as of the time of writing, which is 2.2.3. Installed it yesterday.

OzGav commented 6 days ago

Please test again when beta 20 or later is released

OzGav commented 6 days ago

Beta 20:has been released

nikito commented 6 days ago

Just tested out a bit, the error is no longer happening which is great! The only issue now is that the playlist will just pause itself after a while (think I got through maybe 5-7 songs before it paused itself again). If I click play it resumes fine though, so maybe something to do with the substitute track being pulled in?

EDIT: Tried a few more times, sometimes as few as 1-2 songs go by before it happens again and I have to hit play. But seems in every case hitting play resumes without issue. I also don't see any errors or messages in the logs when this happens.

senderbell commented 6 days ago

The same for me. 1 or 2 songs then a pause. There are no errors in the log.

EDIT: I just tried SoundCloud, and there's the same problem.

OzGav commented 4 days ago

Those are different problems. Review the similar open issues and if yours is not the same then open a new one.