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

Couldn't read/deserialize file Underflow Issue #134

Closed fahadtaric closed 6 years ago

fahadtaric commented 6 years ago

Hi,

I am getting this error from two months and I don't know why. I looked into similar issues you closed but the resolution is not available yet. Can you please help us with this?

Caused by com.esotericsoftware.kryo.KryoException: Buffer underflow. Serialization trace: singerName (com.packagename.Singers.SingersInfo) mContent (io.paperdb.PaperTable) at com.esotericsoftware.kryo.io.Input.require(SourceFile:199) at com.esotericsoftware.kryo.io.Input.readUtf8_slow(SourceFile:575) at com.esotericsoftware.kryo.io.Input.readUtf8(SourceFile:553) at com.esotericsoftware.kryo.io.Input.readString(SourceFile:483) at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.read(SourceFile:198) at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.read(SourceFile:187) at com.esotericsoftware.kryo.Kryo.readObjectOrNull(SourceFile:789) at com.esotericsoftware.kryo.serializers.ObjectField.read(SourceFile:132) at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(SourceFile:147) at com.esotericsoftware.kryo.Kryo.readClassAndObject(SourceFile:816) at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(SourceFile:134) at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(SourceFile:40) at com.esotericsoftware.kryo.Kryo.readObject(SourceFile:734) at com.esotericsoftware.kryo.serializers.ObjectField.read(SourceFile:125) at com.esotericsoftware.kryo.serializers.FieldSerializer.read(SourceFile:540) at com.esotericsoftware.kryo.Kryo.readObject(SourceFile:712) at io.paperdb.DbStoragePlainFile.readTableFile(SourceFile:248) at io.paperdb.DbStoragePlainFile.readTableFile(SourceFile:257) at io.paperdb.DbStoragePlainFile.readTableFile(SourceFile:235) at io.paperdb.DbStoragePlainFile.select(SourceFile:147) at io.paperdb.Book.read(SourceFile:67) at com.packagename.Application(SourceFile:508) at com.simplecity.amp_library.ui.activities.MainActivity.onCreate(SourceFile:465) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

pilgr commented 6 years ago

This is not a full stack trace, there is should be available a nested stack trace causing this error.

fahadtaric commented 6 years ago

I updated the stack trace. Is this you are looking for?

pilgr commented 6 years ago

what is the Paper DB version do you use? Is it reproducible for some users or 100% cases? Can you reproduce the issue?

fahadtaric commented 6 years ago

This issue was producing on v2.0. I upgraded to v2.6 today. This issue is hitting to 10-15% users when they newly installed the app or when they upgrade. I have tried to reproduce it but unsuccessful.

pilgr commented 6 years ago

Yes, the issue should be already fixed. Especially version 2.5 contained very important fixes. https://github.com/pilgr/Paper/releases/tag/2.5

pilgr commented 6 years ago

please reopen issue once you see it on the 2.6. thanks!

fahadtaric commented 6 years ago

Thank you. Hope so my nightmare goes off with the latest version. P.S I love Paper DB, you made our life easy. Thanks man.

naeemgul90 commented 5 years ago

Hi, The issue is still occuring in version 2.6.

Caused by com.esotericsoftware.kryo.KryoException: com.esotericsoftware.kryo.KryoException: Buffer underflow. Serialization trace: color (com.package.YoutubeArtistsData) mContent (io.paperdb.PaperTable) at com.esotericsoftware.kryo.serializers.ObjectField$ObjectIntField.read(ObjectField.java:201) at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:145) at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:816) at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:734) at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543) at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:712) at io.paperdb.DbStoragePlainFile.readContent(DbStoragePlainFile.java:307) at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:291) at io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:158) at io.paperdb.Book.read(Book.java:73) at com.package..MusicApplication$Companion.fetchYouTubeArtistsData(MusicApplication.java:492) at com.package.MusicApplication$Companion.fetchYouTubeData(MusicApplication.java:501) at com.package.MusicApplication$Companion.fetchInformationFromAws(MusicApplication.java:461) at com.package.MusicApplication.onCreate(MusicApplication.java:174) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4701) at android.app.ActivityThread.access$1500(ActivityThread.java:162) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1410) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5431) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)

musso commented 5 years ago

Same here. Still occuring in version 2.6.