Open markuswernig opened 6 years ago
Likely due to a behaviour change in qurl between 4 & 5
I just looked into this, since it just bit me after a system upgrade; it's almost certainly what @hatstand suggested. The Qt-5 docs on QUrl are very adamant about the host
component of a QUrl being a proper STD 3 hostname; the parser is trying very hard to turn QUrl url = QUrl(QString("subsonic://%1").arg(id));
into a URL with a valid hostname.
Based on the documentation, I think this could be resolved with a slight change of the URL format to the following: QUrl url = QUrl(QString("subsonic:%1").arg(id));
which puts the URL in the "non-hierarchical" category and would place the id in the path
component instead of host
, which should dissuade it from trying to interpret the integer as an IP address.
I will attempt a patch myself and submit a pull request if it works out, but I won't be offended if someone more familiar with the codebase takes it on and fixes it before then.
Hi, Just for reference: I am using a similar setup, ampache 4.0.1 and a Debian buster client with QT 5.11.3. This is working properly for me, both using the clementine package from Debian (1.3.1+git609-g623a53681+dfsg-1) and clementine compiled from the latest git.
Hi
Yes, ampache has been patched to work around this particular bug, so this will work even if the ID sent by clementine is still in the wrong format. I have not, however, checked recently if that is still the case (i.e if that bug still exists in clementine). You may want to look at the ampache access logs.
best /m
On 12/5/19 12:15 AM, cquike wrote:
Hi, Just for reference: I am using a similar setup, ampache 4.0.1 and a Debian buster client with QT 5.11.3. This is working properly for me, both using the clementine package from Debian (1.3.1+git609-g623a53681+dfsg-1) and clementine compiled from the latest git
The logs show the id as it should be:
192.168.11.11 - - [05/Dec/2019:00:04:16 +0100] "GET /rest/stream.view?v=1.8.0&c=Clementine&u=uuu&p=enc:ppp&id=300006272 HTTP/1.0" 200 1204766 "-" "Clementine 1.3.1-945-g440ac6dda"
Maybe QT 5.11.3 has fixed the issue in QUrl?
On 12/5/19 12:33 AM, cquike wrote:
The logs show the id as it should be: |192.168.11.11 - - [05/Dec/2019:00:04:16 +0100] "GET /rest/stream.view?v=1.8.0&c=Clementine&u=uuu&p=enc:ppp&id=300006272 HTTP/1.0" 200 1204766 "-" "Clementine 1.3.1-945-g440ac6dda"|
Maybe QT 5.11.3 has fixed the issue in QUrl?
That looks good, indeed. So maybe if somebody else can confirm that (I cannot, currently) then we can close this bug?
Before posting
Please follow the steps below and check the boxes with [x] once you did the step.
System information
Please provide information about your system and the version of Clementine used.
Expected behaviour / actual behaviour
I added a Subsonic server (which is actually an ampache instance), added its root CA cert to /etc/ssl/certs/ca-certificates.crt (this solves #5360) I can load the catalogue, though no cover art is added. Playing any song from the catalogue immediately terminates with the dreaded "Playlist finished" message.
Obviously, it should play the song.
Steps to reproduce the problem (only for bugs)
Install (emerge) clementine, add subsonic server and attempt playing.
Analysis
On the same client machine I also have Debian stretch, which installs version 1.3.1+git276-g3485bbe43+dfsg-1. There playing from the very same ampache server works. So I went and checked the differences:
Debian links against QT4, while Gentoo links against QT5.
Debian has all available plugins compiled in, Gentoo (selectively) very few.
The root of the problem becomes clear from the ampache log file:
Gentoo (not working): 192.168.10.148 - - [10/Jun/2018:15:49:45 +0200] "GET /rest/getCoverArt.view?id=300008256 HTTP/1.1" 200 4353 "-" "Clementine 1.3.1" 192.168.10.148 - - [10/Jun/2018:15:49:45 +0200] "GET /rest/stream.view?v=1.8.0&c=Clementine&u=NNN&p=enc:PPP&id=17.225.195.64 HTTP/1.1" 200 4100 "-" "Clementine 1.3.1"
Debian (working): 192.168.10.187 - - [10/Jun/2018:15:50:45 +0200] "GET /play/index.php?ssid=ffff&type=song&oid=8256&uid=2&client=Clementine&noscrobble=1&player=api&name=Title.mp3 HTTP/1.1" 200 3942578 "-" "Clementine 1.3.1" 192.168.10.148 - - [10/Jun/2018:15:50:45 +0200] "GET /rest/stream.view?v=1.8.0&c=Clementine&u=NNN&p=enc:PPP&id=300008256 HTTP/1.1" 200 653352 "-" "Clementine 1.3.1"
(The order of the two log entries is inversed because ampache's rest api proxies the request to its player api, which then is the first to terminate and to log the request.)
So the difference is the "id" parameter in the request URI, which is wrong in the Gentoo build (id=17.225.195.64) but correct in the Debian build (id=300008256).
Strange thing is that the id is still correct in the preceding GET for the coverArt ...
The issue behind the wrong id seems to be a number conversion (inet_ntoa or similar) performed on it that should not take place: 17.225.195.64 = 0x11.0xE1.0xC3.0x40, and 0x11E1C340 = 300008256 !!! So something is taking the decimal 300008256 and converting it to an IP address ...
Attempting to download the file from the two URIs results in a 0 byte file with the wrong id, which can also be seen in the debugging output from gstreamer:
export GST_DEBUG=2,audio:5,stream:5,decode:5,typefind:8,soup:5,filesrc:8,uri*:8 clementine --verbose [...] 0:15:26.089065922 7436 0x7faa6c003d80 DEBUG souphttpsrc gstsouphttpsrc.c:1722:gst_soup_http_src_start:
Content-type text/html and size 0 is the same result that wget gives with the wrong id in the URI.