First-run crash, Ubuntu 16.04

Bug #1588811 reported by Dave Bevan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Expired
Undecided
Unassigned

Bug Description

Can't commit - no permission. So...

------------------------------------------------------------
revno: 75
committer: <hidden>
branch nick: debian-package
timestamp: Fri 2016-06-03 13:33:52 +0100
message:
  Installation/runtime bug found on Ubuntu 16.04. While openlp depends on python3-sqlalchemy, python3-sqlalchemy only /suggests/ python3-pymysql.

  Since you expressly require MySQL support (I had a first-run crash - see below), my fix below expressly adds the pymysql package as a depends in openlp rather than accepting the sqlalchemy, more relaxed, suggests.

  I was able to debug as I'm an experience linux dev and packager. It's my expectation that many less experienced (perhaps not professional Linux) users wouldn't have a clue.

  ===============================================

  **OpenLP Bug Report**
  Version: {'build': None, 'version': '2.4', 'full': '2.4'}

  --- Details of the Exception. ---

First-run crash. I now know that prior MySQL use was not the factor in this crash - it was the missing python3-pymysql dependency.

<PleaseIgnore>
  Initial start of OpenLP 2.4-1 on a system that had a previous install.

  The previous install was configured to use MySQL as it's backing database (we have a network MySQL server install at our church which has a separate web front-end that all
ows worship planners to search the OpenLP song database for content).
</PleaseIgnore>

   --- Exception Traceback ---
  Traceback (most recent call last):
    File "/usr/bin/openlp", line 44, in <module>
      main()
    File "/usr/share/openlp/openlp/core/__init__.py", line 391, in main
      sys.exit(application.run(qt_args))
    File "/usr/share/openlp/openlp/core/__init__.py", line 142, in run
      Registry().execute('bootstrap_initialise')
    File "/usr/share/openlp/openlp/core/common/registry.py", line 137, in execute
      result = function(*args, **kwargs)
    File "/usr/share/openlp/openlp/core/lib/pluginmanager.py", line 54, in bootstrap_initialise
      self.find_plugins()
    File "/usr/share/openlp/openlp/core/lib/pluginmanager.py", line 102, in find_plugins
      plugin = p()
    File "/usr/share/openlp/openlp/plugins/songs/songsplugin.py", line 84, in __init__
      self.manager = Manager('songs', init_schema, upgrade_mod=upgrade)
    File "/usr/share/openlp/openlp/core/lib/db.py", line 238, in __init__
      db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod)
    File "/usr/share/openlp/openlp/core/lib/db.py", line 130, in upgrade_db
      session, metadata = init_db(url)
    File "/usr/share/openlp/openlp/core/lib/db.py", line 53, in init_db
      engine = create_engine(url, poolclass=NullPool)
    File "/usr/lib/python3/dist-packages/sqlalchemy/engine/__init__.py", line 386, in create_engine
      return strategy.create(*args, **kwargs)
    File "/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 75, in create
      dbapi = dialect_cls.dbapi(**dbapi_args)
    File "/usr/lib/python3/dist-packages/sqlalchemy/dialects/mysql/pymysql.py", line 49, in dbapi
      return __import__('pymysql')
    File "/usr/lib/python3/dist-packages/uno.py", line 268, in _uno_import
      return _g_delegatee( name, *optargs, **kwargs )
  ImportError: No module named 'pymysql'

  --- System information ---
  Platform: Linux-4.4.0-22-generic-x86_64-with-Ubuntu-16.04-xenial
  Desktop: GNOME

  --- Library Versions ---
  Python: 3.5.1+
  Qt5: 5.5.1
  PyQt5: 5.5.1
  QtWebkit: 538.1
  SQLAlchemy: 1.0.11
  SQLAlchemy Migrate: -
  BeautifulSoup: 4.4.1
  lxml: 3.5.0
  Chardet: 2.3.0
  PyEnchant: 1.6.6
  Mako: 1.0.3
  pyICU: -
  pyUNO bridge: 5.1
  VLC: -
------------------------------------------------------------

Revision history for this message
Dave Bevan (dave-bevan) wrote :

$ diff control control-with-pymsql
32a33
> python3-pymysql,

