omemo / gajim-omemo

Gajim plugin for OMEMO Multi-End Message and Object Encryption
86 stars 7 forks source link

Cannot send message to any contact #117

Closed RalfJung closed 8 years ago

RalfJung commented 8 years ago

General information

Before opening an issue, please read our Wiki

The message should be sent. Instead, I get an error:

Traceback (most recent call last):
  File "/home/r/src/gajim/src/chat_control.py", line 797, in _on_message_textview_mykeypress_event
    self.send_message(message, xhtml=xhtml) # send the message
  File "/home/r/.local/share/gajim/plugins/omemo/ui.py", line 148, in omemo_send_message
    self.new_fingerprints_available()
  File "/home/r/.local/share/gajim/plugins/omemo/ui.py", line 194, in new_fingerprints_available
    fingerprints = self.state.store.getNewFingerprints(self.contact.jid)
  File "/home/r/.local/share/gajim/plugins/omemo/omemo/liteaxolotlstore.py", line 100, in getNewFingerprints
    return self.identityKeyStore.getNewFingerprints(jid)
  File "/home/r/.local/share/gajim/plugins/omemo/omemo/liteidentitykeystore.py", line 152, in getNewFingerprints
    for row in c.execute(q, (jid,)):
OperationalError: no such column: shown

I suspect some DB file around here is outdated... but the plugin should really take care of the necessary migrations itself, instead of making Gajim unusable.

lovetox commented 8 years ago

hm i dont know really why this happend

the migration is taken care by the plugin

this is the migration code

DROP TABLE signed_prekeys;
                CREATE TABLE IF NOT EXISTS signed_prekeys (
                    _id INTEGER PRIMARY KEY AUTOINCREMENT,
                    prekey_id INTEGER UNIQUE,
                    timestamp NUMERIC DEFAULT CURRENT_TIMESTAMP, record BLOB);
                ALTER TABLE identities ADD COLUMN shown INTEGER DEFAULT 0;
                UPDATE identities SET shown = 1;

maybe you can look what didnt go through here in your db

you also should set PRAGMA user_version=5 when you are finished.

or you delete the db and start new, this would trigger a new key generated, your contact would have to trust a new fingerprint

RalfJung commented 8 years ago

I changed user_version(self.dbConn) < 5 to user_version(self.dbConn) <= 5, restarted Gajim, changed it back, restarted Gajim again -- now things are working. Strange...