Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Klauer, Daniel" <Daniel.Klauer@gin.de>
To: Mark Hatle <mark.hatle@windriver.com>,
	Herve Jourdain <herve.jourdain@neuf.fr>
Cc: "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] smartpm: Don't ignore error if RPM transaction fails without problems
Date: Thu, 9 Jun 2016 08:19:53 +0000	[thread overview]
Message-ID: <1465460392811.42840@gin.de> (raw)
In-Reply-To: <bac958a1-9a5e-3bdc-0d83-0dcff153dd22@windriver.com>

Hello,

the case I encountered the original issue with was a partially broken RPM database, which allowed the "Computing transaction" to work, but failed at "Committing transaction" when installing a package.

To reproduce it, the RPM database can be broken intentionally:
# echo foo > /var/lib/rpm/Arch

Then try to install some package...
# smart install|reinstall|upgrade <package>


SmartPM output & exit code before the fix (commit 1dc5f5d5c844585eec114be9480e0e4d8e60d09c):


Loading cache...
...
Computing transaction...
...
Committing transaction...
Preparing...                    ######################################## [  0%]
   1:Installing <package>       ######################################## [100%]
Output from <package>-<version>@<arch>:
rpmdb: BDB0004 fop_read_meta: /var/lib/rpm/Arch: unexpected file type or format
error: cannot open Arch(1022) index: Invalid argument(22)
	DB: Berkeley DB 6.0.30: (January 23, 2014)

Saving cache...

# echo $?
0


And after the fix:


Loading cache...
...
Computing transaction...
...
Committing transaction...
Preparing...                    ######################################## [  0%]
   1:Installing <package>       ######################################## [100%]
Output from <package>-<version>@<arch>:
rpmdb: BDB0004 fop_read_meta: /var/lib/rpm/Arch: unexpected file type or format
error: cannot open Arch(1022) index: Invalid argument(22)
	DB: Berkeley DB 6.0.30: (January 23, 2014)
error: Unknown error

# echo $?
1


I've only ever tested this with breaking the Arch index database; perhaps the behaviour will be different when breaking another index, and most likely RPM will fail earlier when the main /var/lib/rpm/Packages database is broken. Either way, perhaps this can be used for a test case.

Regards,
Daniel

      parent reply	other threads:[~2016-06-09  8:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 12:54 smartpm: Don't ignore error if RPM transaction fails without problems Klauer, Daniel
2016-05-17 12:58 ` [PATCH] " Klauer, Daniel
2016-06-07 13:17   ` Herve Jourdain
2016-06-08 11:35     ` Klauer, Daniel
     [not found]     ` <1465381435600.39214@gin.de>
2016-06-08 12:52       ` Herve Jourdain
2016-06-08 15:43         ` Klauer, Daniel
2016-06-08 16:00           ` Herve Jourdain
2016-06-08 16:05           ` Mark Hatle
2016-06-08 16:17             ` Herve Jourdain
2016-06-08 16:47               ` Mark Hatle
2016-06-09  7:47                 ` ***SPAM*** " Herve Jourdain
2016-06-09  8:19                 ` Klauer, Daniel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465460392811.42840@gin.de \
    --to=daniel.klauer@gin.de \
    --cc=herve.jourdain@neuf.fr \
    --cc=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox