Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1427231

Summary: cdn-sync: better check disk space during downloading packages
Product: Red Hat Satellite 5 Reporter: Jan Dobes <jdobes>
Component: Satellite SynchronizationAssignee: Jan Dobes <jdobes>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Korbel <mkorbel>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: jhutar, mkorbel, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-91 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:11:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1340444    

Description Jan Dobes 2017-02-27 16:12:43 UTC
Description of problem:
If Satellite storage runs out of space during downloading packages, unhandled exception will occur.

...
13:36:50 6256/18457 : kernel-devel-2.6.32-358.23.2.el6.x86_64.rpm
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1105, in _retrieve
    self.fo.write(buf)
IOError: [Errno 28] No space left on device

Code can fail on other places too but downloading packages is the most risky stage and it would be nice to fix it at least there.

Actual results:
Exception not catched properly.

Expected results:
Catch exception and end.

Comment 1 Jan Dobes 2017-03-16 14:45:14 UTC
fixing printing empty lines when package was not downloaded for whatever reason, spacewalk master:

b298e39a5dc7c7a2839d1aac6d2950d9540e7239

Comment 3 Jan Dobes 2017-03-28 14:51:31 UTC
some fixes in spacewalk master:

421b49d671c9c992c10618472d7bbbc1442720bb
d1a9f5ccca28f47a4a4d09952a7753eb660b988f
ac9d079a84d94d2d35a40bec108d0ea3c1c65dd6

It will stop downloading and interrupts syncing completely. At least on RHEL 6 because there is KeyboardInterrupt raised when we run out of space.

Unfortunately, the message from comment #0 is still printed from urlgrabber code and we can't stop it. Another problem is behavior on RHEL 6 and RHEL 7 is quite different because of different versions of urlgrabber. It should be considered to replace yum and urlgrabber libraries with something more predictable.