This object is in archive! 

Locus Map Pro crashes on startup

Wojciech Rygielski shared this problem 3 years ago
Solved

Hello Minion,

I suspect that my database got corrupted somehow. Locus crashes immediately after starting it. Could you advise how to recover without deleting my data?

Uploading some stack traces from ADB here: https://gist.github.com/wrygiel/0f3338c5a33458e763f9b0cf44410c90

Let me know id there's some other useful artifact which I can upload to help with debugging.

Replies (5)

photo
1

Applied a crude fix - deleted the `tracks.db-journal` file. Now it starts fine, and most of my last track is still there!

I'm not much familiar with the structure of sqlite database and journals. Hopefully deleting the journal is safe enough for the database to end up in a consistent state...

photo
1

Hello Wojciech,

I'm surprised to see that a) you find out where is stored app database and that it may cause a problem and b) deleting of journal file helped!

Yes it is safe to delete it but I never read that it helped anyone, nice. Anyway next time, we have a topic for this problem here or you may send a database to us and I'll try to fix it.

Jiří M. aka Menion

photo
1

Hi Menion! Thanks! The instructions you linked are much better than what I tried. I didn't even notice that Locus does an automatic backup!

I have an important follow-up, mostly for future readers, who might want to retry what I did.

A couple of days later I noticed that my procedure was far from perfect. While my last track was indeed saved, most of the previous ones (~500 of them!) had completely disappeared. Today I managed to restore them from a previous backup (I have set up Resilio Sync to back up all files from `Locus/data` directory up to my PC, and I was able to restore the entire state of the directory from a couple of days earlier, but probably `Locus/backup/auto` would have worked too for that). I then merged the two database states by exporting one of them to a GPX file, and them importing it into the another DB.

So, anyway: I recommend for all future readers to NOT do what I did above (delete the journal file). Instead follow up on what Menion linked above.

photo
1

BTW, if you have many requests like that, then perhaps it might be a good idea to try..catch `SQLiteReadOnlyDatabaseException` on init, and if it occurs, redirect the user to https://docs.locusmap.app/doku.php?id=manual:faq:problems_points_tracks_database. It's a great page, but it's not so easy to google it :)

photo
1

Hello Wojciech,

uff, perfect! Interesting is, that in case, app detect a problem with reading or writing into the database, it SHOULD display a small dialog with possible solutions and also with link to mentioned web page. Hmm...

Anyway, I'm really glad you had solved it. There isn't a many people who write us about this disaster, but still, may once or twice per month, it happens. Also because of this, Gold subscription (I know, only Gold) contains full automatic sync of data to our web server, so this problem should not be a problem anymore.

Anyway, automatic backups and keeping of backup zip files safe, it a good solution as well!

Enjoy the summer,

Jiří M. aka Menion

Replies have been locked on this page!