Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after system crash opensnitch-ui wont start because db is corrupted #460

Closed
themighty1 opened this issue Jul 19, 2021 · 3 comments
Closed

Comments

@themighty1
Copy link
Contributor

My machine crashed, upon restart opensnitch-ui gives:

Loading translations: /usr/local/lib/python3.8/dist-packages/opensnitch/i18n locale: en_US
QSqlQuery::value: not positioned on a valid record
None setQuery() exception: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
setQuery() error: database disk image is malformed Unable to execute statement
Segmentation fault (core dumped)

I manually deleted the db file on disk and successfully restarted opensnitch-ui.

Maybe there should be an info popup saying sth like "db file /tmp/file.db is corrupted. pls remove and try again"

@themighty1 themighty1 changed the title after system crash opensnitch wont start because db is corrupted after system crash opensnitch-ui wont start because db is corrupted Jul 19, 2021
@gustavo-iniguez-goya
Copy link
Collaborator

hey,

Yeah, besides showing a pop-up if the DB is corrupted, we could set some flags to ON if the DB file is gonna be written to disk:
PRAGMA journal_mode = ON
PRAGMA synchronous = ON

they're set to off now, I didn't take it into account when allowing to write events to disk.

By the way, can you recover to DB with: sqlite3 file.db ".recover" | sqlite3 new.db ?

@themighty1
Copy link
Contributor Author

oops, already releted the corrupted db, sorry

@gustavo-iniguez-goya
Copy link
Collaborator

@themighty1 what would be a good message for the warning dialog?

"The DB is corrupted and it's not safe to continue. Remove, backup or recover the file before continue."

I just tried sqlite3 corrupted.db .recover | sqlite3 new.db and works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants