Re: Issue 211 in thelastripper: No Connection: System. Net. WebException: Error getting response stream

11 views
Skip to first unread message

codesite...@google.com

unread,
Jun 12, 2010, 12:18:26 PM6/12/10
to thelastrip...@googlegroups.com

Comment #6 on issue 211 by mcmanuel4: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

just to share my knowledge about this problem - I was able to track it down
to the following reason:

When thelastripper starts downloading the mp3 from the url which is given
in the xspf playlist, last.fm replies with HTTP 304 Redirect and the actual
location of the mp3 file. The download URL is similar to
http://s13.last.fm/user/1XXXXXX4/7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXf/1XXXXXX6/0XXXXXX7/bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8/1XXXXXX2/13/6XXXXXX0//1/0/128.mp3

Place your attention to the double slash "//" near the end of the URL. But
the Mono Framework (especially the method System.System.Uri::Reduce) will
replace the double slash "//" by a single slash "/". So the last.fm server
immediately closes the HTTP connection (which violates the HTTP specs) and
the HttpWebRequest class runs out of data, which results in the exception
above.

In Windows, everything works fine, so I guess, the MS .net framework does
preserve the double slash.

If you compile mono yourself, a quick and dirty workaround is to replace
the following line (line 1660 of version 2.6.4) in
mcs/class/System/System/Uri.cs (method Reduce):

if (current.Length == 0 || current == "." )

by

if ((current.Length == 0 && endpos<=2) || current == "." )


hope this helps to clarify things...

manu


codesite...@google.com

unread,
Jun 12, 2010, 4:48:33 PM6/12/10
to thelastrip...@googlegroups.com

Comment #7 on issue 211 by hankschwie: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Hi!

Thanks for that hint!
I tried to compile mono with your additon; unfortunately something seems
to be missing. When I try to start thelastripper, this appears:

** (/usr/local/lib/thelastripper/TheLastRipper.exe:4127): WARNING **: The
following assembly referenced from
/usr/local/lib/thelastripper/TheLastRipper.exe could not be loaded:
Assembly: gtk-sharp (assemblyref_index=2)
Version: 2.12.0.0
Public Key: 35e10195dab3c99f
The assembly was not found in the Global Assembly Cache, a path listed in
the MONO_PATH environment variable, or in the location of the executing
assembly (/usr/local/lib/thelastripper/).


** (/usr/local/lib/thelastripper/TheLastRipper.exe:4127): WARNING **: Could
not load file or assembly 'gtk-sharp, Version=2.12.0.0, Culture=neutral,
PublicKeyToken=35e10195dab3c99f' or one of its dependencies.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file
or assembly 'gtk-sharp, Version=2.12.0.0, Culture=neutral,
PublicKeyToken=35e10195dab3c99f' or one of its dependencies.
File name: 'gtk-sharp, Version=2.12.0.0, Culture=neutral,
PublicKeyToken=35e10195dab3c99f'

However, gtk-sharp2 is installed, and libgtk2.0-cli and libgtk2.0-cli-dev
as well. Appearantly there is some PATH environment variable missing...

so long


codesite...@google.com

unread,
Jun 18, 2010, 11:40:55 AM6/18/10
to thelastrip...@googlegroups.com

Comment #8 on issue 211 by hankschwie: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Hi!

I finally made it: After compiling gtk-sharp-2.10.12 and
taglib-sharp_2.0.3.7+dfsg-1 p (in ubuntu apparantly called liptag-sharp) in
addition to mono-2.6.4 ThelastRipper is working again!

Thanks!


codesite...@google.com

unread,
Jun 20, 2010, 8:15:08 AM6/20/10
to thelastrip...@googlegroups.com

Comment #9 on issue 211 by valter.bcc: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Hi, hankschwie, i'm having this same problem, can you tell me how do you
compile mono, gtk and taglib ?
I'm using fedora 12, before thelastripper works fine, but now it crash like
yours:

