Bug 91867 - rpmdbAdd fails with Sha1 digest mismatch on freshly grenerated package from rpm-build
rpmdbAdd fails with Sha1 digest mismatch on freshly grenerated package from r...
Status: CLOSED DUPLICATE of bug 97727
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-28 23:27 EDT by Joe Christy
Modified: 2007-04-18 12:54 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 13:53:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
log from rpmbuild -ba -vv nagios.spec 2>&1 | tee /tmp/nagios-rpmbuild.out (76.30 KB, text/plain)
2003-05-28 23:29 EDT, Joe Christy
no flags Details
log from rpm -i -vv ../RPMS/i386/nagios-1.0-1.i386.rpm 2>&1 | tee /tmp/nagios-rpm-install.out (10.71 KB, text/plain)
2003-05-28 23:31 EDT, Joe Christy
no flags Details

  None (edit)
Description Joe Christy 2003-05-28 23:27:29 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030224

Description of problem:
Building a nagios rpm from the nagios tarball and the spec file that the tarball
includes produces a package that installs, but which rpm cannot add to the rpmdb
properly, failing with an error:

error: rpmdbAdd: skipping h#     826 Header SHA1 digest: BAD
Expected(dcd277436ea5c82debd445669d12ab069a87a404) !=
(fed0a23d45fb19c381228fd75877ceaf995512a4)


Version-Release number of selected component (if applicable):
rpm-build-4.1-1.06 & rpm-4.1-1.06, rpm-build-4.1.1-1.8x & rpm-4.1.1-1.8x

How reproducible:
Always

Steps to Reproduce:
1) Download nagios-1.0 tarball from http://www.nagios.org/download/ into
/usr/src/redhat/SOURCES.

2) In /tmp execute:
tar -xzvf /usr/src/redhat/SOURCES/nagios-1.0.tar.gz nagios-1.0/nagios.spec && cp
nagios-1.0/nagios.spec /usr/src/redhat/SPECS

3) Execute:
rpmbuild -ba -vv /usr/src/redhat/SPECS/nagios.spec 2>&1 | tee
/tmp/nagios-rpmbuild.out
(cf. Attachment 0)

4) Execute:
rpm -i -vv /usr/src/redhat/RPMS/i386/nagios-1.0-1.i386.rpm 2>&1 | tee
/tmp/nagios-rpm-install.out
and observe error:
error: rpmdbAdd: skipping h#     826 Header SHA1 digest: BAD
Expected(dcd277436ea5c82debd445669d12ab069a87a404) !=
(fed0a23d45fb19c381228fd75877ceaf995512a4)
(cf. Attachment 1 [details])

5) While nagios does get installed, the rpm db doesn't get updated properly.
E.g. rpm -qil nagios is a no-op.

6) Look for documentation.

7) Don't find it anywhere.

8) Ask for help.

############

This happens on multiple machines, with both 4.1 and 4.1.1 versions of rpm, both
before and after removing /var/lib/rpm/__db.* and rebuilding the rpmdb. It also
occurs with nagios sources patched from CVS for bug fixes and the spec file
hacked to eliminate all warnings.


Actual Results:  rpm generates the aforementioned error during the install. The
files do get installed, but querying rpm for nagios is a no-op, as is trying to
deinstall with rpm.

Troubleshooting is impossible due to lack of documentation in man, RH guides,
the web or either RedHat Press RPM book.


Expected Results:  rpmbuild should produce an rpm for which rpm doesn't complain
about a Sha1 Header digest mismatch at install time.

rpm -qil nagios should return a bunch of information and a list of the files
that were installed.

rpm -e nagios should remove the files which rpm -i installed.

The error message should be documented somewhere.


Additional info:

See attachments. I can also produce similar logs for the other versions and
steps I tried, if neccessary.

Karl DeBisschop <kdebisschop@users.sourceforge.net>, the most recent maintainer
of the nagios spec file, reports that he has never seen this behavior on RH-7.3
and RH-9, the only versions he has access to.
Comment 1 Joe Christy 2003-05-28 23:29:57 EDT
Created attachment 92044 [details]
log from rpmbuild -ba -vv nagios.spec 2>&1 | tee /tmp/nagios-rpmbuild.out

I refer to this as Attachment 0 in the original report.
Comment 2 Joe Christy 2003-05-28 23:31:29 EDT
Created attachment 92045 [details]
log from rpm -i -vv ../RPMS/i386/nagios-1.0-1.i386.rpm 2>&1 | tee /tmp/nagios-rpm-install.out

I refer to this as attachment 1 [details] in the original report
Comment 3 Joe Christy 2003-05-28 23:33:50 EDT
It would be terrific to have a list of rpm error messages and their
interpretations without reading the rpm source!
Comment 4 Joe Christy 2003-05-29 00:07:41 EDT
This just in from Karl DeBisschop (apparently the bug is in the spec file, but
my comments wrt documentation still apply):

On Fri, 2003-05-23 at 23:33, Joe Christy wrote:

>> Karl
>> 
>>     I see that you are the latest person to touch nagios.spec.
>> 
>>     I would like to install nagios on several RedHat-8.0 systems. 
>> However, when I install from the RPM, either built locally from the spec 
>> file in nagios-1.0.tar.gz or downloaded from 
>> http://nagiosplug.sourceforge.net/, while it installs, it gooks up my 
>> rpmdb (which kind of defeats the purpose of using rpm).
>> 
>> Specifically I see:
>> 
>> [root@moby SPECS]# rpm -ivh ../RPMS/i386/nagios-1.0-2.i386.rpm
>> Preparing...                ########################################### [100%]
>> uid=101(nagios) gid=102(nagios) groups=102(nagios)
>> warning: group %{cmdgrp} does not exist - using root
>> ...
>>    1:nagios                 ########################################### [100%]
>> error: rpmdbAdd: skipping h#    1374 Header SHA1 digest: BAD
Expected(6b8dab03ea2d0d18d60cf3f17afc27c8f2039aba) !=
(6f2ff64643c3a9cf18485d68743fc27572a5cfdc)
>> 
>> 
>> and rpm -q nagios is a NOP. Do you have any suggestions about what this 
>> all means, or how to fix it?


I have now been able to reproduce.

I am quite surprised to report that it does involve the failure to make
the cmdgrp. 

I'm working on the fix, but I'm just too tired to comtemplate finishing
the work tonight.

I'll keep you posted.

Comment 5 Joe Christy 2003-05-30 19:03:17 EDT
It turns out that once the spec was fixed to create the cmdgrp, the error went away.

Upon reflection, it does seem like rpm whould be moving in a direction such that
such an error would cause the install to be backed out. Of course I know how
fiendishly difficult that can be to implement.

I'd now call this bug a documentation bug a/o feature request.
Comment 6 Jeff Johnson 2003-06-25 10:53:23 EDT

*** This bug has been marked as a duplicate of 97727 ***
Comment 7 Red Hat Bugzilla 2006-02-21 13:53:17 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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