Bug 575917 - yum history traceback as normal user: unable to open database file
Summary: yum history traceback as normal user: unable to open database file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:84cb6291
: 585196 587533 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-22 17:40 UTC by Eric Lake
Modified: 2014-01-21 23:14 UTC (History)
13 users (show)

Fixed In Version: yum-3.2.28-3.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-29 19:30:40 UTC


Attachments (Terms of Use)
File: backtrace (1.12 KB, text/plain)
2010-03-22 17:40 UTC, Eric Lake
no flags Details

Description Eric Lake 2010-03-22 17:40:14 UTC
abrt 1.0.8 detected a crash.

architecture: i686
cmdline: /usr/bin/python /usr/bin/yum history
component: yum
executable: /usr/bin/yum
kernel: 2.6.33-1.fc13.i686
package: yum-3.2.26-6.fc13
reason: history.py:217:_get_cursor:OperationalError: unable to open database file
release: Fedora release 13 (Rawhide)

backtrace
-----
history.py:217:_get_cursor:OperationalError: unable to open database file

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 109, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 356, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 1314, in doCommand
    ret = base.historyListCmd(extcmds)
  File "/usr/share/yum-cli/output.py", line 1297, in historyListCmd
    for old in self.history.old(tids, limit=limit):
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 446, in old
    cur = self._get_cursor()
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 217, in _get_cursor
    self._conn = sqlite.connect(self._db_file)
OperationalError: unable to open database file

Local variables in innermost frame:
self: <yum.history.YumHistory instance at 0x97d848c>

How to reproduce
-----
1. I just tried to do a 'yum history' on a Fedora 13 test system
2.
3.

Comment 1 Eric Lake 2010-03-22 17:40:16 UTC
Created attachment 401831 [details]
File: backtrace

Comment 2 Eric Lake 2010-03-22 17:56:35 UTC
Looking at the permissions on the .sqlite file in /var/lib/yum/history/ I see that only root has rw for the file. Running 'yum history' as root allows me to see the information. I remember running this same command as my user on my Fedora 12 box and it worked fine. Is this due to a change in yum between F12 and F13?

[elake@jackson ~]$ ls -al /var/lib/yum/history/
total 120
drwxr-xr-x. 2 root root   4096 Mar 22 13:51 .
drwxr-xr-x. 4 root root   4096 Mar 22 13:51 ..
-rw-------. 1 root root 107520 Mar 22 13:51 history-2010-03-19.sqlite

[elake@jackson ~]$ yum history
Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
Adding en_US to language list
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
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 109, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 356, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 1314, in doCommand
    ret = base.historyListCmd(extcmds)
  File "/usr/share/yum-cli/output.py", line 1297, in historyListCmd
    for old in self.history.old(tids, limit=limit):
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 446, in old
    cur = self._get_cursor()
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 217, in _get_cursor
    self._conn = sqlite.connect(self._db_file)
sqlite3.OperationalError: unable to open database file

[elake@jackson ~]$ su -c 'yum history'
Password: 
Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
Adding en_US to language list
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     8 | Eric Lake <elake>      | 2010-03-22 13:51 | Install        |    6   
     7 | Eric Lake <elake>      | 2010-03-22 13:26 | Install        |    2   
     6 | Eric Lake <elake>      | 2010-03-22 11:43 | Install        |    1   
     5 | Eric Lake <elake>      | 2010-03-22 08:34 | Install        |    6   
     4 | Eric Lake <elake>      | 2010-03-22 08:26 | Install        |   17   
     3 | Eric Lake <elake>      | 2010-03-22 08:03 | I, U           |  264   
     2 | Eric Lake <elake>      | 2010-03-22 08:00 | Erase          |   18   
     1 | Eric Lake <elake>      | 2010-03-19 15:36 | Install        |    1   
history list

Comment 3 James Antill 2010-03-22 18:09:40 UTC
Yeh, it was decided that the information in there was privilaged and so only root should see it by default.

We shouldn't traceback though.

Comment 4 Eric Lake 2010-03-22 18:17:21 UTC
Thanks for the very quick response. So I assume then that the expected output would be like what a normal user sees when trying to run 'yum install foo' as themselves "You need to be root to perform this command.".

