nhachicha / SnappyDB

A key-value database for Android
1.78k stars 220 forks source link

Failed to open/create database: Corruption: CURRENT file does not end with newline #60

Open palevomr opened 9 years ago

palevomr commented 9 years ago

After a couple of days, app could not get access to snappyDB as it throws next exception.

/System.err(21591): Caused by: com.snappydb.SnappydbException: Failed to open/create database: Corruption: CURRENT file does not end with newline W/System.err(21591): at com.snappydb.internal.DBImpl.__open(Native Method) W/System.err(21591): at com.snappydb.internal.DBImpl.(DBImpl.java:53) W/System.err(21591): at com.snappydb.DBFactory.open(DBFactory.java:40) W/System.err(21591): at com.snappydb.DBFactory.open(DBFactory.java:65) W/System.err(21591): at com.snappydb.DBFactory.open(DBFactory.java:77)

Using the last version of snappyDB(0.5.2)

For now, was reproduced three times on Fly IQ4410 Quad Android 4.2.1

LouisCAD commented 9 years ago

Did you force shutdown the device or force stop your app while it was maybe writing data?

tadas-subonis commented 9 years ago

This happened to me as well. Is there a way to avoid having that?

LouisCAD commented 9 years ago

Can you give more details? Was the db saved in default internal directory, or was it elsewhere? Was the phone forced shutdown? Was it's battery removed while on? Was the app force closed, by hand or by crash? On which phone? Android version? Do you know any steps to reproduce? Can you provide a code snippet?