System.Net.WebException: Error getting response stream (ReadDone2):
ReceiveFailure ---> System.Exception: at
System.Net.WebConnection.HandleError(WebExceptionStatus st,
System.Exception e, System.String where)
at System.Net.WebConnection.ReadDone(IAsyncResult result)
at System.Net.Sockets.Socket+SocketAsyncResult.Complete()
at System.Net.Sockets.Socket+Worker.Receive()
at System.Net.WebConnection.HandleError (WebExceptionStatus st,
System.Exception e, System.String where) [0x00000]
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
[0x00000]
at System.Net.HttpWebRequest.GetResponse () [0x00000]
at LibLastRip.LastManager.StartRecording (Boolean newStation) [0x00000]

codesite...@google.com

unread,
Jun 23, 2010, 2:39:17 PM6/23/10
to thelastrip...@googlegroups.com

Comment #10 on issue 211 by TheRealCaffeine: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Happening here too.

Error reads: System.Net.WebException: Error getting response stream

(ReadDone2): ReceiveFailure ---> System.Exception: at
System.Net.WebConnection.HandleError(WebExceptionStatus st,
System.Exception e, System.String where)
at System.Net.WebConnection.ReadDone(IAsyncResult result)
at System.Net.Sockets.Socket+SocketAsyncResult.Complete()
at System.Net.Sockets.Socket+Worker.Receive()
at System.Net.WebConnection.HandleError (WebExceptionStatus st,
System.Exception e, System.String where) [0x00000]
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
[0x00000]
at System.Net.HttpWebRequest.GetResponse () [0x00000]
at LibLastRip.LastManager.StartRecording (Boolean newStation) [0x00000]

I'm on Ubuntu Lucid Lynx.

The terminal output looks like so:

user@machine: thelastripper
LastManager.ParseHandshake() Unknown key: info_message Value:
LastManager.ParseHandshake() Unknown key: fingerprint_upload_url Value:
http://ws.audioscrobbler.com/fingerprint/upload.php
LastManager.ParseHandshake() Unknown key: permit_bootstrap Value: 0
LastManager.ParseHandshake() Unknown key: freetrial Value: 0
get 'Let Go' (Garden State) from 'Frou Frou'

Has anyone made a patch for mono?

codesite...@google.com

unread,
Jul 15, 2010, 12:40:39 PM7/15/10
to thelastrip...@googlegroups.com

Comment #11 on issue 211 by sensemaker20075: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

same here on a Vista (Home edition) mashine (with all the latest security
updates and Service packages) since many weeks:
-----------------------
Exception occured. Please restart ripping.
Exception:
System.InvalidOperationException: You have to call the Bind-Method before
you start this process.
at system.net.sockets.socket.dobeginaccept(Socket acceptSocket, Int32
recieveSize, AcceptOverlappedAsyncResult asyncResult)
at system.net.sockets.socket.beginaccept(Socket acceptSocket, Int32
receiveSize, AsyncCallback callback, Object state)
at system.net.sockets.socket.beginaccept(AsyncCallback callback, object
state)
at LibLastRip.LastManager.listen()
at LibLastRip.Lastmanager.Save(Int32 read)
at LibLastRip.LastManager.Save(IAsyncResult Res)
--------------------------

What to do ? I get such messages same on a Win XP Professional (with latest
SP3 and Security updates) and an elder Win98 SE mashine which worked very
propper for long time.

I do not understand any word what you write here about compiling, patching
for mono etc. ... hope here is somebody who can help out for a total newbee
in software programming :-)

Shall I do same as mcmanuel4 described in his posting on 12th June ? -
Thank's giving quick reply already now. :-)

codesite...@google.com

unread,
Jul 20, 2010, 12:37:45 PM7/20/10
to thelastrip...@googlegroups.com

Comment #12 on issue 211 by matt.sarsby: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

The same issue found on
Linux 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:22:14 UTC 2010 i686
GNU/Linux
with version
1.4.0+dfsg-2


codesite...@google.com

unread,
Jul 27, 2010, 11:22:38 AM7/27/10
to thelastrip...@googlegroups.com

