parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

Attempted to fetch an object offline which was never saved to the offline cache. #368

Open alexblack opened 8 years ago

alexblack commented 8 years ago

I'm trying out using the new setUnobservedExceptionHandler and I frequently see this logged now in my app:

 12:06:43.716 1124-1136/com.aadhk.woinvoice E/App: Bolts UnobservedTaskException
                                                        bolts.UnobservedTaskException: com.parse.ParseException: Attempted to fetch an object offline which was never saved to the offline cache.
                                                            at bolts.UnobservedErrorNotifier.finalize(UnobservedErrorNotifier.java:22)
                                                            at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191)
                                                            at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174)
                                                            at java.lang.Thread.run(Thread.java:818)
                                                         Caused by: com.parse.ParseException: Attempted to fetch an object offline which was never saved to the offline cache.
                                                            at com.parse.OfflineStore$11.then(OfflineStore.java:636)
                                                            at com.parse.OfflineStore$11.then(OfflineStore.java:626)
                                                            at bolts.Task$15.run(Task.java:917)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeAfterTask(Task.java:908)
                                                            at bolts.Task.continueWithTask(Task.java:715)
                                                            at bolts.Task.continueWithTask(Task.java:726)
                                                            at bolts.Task$13.then(Task.java:818)
                                                            at bolts.Task$13.then(Task.java:806)
                                                            at bolts.Task$15.run(Task.java:917)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeAfterTask(Task.java:908)
                                                            at bolts.Task.continueWithTask(Task.java:715)
                                                            at bolts.Task.continueWithTask(Task.java:690)
                                                            at bolts.Task.onSuccessTask(Task.java:806)
                                                            at bolts.Task.onSuccessTask(Task.java:796)
                                                            at bolts.Task.onSuccessTask(Task.java:830)
                                                            at com.parse.OfflineStore.fetchLocallyAsync(OfflineStore.java:626)
                                                            at com.parse.OfflineStore.saveLocallyAsync(OfflineStore.java:795)
                                                            at com.parse.OfflineStore.access$1800(OfflineStore.java:36)
                                                            at com.parse.OfflineStore$38.then(OfflineStore.java:1253)
                                                            at com.parse.OfflineStore$38.then(OfflineStore.java:1227)
                                                            at bolts.Task$15.run(Task.java:917)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeAfterTask(Task.java:908)
                                                            at bolts.Task.continueWithTask(Task.java:715)
                                                            at bolts.Task.continueWithTask(Task.java:726)
                                                            at bolts.Task$13.then(Task.java:818)
                                                            at bolts.Task$13.then(Task.java:806)
                                                            at bolts.Task$15.run(Task.java:917)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeAfterTask(Task.java:908)
                                                            at bolts.Task.access$100(Task.java:32)
                                                            at bolts.Task$11.then(Task.java:708)
                                                            at bolts.Task$11.then(Task.java:705)
                                                            at bolts.Task.runContinuations(Task.java:956)
                                                            at bolts.Task.trySetResult(Task.java:994)
                                                            at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39)
                                                            at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62)
                                                            at bolts.Task$15$1.then(Task.java:934)
                                                            at bolts.Task$15$1.then(Task.java:921)
                                                            at bolts.Task$14.run(Task.java:872)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeImmediately(Task.java:863)
                                                            at bolts.Task.continueWith(Task.java:661)
                                                            at bolts.Task.continueWith(Task.java:672)
                                                            at bolts.Task$15.run(Task.java:921)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeAfterTask(Task.java:908)
                                                            at bolts.Task.access$100(Task.java:32)
                                                            at bolts.Task$11.then(Task.java:708)
                                                            at bolts.Task$11.then(Task.java:705)
                                                            at bolts.Task.runContinuations(Task.java:956)
                                                            at bolts.Task.trySetResult(Task.java:994)
                                                            at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39)
                                                            at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62)
                                                            at bolts.Task$15$1.then(Task.java:934)
                                                            at bolts.Task$15$1.then(Task.java:921)
                                                            at bolts.Task$14.run(Task.java:872)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeImmediately(Task.java:863)
                                                            at bolts.Task.continueWith(Task.java:661)
                                                            at bolts.Task.continueWith(Task.java:672)
                                                            at bolts.Task$15.run(Task.java:921)
                                                            at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
                                                            at bolts.Task.completeAfterTask(Task.java:908)
                                                            at bolts.Task.access$100(Task.java:32)
                                                            at bolts.Task$11.then(Task.java:708)
                                                            at bolts.Task$11.then(Task.java:705)
                                                            at bolts.Task.runContinuations(Task.java:956)
                                                            at bolts.Task.trySetResult(Task.java:994)
                                                            at bolts.T

Is this a real problem? Or expected? Any suggestions on how I could track down its cause?

grantland commented 8 years ago

This is as expected. UnobservedExceptionHandler is new in Bolts and there are many places in our SDK that we purposely ignore exceptions in a continuation (generally with a comment, some without). There may be a point in which we want to clean them up to prevent them from showing in the handler, but it's not a priority.

adriancoman commented 5 years ago

The issue is still open, having the same problem, how can this be tracked down as the stacktrace is not helping at all.

Or at least give some more details, how does an object reach this state? Should the object pe pinned before saving?