BlitterStudio / MB_SubSonic

MusicBee SubSonic plugin
GNU General Public License v3.0
110 stars 14 forks source link

Ping command gets invalid response #21

Closed andocromn closed 7 years ago

andocromn commented 7 years ago

I'm having a lot of problems with the subsonic plugin it seems like since 2017... when trying to set the server i receive the "server did not respond as expected" message, then it works for a while until i restart musicbee and then it doesn't even show subsonic in the computer tree. I'm at a loss for what to do, i've even gone as far as to wipe everything from musicbee and reinstall and the problem returns. its to the point where i've stopped using the plugin and musicbee. I'm also having the same problem on my other PC

any help or thoughts appreciated

midwan commented 7 years ago

Step 1) Relax, we'll find what the problem is (and hopefully fix it)

Step 2) Let's start by getting all the details in place. Nothing has changed in the plugin itself for quite some time, has something changed in your environment around the time you started having problems? E.g. Subsonic server upgrade, MusicBee version upgrade, etc?

3) The message "server did not respond" comes up if the plugin does not get the expected response from a standard "ping" command to the server's REST API (as documented here: http://www.subsonic.org/pages/api.jsp#ping). In other words, it tries to send this:

http://your-server/rest/ping.view

and expects an "ok" response back, in this format:

<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.1.1">
<script/>
</subsonic-response>

Can you try hitting the page with your browser and see what you get back? You'll need to change the url/path to your server of course...

andocromn commented 7 years ago

wow thanks for the super quick response! So, i had updated my music bee version, since then i have tried reverting back to the version and plugins that I originally used when i first started using musicbee in October. Nothing significant has changed as far as i have been able to determine, no recent updates to subsonic either. I've done the typical OS updates with apt-get, but thats fairly par for the course

I've ran the ping rest command in my browser, looks like i did not get back what was expected...

<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="failed" version="1.14.0">
   <error code="10" message="Required parameter is missing."/>
</subsonic-response>
midwan commented 7 years ago

@andocromn Is that a standard Subsonic server installation or a fork, like LibreSonic? We recently found out that LibreSonic does not even have the Ping command implemented in the API (see #20 also).

andocromn commented 7 years ago

yeah, the standard subsonic server... licensed and paid for

midwan commented 7 years ago

Thanks, I just got the same from my server also. I wonder when this started happening...

Anyway, I'll consider it a plugin bug and work on a fix! Thanks for bringing it to my attention.

midwan commented 7 years ago

@andocromn Update: could you please test the following instead: http://your-server/rest/ping.view?u=joe&p=sesame&v=1.12.0&c=myapp

where "joe" is a valid username, and "sesame" is a valid password for your server?

andocromn commented 7 years ago

that looks a little better

<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.14.0"/>
midwan commented 7 years ago

@andocromn Sorry, I forgot that you have to pass authentication in the request, in order to get a proper response back. :)

So if that works, it means that the request sent from the plugin was not acknowledged as a valid one from the server (so the server sends back a "non-ok" response). I'll try to see if I can recreate this here first and we'll see.

midwan commented 7 years ago

@andocromn Hmm it does work normally here. Could you perhaps open an account for me on your server and send me the details over e-mail (midwan@gmail.com), so I can test connecting there? If there's an error, I can capture it while debugging and see where it comes from.

Important note: Are you using Token based authentication or Hex Enconded Password?

andocromn commented 7 years ago

sent you creds for my server. the user account has the same rights as the user I use. I do not login to my server as an administrator account when playing music from my server. also probably important to note that i use HTTPS and a non-standard port

I'm not sure what you mean by Token or Hex... i just use a normal user / password, nothing fancy like LDAP or anything

midwan commented 7 years ago

@andocromn Thanks, I got the details and tested a connection already - which was successful. I could see the playlists and tracks normally.

The response that came back from the server was correct also, I monitored what was sent and what came back: A proper "ok" response.

So we know that the current version of the plugin I tested with, works with the server details you sent me. The default authentication method is "Token based" as you will see in the plugin Preferences screen. The alternative is "Hex encoded password" which is there for compatibility reasons with other forks of Subsonic (e.g. LibreSonic) which don't support Token based auth.

The next thing we should check is the plugin version you have installed. I tested this with the latest available version (v2.9), are you running on the same or anything older?

You can find out the exact version if you navigate to the MusicBee plugins folder, and right click on the MB_Subsonic.dll file. In the properties window, go to the Details tab: image

If you have an older version, it's worth trying with the latest also. If you're already on the latest, then the next thing I'd recommend is to cleanup the plugin settings and cache, then start MusicBee up and configure the connection once again.

You can find those files in the %APPDATA%\MusicBee folder of your system (it's under your user's Profile). Look for the file named "subsonicSettings.dat" and delete it, then start MusicBee up again.

andocromn commented 7 years ago

Ok, so i've got it working for now. I guess i had mistakenly assumed that i had only been using your latest version. I guess i had downloaded 2.2, which looks like the latest "stable". I'm using 2.9 now looks like its OK. I'll be using heavily tomorrow and see how it goes

thanks again

midwan commented 7 years ago

Thanks for confirming. I'll move the 2.9 to final, since it's been under "beta" for quite a while without any significant problems

claireshway commented 6 years ago

Sorry to bother, but I'm having an identical issue to this one. I'm using version 2.11 of the plugin (and I've also tried version 2.9) and version 3.1.6466 of MusicBee (but I've also tried 3.0). I get the "ok" response when I go to http://your-server/rest/ping.view?u=joe&p=sesame&v=1.12.0&c=myapp

(I'm also not the most computer literate, so left pretty much everything on its default settings, though I've tried setting the port to both 80 and 4040?)

Thank you so much for your help!

midwan commented 6 years ago

@claireshway No bother at all, the purpose is to fix problems where we can so that everyone can enjoy the experience!

Do you have the possibility to open up some way of reaching the server from the outside, so I can try to connect and debug from here? It doesn't have to be an admin account obviously, something that has access to the server and perhaps a track or two, so we can test the functionality...

Also, please don't post sensitive info here (like a password!), as it's public. If you'd like to send me some connection details, please do so at midwan at gmail dot com.

claireshway commented 6 years ago

@midwan Emailed!

midwan commented 6 years ago

Hi @claireshway I just tested it today, using the details you e-mailed me (thanks!) and the latest version of the plugin, using the Portable version of MusicBee (also latest version).

It seems to work for me... :)

image