Comment #13 on issue 211 by valter.bcc: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

I use this program in my windows 7 , is a very good program, but when i
stop the music my computer became slow.. weird.

codesite...@google.com

unread,
Aug 9, 2010, 8:07:59 PM8/9/10
to thelastrip...@googlegroups.com
Updates:
Status: Accepted
Owner: jopsen
Labels: Type-Defect Priority-Critical

Comment #14 on issue 211 by jopsen: No Connection: System. Net.

WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

In TheLastRipper this problem occurs at line 370 in LastManager.Stream.cs
I've tried to find a workaround, but it doesn't seem possible... No matter
how I create the System.Uri instance, Reduce() is called...
And no matter how I try to make an HTTP request using HttpWebRequest it
needs an instance of System.Uri.

I suppose one could try to using reflection to access the private fields of
Uri, but I don't know if that will work... And it would certainly a really
nasty hack, just waiting to become a bug...

So unless anybody else has a proposal for a workaround, I think we should
solve this issue in mono.

My attempt to a work around:
System.IO.Stream RadioStream = null;
string uri = this.StreamURL;
while(RadioStream == null){
HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create(uri);
wReq.AllowAutoRedirect = false;
HttpWebResponse hRes = (HttpWebResponse)wReq.GetResponse();
if(hRes.StatusCode == HttpStatusCode.Redirect || hRes.StatusCode ==
HttpStatusCode.Moved){
uri = "http://" +
hRes.Headers["Location"].Replace("http://","").Replace("//", "/%2F");
Console.WriteLine(uri);
}else
RadioStream = hRes.GetResponseStream();
}

I'm happy to see that we have so many active users :)
And sad to realize how slow I am to reply :(

Also there's a bug report in mono regarding this:
https://bugzilla.novell.com/show_bug.cgi?id=506734
I'm pretty sure it's the same issue...

By the way, I've posted some code for testing System.Uri to the mono
bugreport above... If any competent Windows users would, who experience
problems with TheLastRippper, would test if they have the same problem with
System.Uri that would be great...

codesite...@google.com

unread,
Aug 9, 2010, 8:26:34 PM8/9/10
to thelastrip...@googlegroups.com

Comment #15 on issue 211 by jopsen: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Can affected Windows users please download the attached program and run it
in a terminal... Then post the exact output here!

Specifically I want to know if it writes:
"Two slashes before bug please: http://a.little-really-an.no/ing/bug.htm"
or:
"Two slashes before bug please: http://a.little-really-an.no/ing//bug.htm"

My Windows VM, haven't been updated in ages, and writes two slashes
before "bug"... What does you're and/or are you experiencing this bug? (on
Windows)

It's important that we don't mix to issue together, if they are infact not
related.
Also, there might be a reflection based workaround (for older .Net
versions), available here (see the comments on the blog post):
http://grootveld.com/archives/21/url-encoded-slashes-in-systemuri

Maybe we can change it to work for mono...


Attachments:
Program.exe 3.5 KB

codesite...@google.com

unread,
Aug 13, 2010, 5:14:15 AM8/13/10
to thelastrip...@googlegroups.com

Comment #16 on issue 211 by jopsen: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Issue 225 has been merged into this issue.

codesite...@google.com

unread,
Aug 14, 2010, 3:16:11 AM8/14/10
to thelastrip...@googlegroups.com

Comment #17 on issue 211 by mick...@nurfuerspam.de: No Connection: System.
Net. WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211


It's not necessary to compile gtk-sharp, if it is already installed.
You can set MONO_PATH to the directory containing the dll
(/usr/lib/mono/gtk-sharp-2.0) on my system.

codesite...@google.com

unread,
Aug 15, 2010, 2:37:10 AM8/15/10
to thelastrip...@googlegroups.com

Comment #18 on issue 211 by kurzum: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

@jopsen


I ran it on a Windows Server 2008, it said:
"Two slashes before bug please: http://a.little-really-an.no/ing//bug.htm"

