Bug 110556

Summary: Installing/Upgrading the attach packages causes a non-zero return code
Product: [Retired] Red Hat Linux Reporter: Mark Hatle <mhatle>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: low Docs Contact:
Priority: medium    
Version: 9CC: leonard-rh-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-18 14:23:41 UTC Type: ---
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
binary rpm package that exhibits the behavior none

Description Mark Hatle 2003-11-21 05:43:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/103u (KHTML, like Gecko) Safari/100.1

Description of problem:
Working with jbj in IRC the problem was identified (in rpm 4.1) to be the erase in lib/psm.c failed.  Unfortunatly this doesn't seem to be the problem but a symptom of a deeper problem.

       psm->mi = rpmdbFreeIterator(psm->mi);
       rc = (fi->h ? RPMRC_OK : RPMRC_FAIL);

fi->h comes back NULL.  This is in lib/psm.c, user the case for PSM_RPMDB_LOAD, in the function rpmpsmStage.

The same behavior is happening on the stock RH 9.0 rpm 4.2 version listed above.

When doing an rpm -U --replacepkgs on a particular package, twice in a row the second (and subsequant) operations yield a non-zero return code.

Version-Release number of selected component (if applicable):
rpm-4.2-0.69

How reproducible:
Always

Steps to Reproduce:
1. mkdir -p /tmp/testing/var/lib/rpm
2. rpm --root /tmp -Uhv --ignorearch --nodeps --replacepkgs mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl ; echo $?
3. (repeat the above line)
    

Actual Results:  The first time the return code is "0".  The second and subseqent times the return code is != "0".  (in this case it's 1 because we had "one" package failure.)

Expected Results:  0 return code both times

Additional info:

What appears to be happening is the update does the install/remove correctly in the database.  But somehow adds a PKGERASE action.  When it gets to that stage the header key is no longer in the rpm database, so the iterator fails.. causing the failure to be carried down the calling chain.

Comment 1 Jeff Johnson 2003-11-21 12:38:01 UTC
I see no pkg attached. Could you attach the pkg in question please?

Comment 2 Mark Hatle 2003-11-21 14:16:27 UTC
Created attachment 96118 [details]
binary rpm package that exhibits the behavior

Comment 3 Jeff Johnson 2006-01-06 14:27:48 UTC
Reproduced with rpm-4.4.5:

[root@wellfleet tmp]# rpm --root /tmp -Uhv --ignorearch --nodeps --replacepkgs 
mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl ; echo $?
Preparing...                ########################################### [100%]
   1:mvlutils               ########################################### [100%]
0
[root@wellfleet tmp]# rpm --root /tmp -Uhv --ignorearch --nodeps --replacepkgs 
mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl ; echo $?
Preparing...                ########################################### [100%]
   1:mvlutils               ########################################### [100%]
1


Comment 4 Jeff Johnson 2006-01-27 08:54:59 UTC
Hmmm, the link count field for certain files in the package is zero, that should not be happening:

[jbj@wellfleet X]$ rpm -qlvp mvlutils-1.14-13.0.0.mgh.x86_pentium2.mvl 
-rwxr-xr-x    0 root    root            27930 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/mktemp
-rwxr-xr-x    0 root    root            27063 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/readlink
-rwxr-xr-x    1 root    root            43950 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/run-parts
-rwxr-xr-x    0 root    root            30793 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/tempfile
-rwxr-xr-x    1 root    root            12853 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/usleep
lrwxrwxrwx    1 root    root               26 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/bin/vi -> ../usr/bin/sensible-editor
-rwxr-xr-x    1 root    root            25388 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/sbin/start-stop-daemon
lrwxrwxrwx    1 root    root               15 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/editor -> sensible-editor
lrwxrwxrwx    1 root    root               14 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/pager -> sensible-pager
-rwxr-xr-x    1 root    root             6318 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/savelog
-rwxr-xr-x    1 root    root              674 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/sensible-editor
-rwxr-xr-x    1 root    root              533 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/bin/sensible-pager
-rw-r--r--    1 root    root             2097 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/lib/pml/packages/mvlutils
-rwxr-xr-x    1 root    root            25701 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/initdconfig
lrwxrwxrwx    1 root    root               11 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/pentium2-initdconfig -> initdconfig
lrwxrwxrwx    1 root    root               11 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/pentium2-shellconfig -> shellconfig
-rwxr-xr-x    1 root    root            30017 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/sbin/shellconfig
drwxr-xr-x    2 root    root                0 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/share/doc/mvlutils-1.14
-rw-r--r--    0 root    root             8115 Nov 19  2003 /opt/montavista/pro/devkit/x86/pentium2/
target/usr/share/doc/mvlutils-1.14/LICENSE


Comment 5 Jeff Johnson 2006-03-18 14:23:41 UTC
I'm going to assume this is a build environment problem because of the link count
problems. Please reopen if you think I'm guessing wrong.