Comment 3 for bug 1588811

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

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 --systemd-activation
whoopsie 761 0.0 0.0 523012 4500 ? Ssl May18 0:03 /usr/bin/whoopsie -f
bevand10 3393 0.0 0.2 690548 17184 ? Sl May18 1:01 /usr/bin/python3 /usr/bin/blueman-applet
bevand10 3396 0.0 0.0 850232 7624 ? Ssl May18 1:01 /usr/bin/python3 /usr/bin/hp-systray -x
bevand10 3514 0.0 0.5 2953468 45556 ? Ssl May18 12:37 /home/bevand10/.dropbox-dist/dropbox-lnx.x86_64-3.20.1/dropbox
bevand10 3657 0.0 0.0 244116 3876 ? Sl May18 10:17 /usr/bin/python3 /usr/bin/hp-systray -x
bevand10 3660 0.0 0.0 145904 152 ? S May18 1:01 /usr/bin/python3 /usr/bin/hp-systray -x
bevand10 27701 2.6 0.6 366088 54628 ? Sl 16:26 0:05 /usr/bin/python3 /usr/share/oneconf/oneconf-service
bevand10 28008 0.0 0.0 14232 944 pts/3 S+ 16:29 0:00 grep -E --color=auto op|py

So next time I run up openlp I answer Yes to the continue? prompt. I see the warning about no .sqlite song database, and after acknowledging, the interface loads, but, understandably given the error message, without a songs widget.

The last hour or so has been the following fun, fun, fun:

1) Purge the from-repo openlp (2.4.1), and instead, download and install (dpkg -i) the 13 May deb from https://launchpad.net/~openlp-core/+archive/ubuntu/release/+packages

2) Purge python3-pymysql and install the package-suggested python3-mysql.connector.

3) Keep db%20type=mysql in config.

4) Start openlp. Instant crash (module pymysql not found).

5) Purge python3.mysql-connector. Install python3-pymsyql.

6) Start openlp. No instant crash. Now have "no song sqlite database found".

7) Verify MySQL connectivity (mysql -uopenlp -popenlp -h127.0.0.1 openlp) - is fine.

8) Update config, db%20type=sqlite.

9) Start openlp. Is successful.

10) Stop openlp and switch db%20type=mysql.

11) Load mysql and drop all existing tables (from a 2014 install, not sure exactly which version).

12) Start openlp. This time, faced with an empty database, openlp starts successfully.

13) Load mysql. See that a new set of tables has been created.

13) apt-get purge python3-pymysql && apt-get install python3-mysql.connector

13) Start openlp. Broken - import pymysql fails.

14) apt-get purge python3-mysql.connector && apt-get install python3-pymysql

14) Start openlp. Success.

My conclusions today:

1) In 2.4.1 series (debian release, not tested elsewhere), mysql-mode-from-a-previous-release support/upgrade is broken. Maybe it's never supposed to work. The "sqlite song database not found" message is misleading, and doesn't lead the user to understand the real problem.

2) In the 2.4.1 series debian control file, the suggested python3-mysql.connector will not work, at all. One /has/ to install python3.pymsql to avoid a fatal error.

--d.