Bug in wget? (or perhaps DFU???)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Sun Jul 16, 2017 15:54    Post subject: Bug in wget? (or perhaps DFU???) Reply with quote
I think there is a bug in wget or, perhaps, I don't really understand how it works... (I'm leaning towards the latter).

I've got an install script for my YAMon tool that downloads all of the files to the users' router. The script uses `curl` if it is available but since many DD-WRT variants do not, it falls back to `wget`. I've gotten reports from several of my `wget` users about incomplete downloads. After updating my TPLink Archer C9 (v1) firmware to DD-WRT v3.0-r32597 std (07/08/17), I can now replicate the issue myself (hooray!).

If I make the following call to get a local copy of a 101KB HTML file:
Code:
wget -q -O /tmp/101.html -T 100 http://usage-monitoring.com/current/101.html

I get just the first 37KB of the file and if I repeat the call, there is no difference... the file size remains at 37KB (no matter how many times I repeat it).

If I change the first option to `-cq`,
Code:
wget -cq -O /tmp/101.html -T 100 http://usage-monitoring.com/current/101.html

The file size is 37KB after the first call
It increases to 74KB after the second and 101KB after the 3rd.
After the 4th call, I get the following error:
wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable
(and that repeats as long as the file exists)

The `-c` option continues the download (as expected per the documentation) but why is it necessary at all - i.e., why doesn't the first wget call download the entire file?!? Is there a bug in wget or it is just a flaky server at one end of the connection?

TIA for your thoughts and input.

Al
Sponsor
EA6500v1
DD-WRT User


Joined: 06 Feb 2016
Posts: 50
Location: /etc

PostPosted: Sun Jul 16, 2017 16:22    Post subject: Re: Bug in wget? (or perhaps DFU???) Reply with quote
al_c wrote:
I think there is a bug in wget or, perhaps, I don't really understand how it works... (I'm leaning towards the latter).

I've got an install script for my YAMon tool that downloads all of the files to the users' router. The script uses `curl` if it is available but since many DD-WRT variants do not, it falls back to `wget`. I've gotten reports from several of my `wget` users about incomplete downloads. After updating my TPLink Archer C9 (v1) firmware to DD-WRT v3.0-r32597 std (07/08/17), I can now replicate the issue myself (hooray!).

If I make the following call to get a local copy of a 101KB HTML file:
Code:
wget -q -O /tmp/101.html -T 100 http://usage-monitoring.com/current/101.html

I get just the first 37KB of the file and if I repeat the call, there is no difference... the file size remains at 37KB (no matter how many times I repeat it).

If I change the first option to `-cq`,
Code:
wget -cq -O /tmp/101.html -T 100 http://usage-monitoring.com/current/101.html

The file size is 37KB after the first call
It increases to 74KB after the second and 101KB after the 3rd.
After the 4th call, I get the following error:
wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable
(and that repeats as long as the file exists)

The `-c` option continues the download (as expected per the documentation) but why is it necessary at all - i.e., why doesn't the first wget call download the entire file?!? Is there a bug in wget or it is just a flaky server at one end of the connection?

TIA for your thoughts and input.

Al


https://bugs.busybox.net/show_bug.cgi?id=9591

BusyBox 1.26.2 in the firmware you are currently using has that bug. The commit to fix that (https://git.busybox.net/busybox/commit/?id=a6f8651911716d1d1624712eb19e4f3608767c7) was done the day after 1.26.2 was released and should be fixed in the latest version of BB 1.27.0 that was released less than two weeks ago.
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Sun Jul 16, 2017 16:33    Post subject: Re: Bug in wget? (or perhaps DFU???) Reply with quote
EA6500v1 wrote:
al_c wrote:
I think there is a bug in wget or, perhaps, I don't really understand how it works... (I'm leaning towards the latter).

I've got an install script for my YAMon tool that downloads all of the files to the users' router. The script uses `curl` if it is available but since many DD-WRT variants do not, it falls back to `wget`. I've gotten reports from several of my `wget` users about incomplete downloads. After updating my TPLink Archer C9 (v1) firmware to DD-WRT v3.0-r32597 std (07/08/17), I can now replicate the issue myself (hooray!).

If I make the following call to get a local copy of a 101KB HTML file:
Code:
wget -q -O /tmp/101.html -T 100 http://usage-monitoring.com/current/101.html

I get just the first 37KB of the file and if I repeat the call, there is no difference... the file size remains at 37KB (no matter how many times I repeat it).

If I change the first option to `-cq`,
Code:
wget -cq -O /tmp/101.html -T 100 http://usage-monitoring.com/current/101.html

The file size is 37KB after the first call
It increases to 74KB after the second and 101KB after the 3rd.
After the 4th call, I get the following error:
wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable
(and that repeats as long as the file exists)

The `-c` option continues the download (as expected per the documentation) but why is it necessary at all - i.e., why doesn't the first wget call download the entire file?!? Is there a bug in wget or it is just a flaky server at one end of the connection?

TIA for your thoughts and input.

Al


https://bugs.busybox.net/show_bug.cgi?id=9591

BusyBox 1.26.2 in the firmware you are currently using has that bug. The commit to fix that (https://git.busybox.net/busybox/commit/?id=a6f8651911716d1d1624712eb19e4f3608767c7) was done the day after 1.26.2 was released and should be fixed in the latest version of BB 1.27.0 that was released less than two weeks ago.


THX - that was fast!

The final comment in the bug report says
"commit a6f8651911716d1d1624712eb19e4f3608767c7e which fixes this will be backported to 1.26.x...

Hopefully that means we won't have to wait for BB 1.27.0 in DD-WRT.

Al
EA6500v1
DD-WRT User


Joined: 06 Feb 2016
Posts: 50
Location: /etc

PostPosted: Sun Jul 16, 2017 16:52    Post subject: Reply with quote
I missed that! It was backported to the 1.26.x branch a couple of days later (https://git.busybox.net/busybox/log/networking/wget.c?h=1_26_stable)

I've opened a ticket here (http://svn.dd-wrt.com/ticket/5890)

edit: bb was updated actually. I missed that too. (http://svn.dd-wrt.com/changeset/32633) Embarassed
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1415

PostPosted: Mon Jul 17, 2017 1:59    Post subject: Reply with quote
Very Happy Yeah!! I can not wait for the updated busybox to appear in the firmware.

I would not worry about missing things... I am behind on reading the commit log
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum