Bug 459654

Summary: yum shell raises AttributeError
Product: [Fedora] Fedora Reporter: Andrew McNabb <amcnabb>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: amcnabb, ffesti, james.antill, jhutar, 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-10-27 15:37:11 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 Andrew McNabb 2008-08-20 21:09:17 UTC
Running yum shell raises an AttributeError.  Here's a minimal script to reproduce:

"""repo enable rawhide
repo disable rawhide
"""

Here is the traceback:

[root@mcbain ~]# yum shell test.yum
Loaded plugins: refresh-packagekit
Setting up Yum Shell
Reading repository metadata in from local files
Setting up Install Process
Parsing package install arguments
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 243, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 118, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 338, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 592, in doCommand
    return base.doShell()
  File "/usr/share/yum-cli/cli.py", line 283, in doShell
    yumshell.script()
  File "/usr/share/yum-cli/shell.py", line 78, in script
    self.onecmd(line)
  File "/usr/lib64/python2.5/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/share/yum-cli/shell.py", line 308, in do_repo
    self.base.pkgSack.buildIndexes()
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 578, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 421, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.5/site-packages/yum/repos.py", line 245, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 149, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 203, in _check_db_version
    return repo._check_db_version(mdtype)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 933, in _check_db_version
    repoXML = self.repoXML
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1091, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1083, in _getRepoXML
    self._loadRepoXML(text=self)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1073, in _loadRepoXML
    return self._groupLoadRepoXML(text, ["primary"])
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1057, in _groupLoadRepoXML
    if self._commonLoadRepoXML(text):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 902, in _commonLoadRepoXML
    if self._cachingRepoXML(local):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 762, in _cachingRepoXML
    if self.cache or self.withinCacheAge(self.metadata_cookie,
AttributeError: 'YumRepository' object has no attribute 'metadata_cookie'
[root@mcbain ~]# vim test.yum 
[root@mcbain ~]# yum shell test.yum
Loaded plugins: refresh-packagekit
Setting up Yum Shell
Reading repository metadata in from local files
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 243, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 118, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 338, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 592, in doCommand
    return base.doShell()
  File "/usr/share/yum-cli/cli.py", line 283, in doShell
    yumshell.script()
  File "/usr/share/yum-cli/shell.py", line 78, in script
    self.onecmd(line)
  File "/usr/lib64/python2.5/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/share/yum-cli/shell.py", line 308, in do_repo
    self.base.pkgSack.buildIndexes()
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 578, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 421, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.5/site-packages/yum/repos.py", line 245, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 149, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 203, in _check_db_version
    return repo._check_db_version(mdtype)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 933, in _check_db_version
    repoXML = self.repoXML
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1091, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1083, in _getRepoXML
    self._loadRepoXML(text=self)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1073, in _loadRepoXML
    return self._groupLoadRepoXML(text, ["primary"])
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 1057, in _groupLoadRepoXML
    if self._commonLoadRepoXML(text):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 902, in _commonLoadRepoXML
    if self._cachingRepoXML(local):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 762, in _cachingRepoXML
    if self.cache or self.withinCacheAge(self.metadata_cookie,
AttributeError: 'YumRepository' object has no attribute 'metadata_cookie'

Comment 1 James Antill 2008-08-21 14:33:39 UTC
 This is fixed in upstream commit b566b30169f1db62527133b5d57d010322218084

 Should make it's way into Fedora 9, updates-testing "soon".

Comment 2 Fedora Update System 2008-08-27 18:02:13 UTC
yum-3.2.19-1.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/yum-3.2.19-1.fc8

Comment 3 Fedora Update System 2008-08-27 18:03:39 UTC
yum-3.2.19-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/yum-3.2.19-1.fc9

Comment 4 Fedora Update System 2008-09-10 06:58:24 UTC
yum-3.2.19-3.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2008-09-10 06:59:14 UTC
yum-3.2.19-3.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Jan Hutaƙ 2008-09-10 11:15:05 UTC
Tested with yum-3.2.19-1.fc9.noarch and seems OK:

# yum shell
Loaded plugins: allowdowngrade, changelog, downloadonly, merge-conf, presto,
              : protectbase, refresh-packagekit, refresh-updatesd, tmprepo,
              : upgrade-helper, verify
Setting up Yum Shell
> repo
...
updates-newkey       Fedora 9 - x86_64 - Updates Newkey       enabled :   4,506
updates-presto       Fedora 9 - x86_64 - Updates Presto       enabled :   5,487
> repo enable rawhide
...
rawhide                                                  | 2.4 kB     00:00     
primary.sqlite.bz2                                       | 8.6 MB     00:03     
...
> repo disable rawhide
> Leaving Shell

Comment 7 Fedora Update System 2008-12-01 15:38:23 UTC
yum-3.2.20-4.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/yum-3.2.20-4.fc9

Comment 8 Fedora Update System 2008-12-08 17:08:16 UTC
yum-3.2.20-5.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/yum-3.2.20-5.fc9

Comment 9 Fedora Update System 2008-12-18 00:31:46 UTC
yum-3.2.20-5.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.