Bug 975619

Summary: [abrt] yum-3.4.3-95.fc19: misc.py:939:unlink_f:OSError: [Errno 13] Permission denied: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'
Product: [Fedora] Fedora Reporter: Francisco de la Peña <fran>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: admiller, collura, ffesti, firas.alkafri, packaging-team-maint, tim.lauridsen, umberto.bar, zpavlas
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:108b02298aabdae818ef4408cef5cbbfd6ab5ee3
Fixed In Version: yum-3.4.3-111.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-08 11:32:46 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
File: backtrace
none
File: core_backtrace
none
File: environ none

Description Francisco de la Peña 2013-06-19 00:21:38 UTC
Description of problem:
When doing bash completion.

Version-Release number of selected component:
yum-3.4.3-95.fc19

Additional info:
reporter:       libreport-2.1.5
cmdline:        /usr/bin/python -t /usr/share/yum-cli/completion-helper.py -d 0 -C list all firefox
executable:     /usr/share/yum-cli/completion-helper.py
kernel:         3.9.5-301.fc19.x86_64
runlevel:       N 5
uid:            1000

Truncated backtrace:
misc.py:939:unlink_f:OSError: [Errno 13] Permission denied: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'

Traceback (most recent call last):
  File "/usr/share/yum-cli/completion-helper.py", line 95, in <module>
    main(sys.argv[1:])
  File "/usr/share/yum-cli/completion-helper.py", line 88, in main
    base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 522, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/completion-helper.py", line 52, in doCommand
    patterns=[get_pattern(extcmds)])
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 2763, in doPackageLists
    avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1030, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 767, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 364, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 237, in populate
    misc.unlink_f(repo.cachedir +'/gen/%s.sqlite' % mydbtype)
  File "/usr/lib/python2.7/site-packages/yum/misc.py", line 939, in unlink_f
    os.unlink(filename)
OSError: [Errno 13] Permission denied: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'

Local variables in innermost frame:
e: OSError(13, 'Permission denied')
filename: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'

Comment 1 Francisco de la Peña 2013-06-19 00:21:45 UTC
Created attachment 762680 [details]
File: backtrace

Comment 2 Francisco de la Peña 2013-06-19 00:21:49 UTC
Created attachment 762681 [details]
File: core_backtrace

Comment 3 Francisco de la Peña 2013-06-19 00:21:53 UTC
Created attachment 762682 [details]
File: environ

Comment 4 Francisco de la Peña 2013-06-19 00:26:52 UTC
Description of problem:
How to reproduce:
$ yum info optionaltext[tab completion]

Version-Release number of selected component:
yum-3.4.3-95.fc19

Additional info:
reporter:       libreport-2.1.5
cmdline:        /usr/bin/python -t /usr/share/yum-cli/completion-helper.py -d 0 -C list all firefo
executable:     /usr/share/yum-cli/completion-helper.py
kernel:         3.9.5-301.fc19.x86_64
runlevel:       N 5
uid:            1000

Truncated backtrace:
misc.py:939:unlink_f:OSError: [Errno 13] Permission denied: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'

Traceback (most recent call last):
  File "/usr/share/yum-cli/completion-helper.py", line 95, in <module>
    main(sys.argv[1:])
  File "/usr/share/yum-cli/completion-helper.py", line 88, in main
    base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 522, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/completion-helper.py", line 52, in doCommand
    patterns=[get_pattern(extcmds)])
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 2763, in doPackageLists
    avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1030, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 767, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 364, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 237, in populate
    misc.unlink_f(repo.cachedir +'/gen/%s.sqlite' % mydbtype)
  File "/usr/lib/python2.7/site-packages/yum/misc.py", line 939, in unlink_f
    os.unlink(filename)
OSError: [Errno 13] Permission denied: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'

Local variables in innermost frame:
e: OSError(13, 'Permission denied')
filename: '/var/cache/yum/x86_64/19/fedora/gen/primary_db.sqlite'

Comment 5 Zdeněk Pavlas 2013-06-19 07:37:36 UTC
The compressed primary_db is valid (matches repomd.xml), but the decompressed file was invalid.  I'm curious how this could happen.  Did You kill Yum while it was retrieving metadata before that?

Comment 6 Francisco de la Peña 2013-06-19 15:04:11 UTC
Not sure, in fact I was trying to get the terminal where it happened, so it could. However, $ yum remove [tab] (instead of info) works fine without rebuilding db. I will try again tonight after rebuilding.

Comment 7 Francisco de la Peña 2013-06-21 00:52:32 UTC
After recreating repo db, it worked fine for yum info completion.

Comment 8 Zdeněk Pavlas 2013-09-25 07:38:59 UTC
*** Bug 1011758 has been marked as a duplicate of this bug. ***

Comment 9 Zdeněk Pavlas 2013-10-07 10:06:00 UTC
*** Bug 1015647 has been marked as a duplicate of this bug. ***

Comment 10 Zdeněk Pavlas 2013-10-07 10:10:31 UTC
Since 3.4.3-99, unlink_f() does handle EPERM.

Comment 11 Fedora Update System 2013-10-07 11:14:19 UTC
yum-3.4.3-111.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/yum-3.4.3-111.fc19

Comment 12 Fedora Update System 2013-10-08 11:32:46 UTC
yum-3.4.3-111.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Zdeněk Pavlas 2013-11-18 08:46:19 UTC
*** Bug 1031363 has been marked as a duplicate of this bug. ***

Comment 14 Zdeněk Pavlas 2013-11-18 08:54:52 UTC
*** Bug 1015647 has been marked as a duplicate of this bug. ***