Bug 1007870 - can not handle redirection in URL?
Summary: can not handle redirection in URL?
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: librepo
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Mlcoch
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-13 13:22 UTC by Ales Kozumplik
Modified: 2014-09-30 23:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-16 09:52:45 UTC
Type: Bug


Attachments (Terms of Use)

Description Ales Kozumplik 2013-09-13 13:22:04 UTC
The following fails:

#! /usr/bin/python

import librepo
import time

MIRROR="""https://mirrors.fedoraproject.org/metalink?repo=updates-released-f19&arch=x86_64"""
DESTDIR="./"
URL="""https://bit.ly/18f4dpR"""

if __name__ == "__main__":
    h = librepo.Handle()
    h.destdir = DESTDIR
    h.interruptible = True
    h.repotype = librepo.LR_YUMREPO
    h.urls = [URL]
    h.yumdlist = ["primary", "filelists", "prestodelta", "group_gz"]
    # h.local = True
    h.perform(librepo.Result())
    print(h.urls)
    print(h.mirrors)

Comment 1 Ales Kozumplik 2013-09-13 13:22:53 UTC
I get:

Traceback (most recent call last):
  File "./main.py", line 20, in <module>
    h.perform(librepo.Result())
  File "/usr/lib64/python2.7/site-packages/librepo/__init__.py", line 916, in perform
    _librepo.Handle.perform(self, result)
librepo.LibrepoException: (19, 'Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried', 'Usable URL not found')

Comment 2 Zdeněk Pavlas 2013-09-16 09:52:45 UTC
What'd you expect?

[~]$ wget https://bit.ly/18f4dpR/repodata/repomd.xml
--2013-09-16 11:52:15--  https://bit.ly/18f4dpR/repodata/repomd.xml
Resolving bit.ly (bit.ly)... 69.58.188.40, 69.58.188.39
Connecting to bit.ly (bit.ly)|69.58.188.40|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://bitly.com/18f4dpR/repodata/repomd.xml [following]
--2013-09-16 11:52:16--  https://bitly.com/18f4dpR/repodata/repomd.xml
Resolving bitly.com (bitly.com)... 69.58.188.33, 69.58.188.34
Connecting to bitly.com (bitly.com)|69.58.188.33|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-09-16 11:52:16 ERROR 404: Not Found.

Comment 3 Tomas Mlcoch 2013-09-16 10:45:52 UTC
Tested on /etc/yum.repos.d/fedora-updates.repo:

[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
baseurl=http://bit.ly/1eFhQlB/pub/fedora/linux/updates/$releasever/$basearch/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch

(http://bit.ly/1eFhQlB points to http://download.fedoraproject.org)

$ yum update
...
http://bit.ly/1eFhQlB/pub/fedora/linux/updates/19/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
...

= Not a bug

Comment 4 Ales Kozumplik 2013-09-16 11:58:19 UTC
I see, you are right.

It's actually not possible to clone a git repo either using a generic shortening service:

$ git clone http://bit.ly/186v4AA
Cloning into '186v4AA'...
fatal: http://bit.ly/186v4AA/info/refs not valid: is this a git repository?


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