RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1483524 - urlgrabber on RHEL 6 raises KeyboardInterrupt if no space left on device
Summary: urlgrabber on RHEL 6 raises KeyboardInterrupt if no space left on device
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-urlgrabber
Version: 6.10
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Valentina Mukhamedzhanova
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks: 1454310
TreeView+ depends on / blocked
 
Reported: 2017-08-21 10:52 UTC by Gennadii Altukhov
Modified: 2017-12-06 11:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-06 11:45:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gennadii Altukhov 2017-08-21 10:52:01 UTC
Description of problem:
If no space left on device urlgrabber raises a KeyboardInterrupt exception with no error message and print some traceback on stderr instead.

Version-Release number of selected component (if applicable):
python-urlgrabber-3.9.1-11.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1) create a lo device with 10 MB available:
# dd if=/dev/zero of=/disk bs=1M count=10
# losetup /dev/loop0 /disk
# mkfs.ext4 /dev/loop0

2) mount this dist to some directory, I'm using /var/satellite
# umount /var/satellite/
# mount /dev/loop0 /var/satellite/
# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   13G   25G  35% /
tmpfs           1,9G  4,0K  1,9G   1% /dev/shm
/dev/loop0      976M  1,3M  924M   1% /var/satellite


3) execute the script below:
from urlgrabber import grabber

grabber.urlgrab("https://download.fedoraproject.org/pub/fedora/linux/releases/26/Server/x86_64/iso/Fedora-Server-netinst-x86_64-26-1.5.iso", "/var/satellite/fedora.iso")

Actual results:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1107, in _retrieve
    self.fo.write(buf)
IOError: [Errno 28] No space left on device
Traceback (most recent call last):
  File "/tmp/url.py", line 4, in <module>
    grabber.urlgrab("https://download.fedoraproject.org/pub/fedora/linux/releases/26/Server/x86_64/iso/Fedora-Server-netinst-x86_64-26-1.5.iso", "/var/satellite/fedora.iso")
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 626, in urlgrab
    return default_grabber.urlgrab(url, filename, **kwargs)
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 994, in urlgrab
    return self._retry(opts, retryfunc, url, filename)
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 895, in _retry
    r = apply(func, (opts,) + args, {})
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 980, in retryfunc
    fo = PyCurlFileObject(url, filename, opts)
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1075, in __init__
    self._do_open()
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1378, in _do_open
    self._do_grab()
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1508, in _do_grab
    self._do_perform()
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1301, in _do_perform
    raise KeyboardInterrupt
KeyboardInterrupt


Expected results:
No error message "IOError: [Errno 28] No space left on device" printed on STDERR, a different type of an exception. 

Additional info:
On Fedora 25 this bug is fixed in version python-urlgrabber-3.10.1-9.fc25.noarch

Comment 2 Gennadii Altukhov 2017-08-21 11:00:27 UTC
As you can see above in the description there are two tracebacks. First of them is printed from within library directly on STDERR, the second one is from my script and it is OK. I'm complaining only about the first one of course.

Comment 3 toki 2017-09-30 15:23:42 UTC
The same exception is raised when a network interruption (send() or recv()) occurs.

I'm on python-urlgrabber-3.10-4.el7.noarch here.

In grabber.py

            elif errcode in (42, 55, 56):
                # this is probably wrong but ultimately this is what happens
                # we have a legit http code and a pycurl 'writer failed' code
                # which almost always means something aborted it from outside
                # since we cannot know what it is -I'm banking on it being
                # a ctrl-c. XXXX - if there's a way of going back two raises to
                # figure out what aborted the pycurl process FIXME
                raise KeyboardInterrupt

It is not probably wrong, it is definitely wrong.

Just below that, we have:

                             55 : _("Network error send()"),
                             56 : _("Network error recv()"),

Why not define a meaningful exception and raise that instead?

Cheers

Comment 4 toki 2017-09-30 15:25:17 UTC
Eh, I see it's fixed in later releases. So be it.

Comment 5 Jan Kurik 2017-12-06 11:45:02 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/


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