jeffvli / sonixd

A full-featured Subsonic/Jellyfin compatible desktop music player
GNU General Public License v3.0
1.85k stars 74 forks source link

Specifying a port for Navidrome server does not work #360

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug when specifying a port to a navidrome server https://www.example.com:44000 sonixd gives error "Cannot Read property 'status' if undefined"

Using https://demo.navidrome.org works fine.

To Reproduce Steps to reproduce the behavior: Try to login and specify a port to a navidrome server. https://www.example.com:44000 "Cannot read propert 'status' of undefined"

Expected behavior Logging into navidrome server.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): -Debian Bullseye -KDE Additional context

jeffvli commented 2 years ago

It should work even if a port is appended onto a URL.

Make sure when you write the URL in the login field that it doesn't have a forward slash / at the end.

Won't work: https://www.example.com:44000/ Will work: https://www.example.com:44000

ghost commented 2 years ago

It still gives me the same error. I am using a subdomain that is different than www. could that be the issue?

jeffvli commented 2 years ago

No, the subdomain shouldn't make a difference.

Here's where the login logic is being applied:

https://github.com/jeffvli/sonixd/blob/645c2eb5b717f37ab467b15ebf60d3972abc781f/src/components/settings/Login.tsx#L40-L52

You can try going to this URL in your browser to check what the response is (note that this URL is with the "Legacy auth" checkbox enabled):

# Replace <SERVER URL> with the URL you're using to try to login with
# Replace <USERNAME> with your username
# Replace <PASSWORD> with your password

<SERVER URL>/rest/ping.view?v=1.13.0&c=sonixd&f=json&u=<USERNAME>&p=<PASSWORD>

The error you're receiving indicates that for some reason the "status" field is missing from the ping response. If the URL is valid, you should receive a JSON result saying that the "status" is "ok". If not, there may be something wrong with the URL you're trying to access.

{"subsonic-response":{"status":"ok","version":"1.16.1","type":"navidrome","serverVersion":"0.47.5-SNAPSHOT (ce0db834)"}}
ghost commented 2 years ago

Ok when you I visit the website with my information included is doesn't show me a json response. It just logs me into navidrome via the URL. However I do understand now that the issue is with the ping response. I'll take a look at my network and see if theres anything preventing proper communication between client and server. I'll report back with the issue when I get it resolved. Thankyou for your very useful and detailed response.