Crash upon using the OpenLP 2 importer with newer databases

Bug #863845 reported by Andreas Preikschat
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenLP
Fix Released
High
Raoul Snyman

Bug Description

Hello,

When you attempt to import a newer database with the OpenLP 2 importer, the following traceback is shown (this included the Russian sample songs database).

**OpenLP Bug Report**
Version: {u'full': u'1.9.7-bzr1765', u'version': u'1.9.7', u'build': u'bzr1765'}

--- Exception Traceback ---
Traceback (most recent call last):
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/ui/mainwindow.py", line 780, in onFirstTimeWizardClicked
    self.firstTime()
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/ui/mainwindow.py", line 752, in firstTime
    plugin.firstTime()
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/songsplugin.py", line 255, in firstTime
    importer.doImport()
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/lib/olpimport.py", line 127, in doImport
    source_meta.tables[u'media_files_songs']
KeyError: u'media_files_songs'

--- System information ---
Plattform: Linux-3.0-ARCH-i686-Intel-R-_Pentium-R-_4_CPU_1.80GHz-with-glibc2.0

--- Library Versions ---
Python: 2.7.2
Qt4: 4.7.4
Phonon: 4.5.55
PyQt4: 4.8.5
SQLAlchemy: 0.7.2
BeautifulSoup: 3.2.0
lxml: 2.3.0
Chardet: 2.0.1
PyEnchant: 1.6.3
PySQLite: 1.0.1

Related branches

Changed in openlp:
assignee: nobody → Raoul Snyman (raoul-snyman)
status: New → Confirmed
Changed in openlp:
status: Confirmed → Fix Committed
Changed in openlp:
status: Fix Committed → Fix Released
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

The song import still does not work with newer song databases (well only tested with the Russian song database in the First Time Wizard).

**OpenLP Bug Report**
Version: {u'full': u'1.9.7-bzr1812', u'version': u'1.9.7', u'build': u'bzr1812'}

 --- Exception Traceback ---
Traceback (most recent call last):
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/ui/mainwindow.py", line 783, in onFirstTimeWizardClicked
    self.firstTime()
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/ui/mainwindow.py", line 755, in firstTime
    plugin.firstTime()
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/songsplugin.py", line 255, in firstTime
    importer.doImport()
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/lib/olpimport.py", line 164, in doImport
    source_songs = self.sourceSession.query(OldSong).all()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py", line 113, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 917, in query
    return self._query_cls(entities, self, **kwargs)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 106, in __init__
    self._set_entities(entities)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 115, in _set_entities
    self._setup_aliasizers(self._entities)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 130, in _setup_aliasizers
    _entity_info(entity)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/util.py", line 476, in _entity_info
    mapperlib.configure_mappers()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/mapper.py", line 2742, in configure_mappers
    mapper._post_configure_properties()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/mapper.py", line 1048, in _post_configure_properties
    prop.init()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.py", line 121, in init
    self.do_init()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/properties.py", line 904, in do_init
    self._determine_joins()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/properties.py", line 1041, in _determine_joins
    % self)
ArgumentError: Could not determine join condition between parent/child tables on relationship OldSong.media_files. Specify a 'primaryjoin' expression. If 'secondary' is present, 'secondaryjoin' is needed as well.

--- System information ---
Platform: Linux-3.1.4-1-ARCH-i686-Intel-R-_Pentium-R-_4_CPU_1.80GHz-with-glibc2.0

--- Library Versions ---
Python: 2.7.2
Qt4: 4.7.4
Phonon: 4.5.1
PyQt4: 4.8.6
SQLAlchemy: 0.7.2
SQLAlchemy Migrate: 0.7.1
BeautifulSoup: 3.2.0
lxml: 2.3.1
Chardet: 2.0.1
PyEnchant: 1.6.5
PySQLite: 1.0.1
Mako: 0.5.0
pyUNO bridge: 3.4

Changed in openlp:
status: Fix Released → Confirmed
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :
tags: added: support-system
Changed in openlp:
status: Confirmed → Fix Committed
Changed in openlp:
status: Fix Committed → Fix Released
Revision history for this message
Rastislav Pecik (rapecik) wrote :

I have just tested the import and it seems it does not work well. I have tried it on the Ubuntu 11.10 machine with MySql backend (Mysql from standard Ubuntu repositories) and the import from the old sqlite database (that was used just before I have changed it to MySQL) has resulted into following error (I am using special Slovak characters in the songs). I have used the bazaar version 1823.

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openlp/core/ui/wizard.py", line 191, in onCurrentIdChanged
    self.performWizard()
  File "/usr/lib/pymodules/python2.7/openlp/plugins/songs/forms/songimportform.py", line 764, in performWizard
    importer.doImport()
  File "/usr/lib/pymodules/python2.7/openlp/plugins/songs/lib/olpimport.py", line 132, in doImport
    mapper(OldMediaFile, source_media_files_table)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/__init__.py", line 890, in mapper
    return Mapper(class_, local_table, *args, **params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 212, in __init__
    self._configure_pks()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 502, in _configure_pks
    (self, self.mapped_table.description))
ArgumentError: Mapper Mapper|OldMediaFile|media_files could not assemble any primary key columns for mapped table 'media_files'

Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

Rastislav:

This bug is already fixed. The fix will be available in the next release and the testing builds.

Regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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