memen45 / SubMusic

Sync music and podcasts to your Garmin watch from your own SubSonic or Ampache server
GNU General Public License v3.0
122 stars 13 forks source link

Test Server raises a HTTP 501 error when using Navidrome (subsonic) #98

Open Clusters opened 3 months ago

Clusters commented 3 months ago

Hi memen45, first I have to thank you for maintaining this app, I really appreciate it.

After deploying the workaround from #97 I made some more progress on the Test Server functionality.

First of all some notes to my server:

When testing my server with the Test Server button on my watch I get the progress bar to 50% and the last log message is "Inlog OK\nPlaylists good". After that I get a HTTP 501 error "Unknown error". My assumption is that the playlist retrieve fails because Navidrome answers following on that response as it does not support podcasts yet:

> curl "https://myNavidrome.tld/rest/getPodcasts.view?v=1.10.2&c=subsonic&f=json&u=a_dummy_user&p=a_dummy_pw" This endpoint is not implemented, but may be in future releases

As you can see the REST response is not even in JSON format but a plain string. I'm not sure why this could trigger a HTTP error instead of an internal exception, but I have not that insight into MonkeyC nor Garmin App development 😶

Thanks a lot in advance! Looking forward to use this app :100:

edit: Browsing playlists on the watch also leads to a HTTP 501 error

memen45 commented 3 months ago

Interesting! Thanks for your detailed report.

With regards to the first issue: I have never seen a server have some methods not implemented before for Subsonic. Subsonic normally responds with their own custom error codes inside a HTTP/200 response. However, 'Not implemented' is not one of the Subsonic errors. Therefore the HTTP/501 is probably a good choice here from the server and SubMusic should handle it gracefully to show Podcasts are not supported. This could be improved (therefore adding enhancement label).

With regards to the second issue of not being able to browse playlists: could you check the /getPlaylist response? It could be Navidrome is missing implementations for more endpoints and therefore you receive the server error. The endpoints used for playlist discovery are /getPlaylists and getPlaylist.

Clusters commented 3 months ago

I'm sorry, that was a typo. I totally meant "browsing podcasts" instead of "browsing playlists" in my hasty edit 🙈

/getPlaylists and /getPlaylist works as intended. However, the /getPodcast (without "s") endpoint returns HTTP 404

memen45 commented 3 months ago

Ah okay, so same issue as with Test Server. Could be gracefully handled by SubMusic instead of passing the error to the user.

gitviola commented 3 months ago

I'm facing the same issue and enabled logging. But I don't know how to find the logs, so I'm not able to provide more information on what exactly is happening in the background. Do you know how to open the log file? I'm on macos and already tried to connect to my Garmin Watch through OpenMTP but I don't manage to connect to it

memen45 commented 3 months ago

Definitely check your server logs too. They might help me more than the app logs!

Garmin app logs can be found when mounting your watch as USB mass storage device, then open GARMIN/APPS/LOGS folder and look for TXT and BAK files. (TXT is the latest log file, BAK is the previous, so both may be interesting). Each app has a certain code as filename.

Make sure you disable debugging if possible during normal use, as it uses a lot of memory and can cause crashes when enabled.

Clusters commented 3 months ago

JFYI: Podcast issue might resolve itself in the near future as Navidrome seem to have an update for that in the future: https://github.com/navidrome/navidrome/pull/3150

gitviola commented 2 months ago

this fixed it for me https://github.com/memen45/SubMusic/issues/99#issuecomment-2305515545