There's a bug observed in RHEL testing which we assume to be present in Fedora 16 as well. "When installing packages in "%post" section of kickstart installation or manually in chroot before restarting the installation, yum throws a traceback: 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 276, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 211, in main return_code = base.doTransaction() File "/usr/share/yum-cli/cli.py", line 586, in doTransaction resultobject = self.runTransaction(cb=cb) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1436, in runTransaction lastdbv = self.history.last() File "/usr/lib/python2.6/site-packages/yum/history.py", line 1259, in last ret = self.old([], 1, complete_transactions_only) File "/usr/lib/python2.6/site-packages/yum/history.py", line 1208, in old executeSQL(cur, sql, params) File "/usr/lib/python2.6/site-packages/yum/sqlutils.py", line 166, in executeSQLQmark return cursor.execute(query) sqlite3.OperationalError: database is locked" "Looking through the patches changed from -17 to -18 I see this which feels completely dead on: -- a/yum/history.py +++ b/yum/history.py @@ -627,6 +627,14 @@ class YumHistory: self.conf.readable = False return None + # Note that this is required due to changing the history DB in the + # callback for removed txmbrs ... which happens inside the chroot, + # as against all our other access which is outside the chroot. So + # we need sqlite to not open the journal. + # In theory this sucks, as history could be shared. In reality + # it's deep yum stuff and there should only be one yum. + executeSQL(self._conn.cursor(), "PRAGMA locking_mode = EXCLUSIVE") + return self._conn.cursor() def _commit(self): Since at the point in the anaconda run you have 2 yums (sorta) one inside anaconda and the one you're execing in %post." This is a significant issue for kickstart installs. Proposing as Beta blocker (to feed into the discussion we need to have on kickstart criteria) and marking as CommonBugs.
The exclusive sqlite access mode is largely a hack to deal with chroot issues, but me thinks this is a case of it simply exposing a flaw in the way things have been done so far: there shouldn't be two yum instances running on the same system, and this should be dealt with in anaconda by fully shutting down its internal yum instance before entering %post (it doesn't need it at that point for anything).
Agreed on the anaconda changes. The comment I made above was to deal w/the issue pre-6.2 - not to suggest that yum solve it all internally.
Note that we already have a yb.history.close() API ... and it'll automatically do it when "freed", so unless you want us to automatically do it at the end of the transaction (kind of icky, but probably nothing breaks) ... then I guess we just need to change anaconda.
anaconda-16.16-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/anaconda-16.16-1.fc16
anaconda-16.16-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
*** Bug 735446 has been marked as a duplicate of this bug. ***