Bug 825428

Summary: applydeltaiso needs a better error message
Product: [Fedora] Fedora Reporter: Samuel Sieb <samuel-rhbugs>
Component: deltarpmAssignee: Jonathan Dieter <jonathan>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: balay, jonathan, robatino
Target Milestone: ---Keywords: FutureFeature, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-20 09:36:12 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:
Attachments:
Description Flags
better error message for bad inputs to applydeltaiso.c
none
better error message for bad inputs to applydeltaiso.c none

Description Samuel Sieb 2012-05-26 07:36:08 UTC
I tried to apply a deltaiso but it didn't work and gave me a strange message:

applydeltaiso F17-RC2.iso Fedora-17-Final.RC2_RC3-i386-DVD.diso F17-RC3.iso
reading 355457288 bytes from old iso...fread: Success

What I finally figured out is that the diso files I got were for the full DVD and I was trying to patch the live cd.  It was trying to read past the end of the file, but there is no error, just the strange "Success" message.

Comment 1 Satish Balay 2012-10-24 16:52:47 UTC
I stumbled across a similar issue [I mistakenly downloaded the i386.diso instead  of x86_64.diso] and got this message. A better error message would be useful.

asterix:/home/balay/Downloads/iso>applydeltaiso Fedora-18-Beta-TC4-x86_64-DVD.iso Fedora-18-Beta-TC4_TC5-i386-DVD.diso  Fedora-18-Beta-TC5-x86_64-DVD.iso
reading 456999056 bytes from old iso...fread: Success
asterix:/home/balay/Downloads/iso>

Comment 2 Fedora End Of Life 2013-01-16 13:59:12 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Satish Balay 2013-01-17 15:37:30 UTC
Issue exits with F18 aswell - so you might want to repoen.


asterix:/home/balay/Downloads/test>rpm -q deltaiso
deltaiso-3.6-0.11.20110223git.fc18.x86_64
asterix:/home/balay/Downloads/test>applydeltaiso Fedora-18-TC3-x86_64-netinst.iso Fedora-18-Final-TC4-i386-DVD_netinst.diso Fedora-18-x86_64-netinst.iso
reading 510586368 bytes from old iso...fread: Success
asterix:/home/balay/Downloads/test>

Comment 4 Fedora End Of Life 2013-02-13 14:55:57 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Satish Balay 2013-02-14 02:21:45 UTC
As mentioned - the issue exists in f18 - and can be reopened

Comment 6 John Reiser 2013-05-18 03:48:22 UTC
Created attachment 749539 [details]
better error message for bad inputs to applydeltaiso.c

This patch improves the error detection and the message.

Without the patch: you get shell status exit code 1 (Failure) and the message:
  fread: Success
which creates needless confusion, and gives the user no clue what is wrong or how to fix it.

With the patch, you still get shell status exit code 1 (Failure); but often applydeltaiso can give a better high-level diagnosis, such as:
  Fedora-19-Beta-i386-netinst.iso: too short: 365953024 vs 532442232
and when high-level diagnosis is not possible, then you still get a decent:
  reading 532442232 bytes from old iso...fread: unexpected end-of-file

Comment 7 John Reiser 2013-05-18 04:13:24 UTC
Created attachment 749540 [details]
better error message for bad inputs to applydeltaiso.c

Count the space between old pieces, too.  Now the error message gives the size of the old.iso that was input to makedeltaiso, which can very helpful:
  Fedora-19-Beta-i386-netinst.iso: too short: 365953024 vs 4560257024
where the correct old.iso should have 4560257024 bytes.

Comment 8 Jonathan Dieter 2013-05-20 09:36:12 UTC
I've just pushed an update out to Rawhide that contains this patch (among other smaller fixes).  Though I reviewed the patch, I haven't actually tested it, as I don't have any deltaiso's (or any iso's for that matter) lying around.  If I could have a few people verify that this does what it's supposed to do, I'll see about getting it pushed into F19.

Comment 9 Andre Robatino 2013-05-21 15:42:49 UTC
Seems to work with minimal testing. I can try to run more tests if needed, though I'm not sure how much my VM can handle - it only has 1 GiB of RAM (the host has 4 GiB).

[root@localhost media]# ls -l 19-Beta-RC2/i386/
total 4810764
-rw-rw-r--. 1 root root        246 May 17 01:08 Fedora-19-Beta-i386-CHECKSUM
-rw-rw-r--. 1 root root 4560257024 May 17 01:06 Fedora-19-Beta-i386-DVD.iso
-rw-rw-r--. 1 root root  365953024 May 17 01:00 Fedora-19-Beta-i386-netinst.iso
[root@localhost media]# applydeltaiso 19-Beta-RC2/i386/Fedora-19-Beta-i386-netinst.iso disos/Fedora-19-Beta-RC1_RC2-i386\ Deltaisos/Fedora-19-Beta-RC2-i386-DVD_netinst.diso Fedora-19-Beta-i386-netinst.iso
19-Beta-RC2/i386/Fedora-19-Beta-i386-netinst.iso: too short: 365953024 vs 4560257024
[root@localhost media]# applydeltaiso 19-Beta-RC2/i386/Fedora-19-Beta-i386-DVD.iso disos/Fedora-19-Beta-RC1_RC2-i386\ Deltaisos/Fedora-19-Beta-RC2-i386-DVD_netinst.diso Fedora-19-Beta-i386-netinst.iso
reading 532442232 bytes from old iso...done
iso successfully re-created, md5sum: c80ca028cef9f55531687ae9127585f7
[root@localhost media]# sha256sum -c 19-Beta-RC2/i386/Fedora-19-Beta-i386-CHECKSUM 
sha256sum: Fedora-19-Beta-i386-DVD.iso: No such file or directory
Fedora-19-Beta-i386-DVD.iso: FAILED open or read
Fedora-19-Beta-i386-netinst.iso: OK
sha256sum: WARNING: 1 listed file could not be read
[root@localhost media]#

Comment 10 Jonathan Dieter 2013-05-21 18:37:25 UTC
Yeah, I think that covers all the high points.  I'll do a build for F19, but I'm not sure where we are in the development cycle, so I don't know when it will actually get pushed.

Comment 11 Fedora Update System 2013-05-21 18:59:07 UTC
deltarpm-3.6-0.13.20130520git.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/deltarpm-3.6-0.13.20130520git.fc19

Comment 12 Fedora Update System 2013-05-26 03:44:29 UTC
deltarpm-3.6-0.13.20130520git.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.