Bug 1496778 - dnf cannot download package with http code 302
Summary: dnf cannot download package with http code 302
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: librepo
Version: 29
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jaroslav Mracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-28 11:57 UTC by robberphex
Modified: 2020-02-28 02:55 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-25 12:52:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description robberphex 2017-09-28 11:57:37 UTC
Description of problem:

when download link of rpm package is 302, dnf refuse to download it.

Version-Release number of selected component (if applicable):

python3-dnf-plugins-core-2.1.3-2.fc27.noarch
python3-dnf-plugin-system-upgrade-2.0.2-1.fc27.noarch
dnf-yum-2.6.3-12.fc27.noarch
libdnf-0.9.3-7.fc27.x86_64
python3-dnf-2.6.3-12.fc27.noarch
python3-dnf-plugins-extras-common-2.0.2-1.fc27.noarch
dnf-2.6.3-12.fc27.noarch
dnf-plugins-core-2.1.3-2.fc27.noarch
dnf-conf-2.6.3-12.fc27.noarch
rpm-4.14.0-0.rc1.1.fc27.x86_64

How reproducible:

enable fedora-cisco-openh264.repo, and run `dnf upgrade mozilla-openh264` or reinstall mozilla-openh264.

Steps to Reproduce:
1. enable fedora-cisco-openh264.repo
2. run `dnf upgrade mozilla-openh264`
3. dnf failed.

Actual results:

Total download size: 743 k
Downloading Packages:
[MIRROR] mozilla-openh264-1.6.0-5.fc27.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 364 but expected size is: 372982           
[FAILED] mozilla-openh264-1.6.0-5.fc27.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success 

Expected results:

upgrade successful.

Additional info:

$ curl -iL codecs.fedoraproject.org:80/openh264/27/x86_64/m/mozilla-openh264-1.6.0-5.fc27.x86_64.rpm

HTTP/1.1 302 Found
Date: Thu, 28 Sep 2017 11:56:22 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux)
Location: https://codecs.fedoraproject.org/openh264/27/x86_64/m/mozilla-openh264-1.6.0-5.fc27.x86_64.rpm
Content-Length: 385
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Keep-Alive: timeout=15

HTTP/1.1 302 Found
Date: Thu, 28 Sep 2017 11:56:24 GMT
Server: Apache/2.4.6 (CentOS)
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
Location: http://ciscobinary.openh264.org/mozilla-openh264-1.6.0-5.fc27.x86_64.rpm
Content-Length: 346
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Content-Length: 372982
Accept-Ranges: bytes
Last-Modified: Wed, 23 Aug 2017 22:05:13 GMT
ETag: f76f7d736d02cf57d2f9b97324e6e599
X-Timestamp: 1503525912.63970
Content-Type: application/x-redhat-package-manager
X-Trans-Id: txd05a9a88bcf54b4f8ae87-0059cce369dfw1
Cache-Control: public, max-age=259162
Expires: Sun, 01 Oct 2017 11:55:47 GMT
Date: Thu, 28 Sep 2017 11:56:25 GMT
Connection: keep-alive
Keep-Alive: timeout=15

............

Comment 1 Richard D Alloway 2018-04-05 20:20:05 UTC
I tried to replicate the bug submitted in this report and was unable to do so using the current F27 packages:

$ rpm -qa | egrep -i 'dnf|^rpm-4' | sort
dnf-2.7.5-2.fc27.noarch
dnf-conf-2.7.5-2.fc27.noarch
dnf-plugins-core-2.1.5-1.fc27.noarch
dnf-yum-2.7.5-2.fc27.noarch
libdnf-0.11.0-1.fc27.x86_64
python2-dnf-2.7.5-2.fc27.noarch
python3-dnf-2.7.5-2.fc27.noarch
python3-dnf-plugins-core-2.1.5-1.fc27.noarch
rpm-4.14.0-2.fc27.x86_64
  
The versions of the reported components appear to be from a rawhide nightly build since F27 released with dnf-2.7.3-1.fc27.

To confirm that this is no longer a problem, I also tried to replicate the bug in F28 beta, but the bug was not present there, either.