with the two slashes

codesite...@google.com

unread,
Aug 15, 2010, 5:22:37 AM8/15/10
to thelastrip...@googlegroups.com
Updates:
Labels: OpSys-Linux

Comment #19 on issue 211 by jopsen: No Connection: System. Net.

WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

@kurzum
Thanks, until some Windows user can make it write the url with only one
slash this is a linux/mono only bug.

Let me know if anybody finds anything else...

codesite...@google.com

unread,
Aug 21, 2010, 6:04:10 AM8/21/10
to thelastrip...@googlegroups.com

Comment #20 on issue 211 by jopsen: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

According to https://bugzilla.novell.com/show_bug.cgi?id=506734

This have been fixed in the mono 2.6 branch... I don't know when this will
be shipped, and/or when distros will start distributing it...

codesite...@google.com

unread,
Oct 9, 2010, 9:16:27 PM10/9/10
to thelastrip...@googlegroups.com

Comment #21 on issue 211 by stayun: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Ubuntu 10.04, kernel 2.6.32-25
Solved by following steps at mono bug forum post:

https://bugzilla.novell.com/show_bug.cgi?id=506734

and in that post under comment 11, I did as instructed:

Download that file and do the following (probably as root):
# tar -xzf system.tar.gz
# cd system2
# gacutil -i System.dll

I'm using Thelastripper 1.4.1. Mono 2.6.7-3ubuntu1~dhx1, gtk-sharp2
2.12.9-4, libtaglib2.0-cil 2.0.3.7+dsfg-1 .

patching Mono with system.dll resolved the problem "tuning in" to last.fm.
All that was left was to open the stream on port 8000. I use vlc, but I've
heard Banshee can stream from 127.0.0.1:8000 as well.

codesite...@google.com

unread,
Oct 10, 2010, 7:29:31 AM10/10/10
to thelastrip...@googlegroups.com

Comment #22 on issue 211 by luigi.papino: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Comment 21, work for me.
Very Thanks.

codesite...@google.com

unread,
Oct 19, 2010, 11:21:22 AM10/19/10
to thelastrip...@googlegroups.com

Comment #23 on issue 211 by atkin901: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Quick and dirty workaround still works. Context diff against 2.6.7 mono:

--- mcs/class/System/System/Uri.cs.org 2010-10-19 08:18:53.000000000 -0700
+++ mcs/class/System/System/Uri.cs 2010-10-19 08:19:07.000000000 -0700
@@ -1711,7 +1711,7 @@
if (endpos == -1) endpos = path.Length;
string current = path.Substring (startpos,
endpos-startpos);
startpos = endpos + 1;
- if (current.Length == 0 || current == "." )
+ if ((current.Length == 0 && endpos <= 2) ||
current == "." )
continue;

if (current == "..") {


codesite...@google.com

unread,
Dec 18, 2010, 3:01:25 AM12/18/10
to thelastrip...@googlegroups.com

Comment #24 on issue 211 by wwb244: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Quick and dirty workaround for Mac OS still not working. Do I need to do
the Mono Ubuntu fit (Comment 21)? If so how is that done?

MacOS 10.6.5
Mono: 2.6.7
Lastripper: TheLastRipper_1.4.0_beta

Can anyone confirm that is it working?


codesite...@google.com

unread,
Jan 10, 2011, 2:10:59 AM1/10/11
to thelastrip...@googlegroups.com

Comment #25 on issue 211 by sa...@amary.be: No Connection: System. Net.
WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

Works great with the stayun's fix !!! (Waiting for the official new mono
release...)

codesite...@google.com

unread,
Feb 18, 2011, 9:14:46 PM2/18/11
to thelastrip...@googlegroups.com

Comment #26 on issue 211 by Jenera...@gmail.com: No Connection: System.
Net. WebException: Error getting response stream
http://code.google.com/p/thelastripper/issues/detail?id=211

comment #21 worked, finally! Ubuntu 10.04

Reply all
Reply to author
Forward
0 new messages