Bug 449448

Summary: yum: packages with %pretrans fail to install
Product: [Fedora] Fedora Reporter: Rex Dieter <rdieter>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 8CC: clasohm, ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-03 13:36:55 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:

Description Rex Dieter 2008-06-02 17:12:22 UTC
$ rpm -q yum
yum-3.2.8-2.fc8.noarch

We've got a private/local repo with a package or 2 with %pretrans scriptlets. 
These are installable fine with rpm, but fail when trying to install with yum:

....
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 183, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 401, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 591, in
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 315, in callback
    self._instCloseFile(  bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 378, in
_instCloseFile
    self.ts_done(txmbr.po, txmbr.output_state)
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 211, in ts_done
    te_fn = '%s/transaction-done.%s' % (self.base.conf.persistdir, self._ts_time)
AttributeError: RPMTransaction instance has no attribute '_ts_time'

Comment 1 Seth Vidal 2008-06-02 17:19:33 UTC
This is known and fixed in yum upstream and in F9. It's unclear whether or not
we'll backport at this time.



Comment 2 Rex Dieter 2008-06-02 17:25:59 UTC
thx for the quick feedback, I guess we'll have to figure out a way to simply
avoid using %pretrans in the short-term.

Comment 3 Seth Vidal 2008-06-02 17:33:26 UTC
As a general rule avoid %pretrans, %postrans and triggers.

they are painful.

Comment 4 Jeremy Katz 2008-06-02 17:41:09 UTC
Especially %pretrans.  Because it's hard to run a script in an empty chroot...

Comment 5 Rex Dieter 2008-06-02 17:46:40 UTC
I know all that, but %pretrans was the only/best way to work around some borkage
in our local/site packages.  I'll deal. :)

Comment 6 Panu Matilainen 2008-06-03 05:30:47 UTC
Part of the reason why %pretrans and %posttrans are painful is that they're used
so little that bugs like this don't get caught early on. For some things
%pretrans is really the one and only possibility atm and the empty chroot
doesn't matter as long as the embedded lua interpreter is used instead of
/bin/sh or such, and script is careful not assume things that might not be there.

Comment 7 seth vidal 2008-09-03 13:36:55 UTC
yum 3.2.19 in f8 updates-testing fixes this problem.