LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Wget times out until i ping the host or click on link to file in firefox (http://www.linuxquestions.org/questions/linux-networking-3/wget-times-out-until-i-ping-the-host-or-click-on-link-to-file-in-firefox-688416/)

10110111 12-04-2008 08:24 PM

Wget times out until i ping the host or click on link to file in firefox
 
I try to download some file with wget, but it always times out. But, if i then ping the host where file is or click on the link to this file in firefox (not doing anything in firefox after that), wget then downloads the file. Before time out wget waits very much time. This is how it looks like (i had to Ctrl+C when wget started to wait):

Code:

$ wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.0.tar.gz
--2008-12-05 04:34:52--  http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.0.tar.gz
Resolving libtorrent.rakshasa.no... 1.0.0.0
Connecting to libtorrent.rakshasa.no|1.0.0.0|:80...
$ ping libtorrent.rakshasa.no -c 1
PING libtorrent.rakshasa.no (66.220.1.220): 56 data bytes
64 bytes from 66.220.1.220: icmp_seq=0 ttl=56 time=217.885 ms
--- libtorrent.rakshasa.no ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 217.885/217.885/217.885/0.000 ms
$ wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.0.tar.gz
--2008-12-05 04:35:00--  http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.0.tar.gz
Resolving libtorrent.rakshasa.no... 66.220.1.220
Connecting to libtorrent.rakshasa.no|66.220.1.220|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 502896 (491K) [application/x-gzip]
Saving to: `rtorrent-0.8.0.tar.gz'

100%[==========...=========>] 502,896      249K/s  in 2.0s

2008-12-05 04:35:02 (249 KB/s) - `rtorrent-0.8.0.tar.gz' saved [502896/502896]

I have no firewalls, nothing like this. Some days ago everything worked perfectly, but from some time it started to work this way.
Why could this be so? How can i make wget work properly? (Of course, without having to make some script like "ping -c 1 $@; wget $@")

archtoad6 12-07-2008 06:46 AM

Works fine for me:
Code:

$ wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.0.tar.gz
--06:14:22--  http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.0.tar.gz
          => `rtorrent-0.8.0.tar.gz'
Resolving libtorrent.rakshasa.no... 66.220.1.220
Connecting to libtorrent.rakshasa.no|66.220.1.220|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 502,896 (491K) [application/x-gzip]

100%[======== ... =======>] 502,896      113.59K/s    ETA 00:00

06:14:30 (71.95 KB/s) - `rtorrent-0.8.0.tar.gz' saved [502896/502896]

What has changed, including w/ your ISP, since it worked for you?


Notice the subtle differences between our outputs, what ver. of wget are you using?
Code:

$ wget -V
GNU Wget 1.10.2

Copyright (C) 2005 Free Software Foundation, Inc.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Originally written by Hrvoje Niksic <hniksic@xemacs.org>.

What about your distro, desktop, kernel, etc.?


BTW, you shouldn't use "Quote:" blocks (i.e. [QUOTE] tags) for code & command line output, that's what "Code:" blocks are for. Your links won't get abbreviated & the monospace font alignment will be preserved.

However your lines won't get folded so you should manually fold or abbreviate ones that are more than 80-90 columns -- see my line beginning "100%[=".

It would be nice, quite polite, if you would edit your post to fix these, esp. the line folding -- I can't easily read your post because it triggers horizontal scrolling in my browser.

10110111 12-07-2008 07:46 AM

Quote:

Works fine for me:
Yes, i know it should work. It works for me too, but only after i ping that host...

Quote:

What has changed, including w/ your ISP, since it worked for you?
I don't remember it very well, but it seems that i changed ISP just when the problems started.

Quote:

Notice the subtle differences between our outputs, what ver. of wget are you using?
I was using wget 1.10.2 when the problem started, and then tried to update to newer version, so the output is from wget-1.11.4. Anyway, updating didn't resolve the problem.

BTW, time out appears not only in wget, but also in other console programs like lynx and python easy_install, though everything is ok in firefox.

Quote:

What about your distro, desktop, kernel, etc.?
distro: LFS 6.3, desktop: KDE 3.5.9, kernel 2.6.22.5

archtoad6 12-08-2008 06:44 AM

Barring an LFS problem, I think your prime suspect is your new ISP. You mention problems in lynx & Python easy_install, what about w/ Konqueror, Opera, cURL, & your ftp client?

I hate to to give this advice, because I have RTF wget M, & I know what a pain that one can be -- it's my 1st nominee for the "Man Page Is Too Long" award. OTOH, since you've done LFS, the wget man page shouldn't be too difficult. :) So go "RTF" wget man page for how to change the user agent string, possibly your new ISP is using it to discriminate between browsing programs. It's the only explanation I can think of for some "browsers" working & some not.

HTH, & please report your results -- this is interesting & I'd like to know the answer.

10110111 12-09-2008 08:40 AM

FTP client (ftp (GNU inetutils) 1.5) works normally, Konqueror also without problems. Lynx now works, too (although i didn't change anything)... But wget has the same problem. I tried 'wget -U "" prot://address/filename', 'wget -U "Firefox/2.0.0.14" ... ', it doesn't change anything, so problem is not in user agent.

archtoad6 12-09-2008 08:58 AM

I think your choices are writing the script, asking tech support @ your ISP (good luck w/ that), or using something like wireshark to capture packets & compare a FF successful connection to a wget failure.

rweaver 12-09-2008 02:38 PM

Check your DNS settings, if you have several dns server entries make sure they're all valid functional dns servers.

10110111 12-10-2008 07:49 AM

Solved
 
Today, my network (DNS in particular) was totally unusable... router replied to my pings, but google didn't. I tried to set ISP's DNS server address directly in resolv.conf in place of my ADSL router's address, and now the problem seems to have disappeared.
So, i think the real reason of all the troubles was not ISP, but my router.
Thank you all for your help.


All times are GMT -5. The time now is 12:42 AM.