Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues Synchronizing Apple Music #3440

Open
1 task done
cstack89 opened this issue Jan 11, 2025 · 9 comments
Open
1 task done

Issues Synchronizing Apple Music #3440

cstack89 opened this issue Jan 11, 2025 · 9 comments

Comments

@cstack89
Copy link

What version of Music Assistant has the issue?

2.3.6

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

2025.1.2

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

  • Yes

The problem

When synchronizing with Apple Music it pulls back a lot of information, but not everything. The main issue I've noticed is that it is only synchronizing 3 out of 10+ Apple Music Playlists. Is there any way to determine what the issue is? In the debug logs I see a lot of "Skipping album", will playlists with skipped albums be not included?

At one point I saw this error, but I think it was possibly because I deleted a playlist during synchronization.
2025-01-11 12:58:53.288 WARNING (MainThread) [music_assistant] Exception in task Task-186160 - target: <coroutine object MusicController._start_provider_sync.<locals>.run_sync at 0x7fb27468d940>: 'name' Traceback (most recent call last): File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/music.py", line 868, in run_sync await provider.sync_library(media_types) File "/app/venv/lib/python3.12/site-packages/music_assistant/models/music_provider.py", line 578, in sync_library async for prov_item in self._get_library_gen(media_type): File "/app/venv/lib/python3.12/site-packages/music_assistant/providers/apple_music/__init__.py", line 230, in get_library_playlists yield self._parse_playlist(item) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/venv/lib/python3.12/site-packages/music_assistant/providers/apple_music/__init__.py", line 590, in _parse_playlist name=attributes["name"], ~~~~~~~~~~^^^^^^^^ KeyError: 'name' 2025-01-11 12:58:53.288 WARNING (MainThread) [music_assistant.music] Sync task for Apple Music completed with errors Traceback (most recent call last): File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/music.py", line 868, in run_sync await provider.sync_library(media_types) File "/app/venv/lib/python3.12/site-packages/music_assistant/models/music_provider.py", line 578, in sync_library async for prov_item in self._get_library_gen(media_type): File "/app/venv/lib/python3.12/site-packages/music_assistant/providers/apple_music/__init__.py", line 230, in get_library_playlists yield self._parse_playlist(item) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/venv/lib/python3.12/site-packages/music_assistant/providers/apple_music/__init__.py", line 590, in _parse_playlist name=attributes["name"], ~~~~~~~~~~^^^^^^^^ KeyError: 'name'

How to reproduce

Unknown, I have just started with Music Assistant and Apple Music integration. All I did was try to sync.

Music Providers

Apple Music

Player Providers

N/A

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2025.1.2

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Alternative

@OzGav
Copy link
Contributor

OzGav commented Jan 12, 2025

Have the playlists any manually uploaded tracks?

edit: please follow the instructions and attach the full log

@cstack89
Copy link
Author

It seems to be crashing on a particular playlist, but I'm not sure which one. I renamed one of my playlists from starting with a C to an A and it showed up in Music Assistant. However I can't find a problematic playlist that starts with a B or C. Some of the playlists do have uploaded music yes, but not all of them.

I will get a proper log early tomorrow.

@cstack89
Copy link
Author

logs.txt
Here is today's log after hitting sync

@OzGav
Copy link
Contributor

OzGav commented Jan 12, 2025

That isn't the full log. You need to obtain that from the MA settigs. Also we don't want debug on unless asked for. I do see a 500 error which could be due to manually uploaded tracks. I draw your attention to this in the docs:

MA can only play an uploaded track if Apple has linked it to an online version in the Apple Music catalog. If that link is not found, MA will not do the import.

Also I am not sure why you have a lot of lost connection errors to HA?

@cstack89
Copy link
Author

music-assistant.log
Here should be the proper log. I'm not 100% sure where I have managed to turn on debug. I don't think the issue is fully my manually uploaded tracks. Like I said I changed a playlist name from Chris (wasn't showing up) to A-Chris, and now it shows up correctly. So something seems to be crashing the playlist loading process.

Yes I saw that in the logs too, any suggestions on what might be going on there?

@OzGav
Copy link
Contributor

OzGav commented Jan 12, 2025

I would guess there is a different playlist that is causing the problem. “Chris” is probably fine and now you have moved it up the order it is getting pulled in. Use your plan of adding an A to the start of each and see how many you can get.

I see you are using docker. There must be some network problem causing this. Do you have any weird/complex network setup going on there?

@cstack89
Copy link
Author

Sounds good, maybe I'll add B to the ones are working and try a handful of As at a time.

I'm using the Hyper-V VM image from Home assistant and then I added music assistant as an add-on inside home assistant. My overall home network has a few VLANS, but I assume the connection for this should be internal?

@cstack89
Copy link
Author

cstack89 commented Jan 19, 2025

FYI I'm still stuck on both issues. I think I'm going to open a separate issue to track the networking issue?

Regarding Apple Music though, I re-named every playlist I have to start with A, if I do that they all show up in music assistant. However if I change one of them back to start with C it disappears. Additionally, I have deleted all our smart playlists and removed all favorited songs to no avail.

That being said, in the apple music provider init_.py wouldn't it be safer to just check if the dict has a name and if not skip the playlist?

@OzGav
Copy link
Contributor

OzGav commented Jan 19, 2025

@MarvinSchenkel

@OzGav OzGav removed the More info label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants