System crashed, now Vienna won't open

An RSS/Atom newsreader with features comparable to commercial newsreaders.
Levy
Harmless
Posts: 3
Joined: Wed Aug 07, 2013 8:26 pm

System crashed, now Vienna won't open

Postby Levy » Wed Aug 07, 2013 8:29 pm

My system crashed this morning, and now when I try to open Vienna, the icon bounces once and the program doesn't start. In the Application Support, deleting the messages.db file fixes this, but I don't want to lose all my feeds. Is there any way to fix this? Any help would be greatly appreciated.

barijaona
Vienna Team
Posts: 633
Joined: Sat Nov 12, 2011 11:10 am
Contact:

Re: System crashed, now Vienna won't open

Postby barijaona » Thu Aug 08, 2013 1:15 am

Did you try deleting the Preferences file ? ~/Library/Preferences/uk.co.opencommunity.vienna2.plist
If the application launches after that, use the "Vienna->Reindex Database" menu command, then relaunch.

If the app does not launch at all, open a Terminal window. Navigate to ~/Library/Application Support/Vienna, then type the following :

Code: Select all

sqlite3 messages.db
reindex;
.quit


(be careful to ths semi-colon at the end of the second line, and the dot at the beginning of the third line). Then try relaunching Vienna
I contribute to Vienna RSS as a developer.
Please, don't forget those tips for writing a good bug report

Levy
Harmless
Posts: 3
Joined: Wed Aug 07, 2013 8:26 pm

Re: System crashed, now Vienna won't open

Postby Levy » Thu Aug 08, 2013 2:36 am

Tried to reindex. This is what I got. Also, deleting the preferences did nothing.

Code: Select all

MacBook-Pro:~ levy$ sqlite3 /Users/levy/Library/Application\ Support/Vienna/messages.db
SQLite version 3.7.10 2012-01-16 13:28:40
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> reindex;
Error: database disk image is malformed
sqlite> .quit

barijaona
Vienna Team
Posts: 633
Joined: Sat Nov 12, 2011 11:10 am
Contact:

Re: System crashed, now Vienna won't open

Postby barijaona » Thu Aug 08, 2013 4:47 am

Your database is badly damaged. You'd better restart from a new one.
If you don't have a backup, you can try to get your feeds with the following sqlite3 command in Terminal :

Code: Select all

select feed_url from rss_folders;
I contribute to Vienna RSS as a developer.
Please, don't forget those tips for writing a good bug report

Levy
Harmless
Posts: 3
Joined: Wed Aug 07, 2013 8:26 pm

Re: System crashed, now Vienna won't open

Postby Levy » Thu Aug 08, 2013 12:09 pm

barijaona wrote:Your database is badly damaged. You'd better restart from a new one.
If you don't have a backup, you can try to get your feeds with the following sqlite3 command in Terminal :

Code: Select all

select feed_url from rss_folders;


That was worth a shot...

Code: Select all

MacBook-Pro:~ levy$ sqlite3 /Users/levy/Library/Application\ Support/Vienna/messages.db
SQLite version 3.7.10 2012-01-16 13:28:40
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select feed_url from rss_folders;
Error: database disk image is malformed
sqlite> .quit


I can open it with TextEdit and see the names and some of the URLs of the feeds. That might be enough to collect them all again. Thanks anyway for you guy's help.

fractalart
Harmless
Posts: 2
Joined: Wed Sep 18, 2013 12:04 am

Re: System crashed, now Vienna won't open

Postby fractalart » Wed Sep 18, 2013 12:52 am

Levy,

