Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1384661

Summary: Capsules don't verify downloads, create 0 byte files when downloads fail
Product: Red Hat Satellite Reporter: David Davis <daviddavis>
Component: Foreman ProxyAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, inecas, jcallaha
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-19 10:28:08 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:

Description David Davis 2016-10-13 19:16:29 UTC
In https://bugzilla.redhat.com/show_bug.cgi?id=1317047, the download of the file from the Satellite server fails (503) but the Capsule goes ahead and creates a 0 byte file. There doesn't appear to be any error checking at all. Looking at the code confirms this:

https://git.io/vPVhw

Moreover, if I run that command with a bad file, I get a file on the filesystem with 0 bytes!

$ wget --timeout=10 --tries=3 --no-check-certificate -nv -c http://example.com/bad.file -O bad.file
$ ls -al bad.file
-rw-r--r--  1 jomama  wheel  0 Oct 13 15:13 bad.file


So not only does the Capsule not capture and report the error but it also creates a 0 byte file (as if the download succeeded).

That is BAD!!

Comment 3 Ivan Necas 2016-10-19 10:28:08 UTC
Seems like a duplicate of 1215588, we are tracking this issue upstream and looking into that at the moment.

*** This bug has been marked as a duplicate of bug 1215588 ***