description: updated
description: updated
Revision history for this message
Tomas Groth (tomasgroth) wrote :

I cannot reproduce this on ubuntu 16.04. I don't have pymysql install and OpenLP runs without issues, OpenLP does not expressly require MySQL support.
Are you /sure/ you disabled mysql use?
If you are, then this looks like a sqlalchemy issue to me.
Btw, OpenLP suggest "python3-mysql.connector" as dependency, not "python3-pymysql".

Revision history for this message
Dave Bevan (dave-bevan) wrote :
Download full text (5.9 KiB)

Cannot reproduce probably because your default database type isn't MySQL? I didn't disable mysql because I still want to use it.

I have the following in my config file:

[songs]
...
db%20type=mysql
...

My point is that MySQL is still a usable option, not deprecated (and I hope never deprecated as it's so useful), but the packaging is such that it causes these 1st-run fails for the unwary or unsuspecting. I'm pretty sure that pre 2.4 it was ok - actually, probably pre python3.

Even though I hand installed python3-pymysql, and the run error is no more, I'm now faced with a different fault dialog on start:

OpenLP cannot load your database.

Database: sqlite:////home/bevand10/.local/share/openlp/songs/songs.sqlite

I can hit 'ok' and the interface does load but with no songs widget.

On your last note, you suggest python3-mysql.connector. I purged pymysql and instead installed your dependency.

Doing that broke OpenLP completely - same error as before (the last line being the tell-tail)...

Traceback (most recent call last):
  File "/usr/bin/openlp", line 44, in <module>
    main()
  File "/usr/share/openlp/openlp/core/__init__.py", line 391, in main
    sys.exit(application.run(qt_args))
  File "/usr/share/openlp/openlp/core/__init__.py", line 142, in run
    Registry().execute('bootstrap_initialise')
  File "/usr/share/openlp/openlp/core/common/registry.py", line 137, in execute
    result = function(*args, **kwargs)
  File "/usr/share/openlp/openlp/core/lib/pluginmanager.py", line 54, in bootstrap_initialise
    self.find_plugins()
  File "/usr/share/openlp/openlp/core/lib/pluginmanager.py", line 102, in find_plugins
    plugin = p()
  File "/usr/share/openlp/openlp/plugins/songs/songsplugin.py", line 84, in __init__
    self.manager = Manager('songs', init_schema, upgrade_mod=upgrade)
  File "/usr/share/openlp/openlp/core/lib/db.py", line 238, in __init__
    db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod)
  File "/usr/share/openlp/openlp/core/lib/db.py", line 130, in upgrade_db
    session, metadata = init_db(url)
  File "/usr/share/openlp/openlp/core/lib/db.py", line 53, in init_db
    engine = create_engine(url, poolclass=NullPool)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/__init__.py", line 386, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 75, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/lib/python3/dist-packages/sqlalchemy/dialects/mysql/pymysql.py", line 49, in dbapi
    return __import__('pymysql')
  File "/usr/lib/python3/dist-packages/uno.py", line 268, in _uno_import
    return _g_delegatee( name, *optargs, **kwargs )
ImportError: No module named 'pymysql'

So after the crash, a purge of the mysql.connector deb and re-instate of the pymysql, and starting openlp, it no longer crashes and burns as above. I face an Error pop-up "OpenLP is already running. Do you wish to continue?". I hit no.

On checking I don't find an existing process:

$ ps aux|egrep "op|py"
message+ 695 0.0 0.0 84804 4860 ? Ss May18 16:35 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --...

Read more...

Revision history for this message
Tomas Groth (tomasgroth) wrote :

As you might have guessed I misunderstood part of your report. Since you called the mysql setup your previous setup, I assumed you didn't use mysql anymore.
Anyway, as mentioned OpenLP now uses mysql connector and therefore the db type must be "mysql+mysqlconnector". I hope that will help you.
Which OpenLP version did you use before?

Revision history for this message
Tomas Groth (tomasgroth) wrote :

Was this issue resolved by setting the db type to "mysql+mysqlconnector"?

Changed in openlp:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenLP because there has been no activity for 60 days.]

Changed in openlp:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.