Seems to be reliably reproducable using the following steps: 1) Install a virtual machine with CentOS 6.6 "minimal" 2) yum upgrade 3) Unzip ThinLinc 4.3.0 on the machine and run install-server ThinLinc itself installs fine, as does the first set of dependency packages (LSB). On reaching the second set however, installation fails with this in the logs: -- 2015-04-29 13:40:38,265: failed to install packages with reason: database is locked -- All subsequent attempts by tl-setup to install packages will also fail. Restarting tl-setup will succeed in installing the first package(s), but then fail again on the second.
Happens with the nightly build as well. Running it in GUI mode has the same effect.
It breaks on a proper RHEL 6 as well. And a minimal install is not required. I had a fully standard desktop RHEL 6 and removed the LSB packages and nfs-utils. This is sufficient to trigger the problem. This might be a bug in RHEL rather than in ThinLinc since it is the RPM database lock that's screwed up, not the yum lock. It will require more investigation.
Possibly related: https://bugzilla.redhat.com/show_bug.cgi?id=1177035 https://bugzilla.redhat.com/show_bug.cgi?id=623887 https://bugzilla.redhat.com/show_bug.cgi?id=1071853 Or, it might be that PackageKit is starting to work after we have installed some packages?
The full traceback: Traceback (most recent call last): File "/opt/thinlinc/modules/thinlinc/packageinstaller/yumbackend.py", line 245, in install self . __yum . processTransaction ( callback = self . __yum_process_callback , rpmDisplay = self . __yum_rpm_callback ) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 5042, in processTransaction self._doTransaction(callback,display=rpmDisplay) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 5156, in _doTransaction self.runTransaction( cb=cb ) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1514, in runTransaction lastdbv = self.history.last() File "/usr/lib/python2.6/site-packages/yum/history.py", line 1266, in last ret = self.old([], 1, complete_transactions_only) File "/usr/lib/python2.6/site-packages/yum/history.py", line 1215, in old executeSQL(cur, sql, params) File "/usr/lib/python2.6/site-packages/yum/sqlutils.py", line 166, in executeSQLQmark return cursor.execute(query)
The problem is that we are not closing all the RPM/yum stuff properly after a completed run. There are lots of stuff open, and it is crashing specifically on this: lrwx------. 1 root root 64 Sep 16 13:54 35 -> /var/lib/yum/history/history-2010-11-11.sqlite If I do the same thing on RHEL 7, then everything RPM and yum related is closed after clicking next on the last step. Might still be a bug in RHEL 6 though as our code obviously works fine on RHEL 7.
Urgh. yum manages to get itself into some convoluted cyclic dependency that Python cannot break. You can see this by doing gc.collect() and inspecting gc.garbage. Most definitely a bug in RHEL somewhere. Fortunately there is a workaround. Calling close() and closeRpmDB() breaks the cycle.
Reproduced the main problem installing 4.4.0 on rhel6 without nfs-utils and python-ldap. Were installation of python-ldap fails. Upgraded to 4.4.0 build 4889, uninstalled nfs-utils and python-ldap, rerun tl-setup and verified that the package installation went trough as expected. All good, closing.