I was having the exact same problem, but I was able to recover 98.9% of my messages.db database (and I think 100% of my subscriptions) by doing the following:

    1. Backup your messages.db file (just in case):

    Code: Select all

    me@mycomputer:~/Library/Application Support/Vienna$cp messages.db messages.db.BAK

    2. Dump the database into SQL text:

    Code: Select all

    me@mycomputer:~/Library/Application Support/Vienna$sqlite3 messages.db
    SQLite version 3.7.17 2013-05-20 00:56:22
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> .output sql.out
    sqlite> .dump
    sqlite> .quit

    3. Change the "ROLLBACK; -- due to errors" line to "COMMIT;" in sql.out:
      3.1. Last six lines of sql.out before change:

      Code: Select all

      me@mycomputer:~/Library/Application Support/Vienna$tail -n 6 sql.out
      /**** ERROR: (11) database disk image is malformed *****/
      /**** ERROR: (11) database disk image is malformed *****/
      CREATE INDEX messages_folder_idx on messages (folder_id);
      CREATE INDEX messages_message_idx on messages (message_id);
      CREATE INDEX rss_guids_idx on rss_guids (folder_id);
      ROLLBACK; -- due to errors

      3.2. Last six lines of sql.out after change:

      Code: Select all

      me@mycomputer:~/Library/Application Support/Vienna$tail -n 6 sql.out
      /**** ERROR: (11) database disk image is malformed *****/
      /**** ERROR: (11) database disk image is malformed *****/
      CREATE INDEX messages_folder_idx on messages (folder_id);
      CREATE INDEX messages_message_idx on messages (message_id);
      CREATE INDEX rss_guids_idx on rss_guids (folder_id);
      COMMIT;
    4. Rename messages.db to get it out of the way (but don't delete it, unless you made the backup and are happy with that):

    Code: Select all

    me@mycomputer:~/Library/Application Support/Vienna$mv messages.db messages.db.OLD

    5. Create new messages.db file and execute SQL commands from sql.out:

    Code: Select all

    me@mycomputer:~/Library/Application Support/Vienna$sqlite3 messages.db
    SQLite version 3.7.17 2013-05-20 00:56:22
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> .read sql.out

    sqlite> .quit

    6. Launch Vienna, and hope the process worked.
    7. If it worked, in Vienna, immediately go to 'File' --> 'Export Subscriptions' to make a backup in case this madness happens again.

Notes
    - Your experience may be totally different. It looks like the corruption in my database happened in a place that allowed the .dump command to export all the data I actually cared about (subscriptions and folder structure) before exiting out due to errors. If the corruption in your database is located elsewhere, it might render this process useless.
    - Make sure you backup your messages.db file in case this process fails and you need to comb through it with a text editor.
    - If this process works, and Vienna opens with all of your subscriptions in place, after you make a backup of your subscriptions, you might want to blow away the messages.db file, start fresh, and re-import your subscriptions backup.
      - My reasoning here is that I don't know what SQL optimizations (like indices) or other SQL magic got lost due to the corruption; so starting fresh and importing the subscriptions backup file allows Vienna to build a fresh database from scratch, restoring whatever SQL-specific stuff that may have been lost.
      - WARNING: If you start fresh and import subscriptions, any smart folders you had will be lost. It doesn't look like those are preserved when exporting subscriptions (although normal group folders can be preserved by checking the appropriate box during export). For that reason, I'm going to try using my recovered messages.db file as-is (from the numbered process above) and hope that any missing SQL indices and what-not won't have a negative impact.

I hope this helps! Good luck.

barijaona
Vienna Team
Posts: 633
Joined: Sat Nov 12, 2011 11:10 am
Contact:

Re: System crashed, now Vienna won't open

Postby barijaona » Thu Sep 19, 2013 7:48 am

Great piece of advice, @fractalart ! Thanks for this.

Your observations also give some clues regarding the origin of the problem.
I contribute to Vienna RSS as a developer.
Please, don't forget those tips for writing a good bug report

fractalart
Harmless
Posts: 2
Joined: Wed Sep 18, 2013 12:04 am

Re: System crashed, now Vienna won't open

Postby fractalart » Thu Sep 19, 2013 8:09 pm

barijaona wrote:Great piece of advice, @fractalart ! Thanks for this.

Your observations also give some clues regarding the origin of the problem.


You're welcome!

Clues? Do share. :-)

My computer has been having some serious issues lately. I think the GPU is going bad, but whatever it is, it crashes multiple times a week. I'm guessing it crashed right when Vienna was performing some kind of DB update, which caused the file to be corrupt.


Return to “Vienna”

Who is online

Users browsing this forum: Google Feedfetcher