Bug 634595

Summary: yum traceback when running concurrent yum and rpm transactions
Product: Red Hat Enterprise Linux 6 Reporter: Karel Srot <ksrot>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: borgan, tcapek
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.29-11.el6 Doc Type: Bug Fix
Doc Text:
Previously, when concurrent yum and RPM transactions were running, yum sometimes terminated with a traceback. With this update, transaction conflicts are properly recognised, and when they are encountered, yum exits with a proper error message.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:33:57 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:
Bug Depends On: 629274    
Bug Blocks:    
Attachments:
Description Flags
bug reproducer none

Description Karel Srot 2010-09-16 13:31:27 UTC
Created attachment 447745 [details]
bug reproducer

Description of problem:
yum traceback when running concurrent yum and rpm transactions. 
I know this is not a good idea at all.. :-)

Version-Release number of selected component (if applicable):
yum-3.2.27-14.el6

How reproducible:
occasionally

Steps to Reproduce:
perform cuncurrent yum and rpm transactions - see the attached reproducer.
Please note that you may have to run the test several times to trigger the bug, maybe you have to play with sleep intervals in the testing. I was running it in a slow virtual host.
  
Actual results:
---> Package dummypkg8.x86_64 0:1.0-1 set to be updated
---> Package dummypkg9.x86_64 0:1.0-1 set to be updated
Error: Rpmdb changed underneath us
 You could try using --skip-broken to work around the problem
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 254, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 174, in main
    if not base._rpmdb_warn_checks(out=verbose_logger.info, warn=False):
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1142, in _rpmdb_warn_checks
    probs.extend(self.rpmdb.check_dependencies())
  File "/usr/lib/python2.6/site-packages/yum/rpmsack.py", line 1247, in check_dependencies
    for rreq in pkg.requires:
  File "/usr/lib/python2.6/site-packages/yum/packages.py", line 508, in <lambda>
    requires = property(fget=lambda self: self.returnPrco('requires'))
  File "/usr/lib/python2.6/site-packages/yum/packages.py", line 1147, in returnPrco
    self._populatePrco()
  File "/usr/lib/python2.6/site-packages/yum/packages.py", line 1161, in _populatePrco
    hdr = self._get_hdr()
  File "/usr/lib/python2.6/site-packages/yum/rpmsack.py", line 66, in _get_hdr
    raise Errors.PackageSackError, 'Rpmdb changed underneath us'
yum.Errors.PackageSackError: Rpmdb changed underneath us


Expected results:
error displayed and a peaceful exit

Comment 1 James Antill 2010-09-16 16:33:15 UTC
It's priority high to provide just the error message instead of a traceback?

We currently don't catch Errors.PackageSackError, but we can do (esp. when not run in debug mode, say). So I'm happy to ACK this for 6.1.

Comment 5 Karel Srot 2011-03-11 11:26:52 UTC
While testing with yum-3.2.29-8.el6.noarch I am getting following error:

---> Package dummyA.noarch 0:1.0-1 will be erased
---> Package dummyB.noarch 0:1.0-1 will be erased
---> Package dummypkg10.x86_64 0:1.0-1 will be erased
Error: Rpmdb changed underneath us
 You could try using --skip-broken to work around the problem
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 274, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 194, in main
    warn_checks()
NameError: global name 'warn_checks' is not defined

Comment 7 Karel Srot 2011-03-25 12:32:44 UTC
Another error with yum-3.2.29-10.el6

Error: Rpmdb changed underneath us
 You could try using --skip-broken to work around the problem
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 274, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 194, in main
    rpmdb_warn_checks()
  File "/usr/share/yum-cli/yummain.py", line 82, in rpmdb_warn_checks
    except YumBaseError, e:
NameError: global name 'YumBaseError' is not defined

Comment 8 James Antill 2011-03-25 13:29:02 UTC
*sigh* ... it's Errors.YumBaseError ... I'll get a fixed package out today.

Comment 10 Tomas Capek 2011-05-17 12:01:58 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, when concurrent yum and RPM transactions were running, yum sometimes terminated with a traceback. With this update, transaction conflicts are properly recognised, and when they are encountered, yum exits with a proper error message.

Comment 11 errata-xmlrpc 2011-05-19 13:33:57 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0602.html