#3761 closed defect (fixed)
After reboot I am no longer able to chat with a user
| Reported by: | patrys | Owned by: | asterix |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 |
| Component: | None | Version: | 0.11.4 |
| Severity: | major | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | OS: | All |
Description
Just minutes ago we had a power outage, it seems that resulted in sqlite not being able to flush log files properly. Now when trying to continue the conversation I get a traceback and no chat window opens:
Traceback (most recent call last):
File "/usr/share/gajim/src/dialogs.py", line 1057, in on_okbutton_clicked
self.ok_handler(user_input)
File "/usr/share/gajim/src/dialogs.py", line 1332, in new_chat_response
gajim.interface.roster.new_chat_from_jid(self.account, jid)
File "/usr/share/gajim/src/roster_window.py", line 3117, in new_chat_from_jid
self.new_chat(contact, account, resource = resource)
File "/usr/share/gajim/src/roster_window.py", line 3095, in new_chat
chat_control = ChatControl(mw, contact, account, resource)
File "/usr/share/gajim/src/chat_control.py", line 944, in __init__
self.restore_conversation()
File "/usr/share/gajim/src/chat_control.py", line 1680, in restore_conversation
pending_how_many, timeout, self.account)
File "/usr/share/gajim/src/common/logger.py", line 444, in get_last_conversation_lines
timed_out, restore_how_many_rows, pending_how_many)
sqlite3.DatabaseError: database disk image is malformed
While I might be able to fix it manually, an average Jane in the street won't. Please make Gajim catch such exceptions and either fix the DB automatically or just tell the user what happened and suggest some way of fixing (even if that means "remove the whole history"). Unless you launch Gajim from a terminal there is no way to tell what takes the chat window so long to open (it actually never opens to confuse the user even further).
Change History (5)
comment:1 Changed 7 years ago by asterix
- Milestone set to 0.12
comment:2 Changed 7 years ago by asterix
- Resolution set to fixed
- Status changed from new to closed
(In [b05179885be731d8233a35b9740a58abdf1119ec]) Warn user when database is corrupted and unreadable. Fixes #3761
comment:3 follow-ups: ↓ 4 ↓ 5 Changed 6 years ago by booiiing
hi all,
to repair a broken sqlite(3)-database, simply do:
sqlite3 broken.db .dump | sqlite3 repaired.db
regards,
booiiing
comment:4 in reply to: ↑ 3 Changed 6 years ago by patrys
Replying to booiiing:
hi all,
to repair a broken sqlite(3)-database, simply do:
sqlite3 broken.db .dump | sqlite3 repaired.db
Except this won't work for a *broken* database (where DB died in the middle of a commit and thus both records and index are broken).
comment:5 in reply to: ↑ 3 Changed 5 years ago by https://www.google.com/accounts/o8/id?id=AItOawkYehnW8LzjQ3fKm7S3bPHZmV6om_b2MRI
Replying to booiiing:
to repair a broken sqlite(3)-database, simply do:
sqlite3 broken.db .dump | sqlite3 repaired.db
Works for me, thx!

is there a way to fix the DB? I don't know it. The only thing I can think is to remove logs.db file. Someone knows a better way?
I have the code ready, just the message shown to user has to be improved according to this answer.