$ rpm -qa | egrep -i 'dnf|^rpm-4' | sort
dnf-2.7.5-8.fc28.noarch
dnf-conf-2.7.5-8.fc28.noarch
dnf-plugins-core-2.1.5-4.fc28.noarch
dnf-yum-2.7.5-8.fc28.noarch
libdnf-0.11.1-3.fc28.x86_64
python3-dnf-2.7.5-8.fc28.noarch
python3-dnf-plugins-core-2.1.5-4.fc28.noarch
rpm-4.14.1-7.fc28.x86_64

If you are still able to reproduce this bug in a full release version of Fedora, please update the ticket with the exact release and confirm the steps to replicate the bug.

Thanks!

-Rich Alloway (Rogue Wave)

Comment 2 robberphex 2018-10-01 16:39:57 UTC
Sorry for long delay.

Fedora 29 still have this problem.
$ rpm -qa | egrep -i 'dnf|^rpm-4' | sort
dnf-3.6.1-1.fc29.noarch
dnf-data-3.6.1-1.fc29.noarch
dnf-plugins-core-3.0.4-1.fc29.noarch
dnf-yum-4.0.3.6.1-1.fc29.noarch
libdnf-0.20.0-1.fc29.x86_64
python3-dnf-3.6.1-1.fc29.noarch
python3-dnf-plugins-core-3.0.4-1.fc29.noarch
python3-dnf-plugins-extras-common-3.0.2-1.fc29.noarch
python3-dnf-plugin-system-upgrade-3.0.2-1.fc29.noarch
python3-libdnf-0.20.0-1.fc29.x86_64
rpm-4.14.2-1.fc29.x86_64

# dnf install mozilla-openh264
......
Install  2 Packages

Total download size: 767 k
Installed size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
[MIRROR] mozilla-openh264-1.7.0-6.fc29.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 347 but expected size is: 395220           
[MIRROR] openh264-1.7.0-6.fc29.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 339 but expected size is: 389960                   
[FAILED] mozilla-openh264-1.7.0-6.fc29.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success                                   
(2/2): openh264-1.7.0-6.fc29.x86_64.rpm                     50% [=============================-                             ] 1.2 GB/s | 386 kB     00:00 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Error downloading packages:
  Cannot download m/mozilla-openh264-1.7.0-6.fc29.x86_64.rpm: All mirrors were tried


And, the wrong content length is from:

$ curl -XGET -I 'https://codecs.fedoraproject.org/openh264/29/x86_64/m/mozilla-openh264-1.7.0-6.fc29.x86_64.rpm'
HTTP/2 302 
date: Mon, 01 Oct 2018 16:39:01 GMT
server: Apache/2.4.34 (Fedora)
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
referrer-policy: same-origin
location: http://ciscobinary.openh264.org/mozilla-openh264-1.7.0-6.fc29.x86_64.rpm
content-length: **347**
content-type: text/html; charset=iso-8859-1

Comment 3 Richard D Alloway 2018-10-02 15:01:06 UTC
robberphex,

How are you installing F29?  I just downloaded the latest vagrant image for F29 and dnf is still version 3.5.1, not 3.6.1:

$ rpm -qa | egrep -i 'dnf|^rpm-4' | sort
dnf-3.5.1-1.fc29.noarch
dnf-data-3.5.1-1.fc29.noarch
dnf-plugins-core-3.0.3-1.fc29.noarch
dnf-yum-4.0.3.5.1-1.fc29.noarch
libdnf-0.19.1-3.fc29.x86_64
python3-dnf-3.5.1-1.fc29.noarch
python3-dnf-plugins-core-3.0.3-1.fc29.noarch
python3-libdnf-0.19.1-3.fc29.x86_64
rpm-4.14.2-1.fc29.x86_64

Checking what is available through 'dnf check-update' and 'dnf --showduplicates info dnf' shows that 3.5.1-1 is the currently available release of dnf for F29.

The 'dnf install mozilla-openh264' works just fine for me:

$ dnf install mozilla-openh264
Last metadata expiration check: 0:01:01 ago on Tue 02 Oct 2018 02:56:58 PM UTC.
Dependencies resolved.
================================================================================
 Package               Arch      Version         Repository                Size
