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.32k stars 49 forks source link

Cannot access local variabile item_id #2643

Closed WoAnerges closed 2 months ago

WoAnerges commented 2 months ago

What version of Music Assistant has the issue?

2.1.0rc2

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

No response

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

The problem

Impossible to add media.

Error (mainthread) [music_assistant.providers.filesystem.smb] Error processing Music/National_Anthem.mp3 - Cannot access local variabile item_id where it is not associated with a value

How to reproduce

Try to add media with a local hard drive, or samba options.

Music Providers

Samba and local hard drive

Player Providers

Universal group player

Full log output

No response

Additional information

What happened? It worked before. Now after the update it gives errors.

What version of Home Assistant Core are your running

2024.7.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

WoAnerges commented 2 months ago

hard drive is extFAT properly mounted by the samba user id, with rwxr-xr-x permissions.

The files were accessible earlier, never modified, never touched, and now after the update this error made all music completely inaccessible

mmuffins commented 2 months ago

I'm using version 2024.6.2 of the music assistant addon with 2.1.0rc2 of the music assistant addon on a raspberry pi with home assistant core 2024.7.1, supervisor 2024.06.2, OS 12.4 and frontend 20240705.0, and get the same behavior with files on the local storage of home assistant.

I removed all music files off the local home assistant storage, copied a couple mp3 files to it, then restarted home assistant, restarted the music assistant addon, then went to the music assistant settings and cleared the cache from the cache controller in music assistant. Here's what ended up in the log:

2024-07-19 15:41:25.111 INFO (MainThread) [music_assistant.cache] Clearing database...
2024-07-19 15:41:25.156 INFO (MainThread) [music_assistant.cache] Clearing database DONE
2024-07-19 15:42:09.036 WARNING (MainThread) [music_assistant.providers.filesystem_local] 01 Inaudible Melodies.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:09.039 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 01 Inaudible Melodies.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:09.817 WARNING (MainThread) [music_assistant.providers.filesystem_local] 02 Middle Man.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:09.820 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 02 Middle Man.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:10.687 WARNING (MainThread) [music_assistant.providers.filesystem_local] 03 Posters.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:10.689 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 03 Posters.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:11.474 WARNING (MainThread) [music_assistant.providers.filesystem_local] 04 Sexy Plexi.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:11.476 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 04 Sexy Plexi.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:12.266 WARNING (MainThread) [music_assistant.providers.filesystem_local] 05 Flake.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:12.267 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 05 Flake.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:13.055 WARNING (MainThread) [music_assistant.providers.filesystem_local] 06 Bubble Toes.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:13.057 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 06 Bubble Toes.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:13.839 WARNING (MainThread) [music_assistant.providers.filesystem_local] 07 Fortunate Fool.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:13.841 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 07 Fortunate Fool.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:14.638 WARNING (MainThread) [music_assistant.providers.filesystem_local] 08 The News.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:14.640 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 08 The News.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:15.438 WARNING (MainThread) [music_assistant.providers.filesystem_local] 09 Drink the Water.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:15.441 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 09 Drink the Water.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:16.253 WARNING (MainThread) [music_assistant.providers.filesystem_local] 10 Mudfootball (For Moe Lerner).mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:16.256 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 10 Mudfootball (For Moe Lerner).mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:17.122 WARNING (MainThread) [music_assistant.providers.filesystem_local] 11 F-Stop Blues.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:17.124 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 11 F-Stop Blues.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:17.910 WARNING (MainThread) [music_assistant.providers.filesystem_local] 12 Losing Hope.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:17.912 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 12 Losing Hope.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:18.676 WARNING (MainThread) [music_assistant.providers.filesystem_local] 13 It's All Understood.mp3 is missing ID3 tag [albumartist], using track artist(s) as fallback
2024-07-19 15:42:18.678 ERROR (MainThread) [music_assistant.providers.filesystem_local] Error processing 13 It's All Understood.mp3 - cannot access local variable 'item_id' where it is not associated with a value
2024-07-19 15:42:18.681 INFO (MainThread) [music_assistant.music] Sync task for Filesystem (local disk) completed
2024-07-19 15:42:18.707 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
2024-07-19 15:42:18.708 DEBUG (MainThread) [music_assistant.music] Performing database cleanup...
2024-07-19 15:42:18.731 DEBUG (MainThread) [music_assistant.music] Database cleanup done

The media folder looks like this: image

Music assistant can see the files, but when I try to play one of them, I'm getting the error message again image image

If I check the files in mp3tag they look just fine: image

When opening the tracks in the default home assistant player, they play just fine, so it also doesn't look like there's an issue with the files or storage.

mmuffins commented 2 months ago

After adding a couple dozen more tracks to the library I noticed that most newer songs were added to the library just fine. Just my older files were not. So on I hunch I took the same album as before, but tagged some of them with picard: image

lo and behold: image After a refresh, all files tagged with picard show up in music assistant just fine.

WoAnerges commented 2 months ago

Here on my side situation is worse - I have just retagged all the files right before adding them to the library, but this didn't help - the error persists, and music assistant cannot add anything.

vingerha commented 2 months ago

Same here, for another reason I started from scratch, up until 13440 files (of many many more) it is fine...now it is only throwing errors as above

vingerha commented 2 months ago

Adding that the tag of this Issue says hass-music-assistant but mine is with mass server

WoAnerges commented 2 months ago

The latest release candidate has fixed the bug. Thank you.