can't open/preview a song if db connection is interrupted (mysql)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenLP |
New
|
Undecided
|
Unassigned | ||
Trunk |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Hi.
Discovered the following error if OpenLP looses a connection to MySQL.
Scenario: OpenLP configured to use MySQL instead of SQLite.
Environment: Ubuntu 10.04 LTS, localhost for MySQL.
On starting OpenLP, it holds open two connections to MySQL. These are seen as having growing 'sleep' durations in MySQL by executing "show process" whilst OpenLP is dormant/not using the DB.
If there is a connection issue, either due to a network timeout, or forced connection kill - of at least one of these two persistent connections, when opening/previewing a song in the GUI, the following debug is displayed:
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
serviceItem = self.buildServi
File "/usr/lib/
if self.generateSl
File "/usr/lib/
song = self.plugin.
File "/usr/lib/
return self.session.
File "/usr/lib/
return self._get(key, ident)
File "/usr/lib/
return q.all()[0]
File "/usr/lib/
return list(self)
File "/usr/lib/
return self._execute_
File "/usr/lib/
result = self.session.
File "/usr/lib/
clause, params or {})
File "/usr/lib/
return Connection.
File "/usr/lib/
parameters=
File "/usr/lib/
return dialect.
File "/usr/lib/
self.cursor = self.create_
File "/usr/lib/
return self._connectio
File "/usr/lib/
raise exc.InvalidRequ
InvalidRequestE
Note that this was initially seen after OpenLP was left running, and therefore connected to MySQL, overnight. After the overnight period, an attempt was made to open/preview a song and the above error was displayed. At this stage I don't know why the connections were closed - the server was localhost, the db uptime is days, and there was no laptop suspend during the overnight period.
Thoughts on why it can't reconnect correctly?
To recreate, configure OpenLP to use a MySQL database (not forgetting, on ubuntu, to install the package python-mysqldb otherwise you get "module not found" errors), and configuring the [songs] section for mysql, as described on the FAQ wiki page.
Then start OpenLP and observe output of "show process", or use the "processes" tab if using phpmyadmin to observe the database server. Kill one or both connections. Attempt to open/preview a song, and the result is as above.
npf@pc-n993019:~$ dpkg --list|grep openlp
ii openlp 1.9.12+
--d.
MySQL has a connection timeout, you can read more about it in the MySQL server manual.
There is nothing much we can do about this, we already take it into account and try to do the best considering the circumstances.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.