Comment 5 James Antill 2010-03-22 22:21:02 UTC
atm. I just made it act like there is an empty history file, we could put the root check in the yum history command too ... although that'd mean it still wouldn't work even if the sysadmin did a chmod on /var/lib/history.

Comment 6 Adam Williamson 2010-03-24 00:36:57 UTC

How to reproduce
-----
1. Run 'yum history' as a regular user (in a newly-installed F13 Beta TC1 system)
2.
3.

Comment 7 smurffit 2010-03-24 08:29:57 UTC

How to reproduce
-----
1. yum history list <item> as non-root user
2.
3.

Comment 8 Kamil Páral 2010-03-29 08:27:23 UTC

How to reproduce
-----
1. Be common user.
2. Run "yum history".
3.


Comment
-----
This is what happens when I run "yum history" from non-root account.

Comment 9 James Antill 2010-03-29 13:50:36 UTC
This should be fixed in the version that went into rawhide just before the weekend, if anyone wants to test that and make sure.

Comment 10 Adam Williamson 2010-03-31 02:56:06 UTC
I'm on F13, not rawhide - is it in an f13 build yet?



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 11 James Antill 2010-03-31 04:05:00 UTC
No, rawhide only atm.

Comment 12 Eric Lake 2010-04-12 20:13:25 UTC
Has the version with the fix been included in the f13 beta release? I just tried again still see the backtrace.

yum-3.2.27-3.fc13.noarch



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 13 James Antill 2010-04-12 22:18:07 UTC
No, while https://admin.fedoraproject.org/updates/yum-3.2.27-3.fc13 has recently been pushed it contains just a single fix (for MD reget). We're unlikely to rebase F-13, or backport this fix, until post GA.

Comment 14 Howard Ning 2010-04-13 11:45:26 UTC
Package: yum-3.2.27-3.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. Run $ yum history
2. crash
3.

Comment 15 Howard Ning 2010-04-21 01:26:04 UTC
Package: yum-3.2.27-3.fc13
Architecture: x86_64
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. $ yum history
2. crash
3.  # yum history
4. OK

Comment 16 seth vidal 2010-04-23 13:55:49 UTC
*** Bug 585196 has been marked as a duplicate of this bug. ***

Comment 17 Ulrich Hobelmann 2010-04-27 16:45:32 UTC
Package: yum-3.2.27-3.fc13
Architecture: i686
OS Release: Fedora release 13 (Goddard)


How to reproduce
-----
1. PackageKit was running.
2. I wanted to find out if the previous update run was successful, or why another one was apparently going on, so I ran yum history list.
3. Crash.

Comment 18 James Antill 2010-04-29 19:30:40 UTC
This is fixed in rawhide, and I was sure it was fixed in F-13 ... but if not it'll be fixed in the first update afterwards (if you really care chmod the history file, or install the yum from rawhide :).

Comment 19 James Antill 2010-04-30 13:29:49 UTC
*** Bug 587533 has been marked as a duplicate of this bug. ***

Comment 20 Fedora Update System 2010-08-02 14:11:25 UTC
yum-3.2.28-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-3.2.28-1.fc13

Comment 21 Fedora Update System 2010-08-02 14:12:58 UTC
yum-3.2.28-1.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/yum-3.2.28-1.fc14

Comment 22 Fedora Update System 2010-08-02 14:14:32 UTC
yum-3.2.28-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/yum-3.2.28-1.fc12

Comment 23 Fedora Update System 2010-08-05 23:44:32 UTC
yum-3.2.28-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2010-08-12 20:15:26 UTC
yum-3.2.28-3.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/yum-3.2.28-3.fc12

Comment 25 Fedora Update System 2010-08-12 20:17:55 UTC
yum-3.2.28-3.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-3.2.28-3.fc13

Comment 26 Fedora Update System 2010-08-12 20:20:19 UTC
yum-3.2.28-3.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/yum-3.2.28-3.fc14

Comment 27 Fedora Update System 2010-08-17 05:45:35 UTC
yum-3.2.28-3.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 28 Fedora Update System 2010-08-20 02:19:18 UTC
yum-3.2.28-3.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 29 Fedora Update System 2010-08-24 01:36:57 UTC
yum-3.2.28-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.