================================================================================
Installing:
 mozilla-openh264      x86_64    1.7.0-6.fc29    fedora-cisco-openh264    386 k
Installing dependencies:
 openh264              x86_64    1.7.0-6.fc29    fedora-cisco-openh264    381 k
 mozilla-filesystem    x86_64    1.9-19.fc29     fedora                   8.1 k

Transaction Summary
================================================================================
Install  3 Packages

Total download size: 775 k
Installed size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): mozilla-filesystem-1.9-19.fc29.x86_64.rp  35 kB/s | 8.1 kB     00:00    
(2/3): mozilla-openh264-1.7.0-6.fc29.x86_64.rpm 333 kB/s | 386 kB     00:01    
(3/3): openh264-1.7.0-6.fc29.x86_64.rpm         178 kB/s | 381 kB     00:02    
--------------------------------------------------------------------------------
Total                                           307 kB/s | 775 kB     00:02     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : mozilla-filesystem-1.9-19.fc29.x86_64                  1/3 
  Installing       : openh264-1.7.0-6.fc29.x86_64                           2/3 
  Running scriptlet: openh264-1.7.0-6.fc29.x86_64                           2/3 
  Installing       : mozilla-openh264-1.7.0-6.fc29.x86_64                   3/3 
  Running scriptlet: mozilla-openh264-1.7.0-6.fc29.x86_64                   3/3 
  Verifying        : mozilla-openh264-1.7.0-6.fc29.x86_64                   1/3 
  Verifying        : openh264-1.7.0-6.fc29.x86_64                           2/3 
  Verifying        : mozilla-filesystem-1.9-19.fc29.x86_64                  3/3 

Installed:
  mozilla-openh264-1.7.0-6.fc29.x86_64        openh264-1.7.0-6.fc29.x86_64      
  mozilla-filesystem-1.9-19.fc29.x86_64      

Complete!



Please share how you are obtaining Fedora, how you are updating it, etc so we can replicate your issue.

Thanks!

-Rich Alloway (Rogue Wave)

Comment 4 robberphex 2018-10-13 12:07:06 UTC
With http_proxy=http://127.0.0.1:8008/ and https_proxy=http://127.0.0.1:8008/,

dnf send request to proxy server:

CONNECT codecs.fedoraproject.org:443 HTTP/1.1
Host: codecs.fedoraproject.org:443
User-Agent: libdnf
Proxy-Connection: Keep-Alive

and, proxy server return:

HTTP/1.1 200 Tunnel established

(captured by wireshark)
then,
error reported:

[MIRROR] openh264-1.7.0-6.fc29.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 339 but expected size is: 389960                   
[FAILED] openh264-1.7.0-6.fc29.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success                                           
(2/2): mozilla-openh264-1.7.0-6.fc29.x86_64.rpm             49% [=============================                              ] 771 MB/s | 381 kB     00:00 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Error downloading packages:
  Cannot download o/openh264-1.7.0-6.fc29.x86_64.rpm: All mirrors were tried


I guess, it's because that 200 returned by proxy server was thoutht as http resonpse, and content-length is not matched with metadata.

Comment 5 Richard D Alloway 2018-10-15 19:24:26 UTC
Sorry, robberphex, I don't think my question came across clearly.

What I need to know is how you are installing the Fedora OS in the first place, not just the codec packages.

Both times when I've tried to replicate your issue, the package versions that you report having installed do not match the version which are available with the version of Fedora you are running.  

This means that you are likely running a version of Fedora which is not a typical release (perhaps a nightly build?) so I am unable to duplicate the problem that you're experiencing.

If you could provide a list of all of the steps, from initially installing Fedora to attempting to install the codec packages, which lead to this issue, I'd be happy to look into the problem.

Thanks!

-Rich Alloway (Rogue Wave)

Comment 6 Jaroslav Mracek 2019-07-25 12:52:08 UTC
I suggest two problems - sole left over fragments of packages on the disk. Please try "sudo dnf clean all", or instability of network. The issue should be eliminated by https://github.com/rpm-software-management/librepo/pull/158.

Anyway without additional data how to reproduce the issue we cannot do much.


Note You need to log in before you can comment on or make changes to this bug.