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 ***