pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.34k stars 234 forks source link

Caused by: io.paperdb.PaperDbException: Couldn't save table: school_id. Backed up table will be used on next read attempt #143

Closed tsdking closed 4 years ago

tsdking commented 5 years ago
Caused by: io.paperdb.PaperDbException: Couldn't save table: school_id. Backed up table will be used on next read attempt
    at io.paperdb.DbStoragePlainFile.writeTableFile(DbStoragePlainFile.java:264)
    at io.paperdb.DbStoragePlainFile.insert(DbStoragePlainFile.java:143)
    at io.paperdb.Book.write(Book.java:53)
        ...
    at android.app.Activity.performCreate(Activity.java:6904)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
    ... 12 more
Caused by: java.io.FileNotFoundException: /storage/emulated/0/databases/xxx.pt: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:452)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
    at io.paperdb.DbStoragePlainFile.writeTableFile(DbStoragePlainFile.java:244)
Manikandan92 commented 5 years ago

Android studio version: 3.4.2 Paper database version : 2.6 OS : Mac Testing device : Samsung, Sonimtech,Motorola, LGE

Non-fatal Exception: io.paperdb.PaperDbException: Couldn't save table: driverLog. Backed up table will be used on next read attempt

   at io.paperdb.DbStoragePlainFile.writeTableFile + 278(DbStoragePlainFile.java:278)
   at io.paperdb.DbStoragePlainFile.insert + 134(DbStoragePlainFile.java:134)
   at io.paperdb.Book.write + 42(Book.java:42)
   at com.fr.fleetrover.paperDatabase.PaperDB.setDriverLog + 314(PaperDB.java:314)
   at com.fr.fleetrover.eld.FRFleetOpsAPI.updateOdometerReading + 590(FRFleetOpsAPI.java:590)
   at com.fr.fleetrover.eld.FRFleetOpsAPI.processEventPackets + 307(FRFleetOpsAPI.java:307)
   at com.fr.fleetrover.eld.FRFleetOpsAPI.lambda$processFleetOpsResponse$67$FRFleetOpsAPI + 205(FRFleetOpsAPI.java:205)
   at com.fr.fleetrover.eld.FRFleetOpsAPI$$Lambda$0.run()
   at java.lang.Thread.run + 762(Thread.java:762)

Could you please let check it and let me know

dipankar08 commented 4 years ago

I have the same issue.

DarkAdventurer93 commented 4 years ago

I have the same issue. But I know why now. Becasue I use a invalid key , so you guys should check your key, it seems the key could not contains "/".

pilgr commented 4 years ago

Thanks, that's a good point. I've added a note to the readme. Since keys are used as file names to store the data, the special symbols like \ can't be used.

rmirabelle commented 3 years ago

Same error for me. Intermittent. My key is perfectly valid. 19 out of 20 saves work correctly, then bam. Clearly the synchronization lock for reading from/writing to the file intermittently fails. This is a big deal. I'm doing the read/write from various contexts - sometimes on Main, sometimes from coroutine (IO dispatcher), etc.