lttrs-android icon indicating copy to clipboard operation
lttrs-android copied to clipboard

Null pointer exception causes updates to stop

Open SamWhited opened this issue 3 years ago • 5 comments

Similar to #37 I have recently had my fastmail account stop updating. Ltt.rs gives no indication that anything is wrong, manual refresh appears to work, etc. but no changes are ever made. I'm seeing a lot of null pointer exceptions in the logs:

01-26 10:02:53.665 15013 15038 I WM-WorkerWrapper: Worker result FAILURE for Work [ id=25713ddb-f6b0-43aa-8501-ce1f00586265, tags={ rs.ltt.android.worker.MainMailboxQueryRefreshWorker } ]
01-26 10:02:53.731 15013 15013 D lttrs   : r.l.a.r.QueryRepository: onItemAtEndLoaded(Ma8fa29a91b448f05e35d8f21)
01-26 10:02:53.799 15013 15041 I lttrs   : r.l.j.m.s.QueryService: Paging query EmailQuery{collapseThreads=true, filter=EmailFilterCondition{inMailbox=439187be-b3b8-4d08-affa-9c02beda87ec}, sort=[Comparator{property=receivedAt, isAscending=false, collation=null}]} after Ma8fa29a91b448f05e35d8f21
01-26 10:02:53.799 15013 15041 I lttrs   : r.l.j.m.s.QueryService: Refreshing query EmailQuery{collapseThreads=true, filter=EmailFilterCondition{inMailbox=439187be-b3b8-4d08-affa-9c02beda87ec}, sort=[Comparator{property=receivedAt, isAscending=false, collation=null}]}
01-26 10:02:53.799 15013 15041 I lttrs   : r.l.j.m.s.MailboxService: Refreshing mailboxes since state 15738075
01-26 10:02:53.800 15013 15041 I lttrs   : r.l.j.m.s.EmailService: Refreshing emails since state 15736899
01-26 10:02:53.800 15013 15041 I lttrs   : r.l.j.m.s.ThreadService: Refreshing threads since state 15738075
01-26 10:02:53.801 15013 15013 D lttrs   : r.l.a.r.QueryRepository: onItemAtEndLoaded(Ma8fa29a91b448f05e35d8f21)
01-26 10:02:53.801 15013 15013 D lttrs   : r.l.a.r.QueryRepository: skipping paging request since already running
01-26 10:02:55.497 15013 16306 D lttrs   : r.l.j.c.a.AbstractJmapApiClient: Notified of session state='cyrus-15105862;p-13'
01-26 10:02:55.503 15013 15041 D lttrs   : r.l.a.r.QueryRepository: error retrieving the next pagejava.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:4)
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:49)
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:1)
01-26 10:02:55.503 15013 15041 D lttrs   :      at rs.ltt.jmap.client.JmapClient$$ExternalSyntheticLambda3.apply(Unknown Source:90)
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:2)
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:9)
01-26 10:02:55.503 15013 15041 D lttrs   :      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-26 10:02:55.503 15013 15041 D lttrs   :      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-26 10:02:55.503 15013 15041 D lttrs   :      at java.lang.Thread.run(Thread.java:920)
01-26 10:02:55.503 15013 15041 D lttrs   : Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
01-26 10:02:55.503 15013 15041 D lttrs   :      at rs.ltt.autocrypt.jmap.AutocryptClient.processAutocryptHeader(AutocryptClient.java:3)
01-26 10:02:55.503 15013 15041 D lttrs   :      at rs.ltt.autocrypt.jmap.AutocryptPlugin$$ExternalSyntheticLambda2.onCacheEmail(Unknown Source:13)
01-26 10:02:55.503 15013 15041 D lttrs   :      at rs.ltt.jmap.mua.service.PluginService.executeEmailCacheStagePlugins(PluginService.java:3)
01-26 10:02:55.503 15013 15041 D lttrs   :      at rs.ltt.jmap.mua.service.EmailService$$ExternalSyntheticLambda0.call(Unknown Source:13)
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.CombinedFuture$AsyncCallableInterruptibleTask.runInterruptibly(CombinedFuture.java:1)
01-26 10:02:55.503 15013 15041 D lttrs   :      at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:4)
01-26 10:02:55.503 15013 15041 D lttrs   :      ... 3 common frames omitted
01-26 10:02:56.923 15013 15041 I lttrs   : r.l.j.m.s.QueryService: Refreshing query EmailQuery{collapseThreads=true, filter=EmailFilterCondition{inMailbox=439187be-b3b8-4d08-affa-9c02beda87ec}, sort=[Comparator{property=receivedAt, isAscending=false, collation=null}]}
01-26 10:02:56.923 15013 15041 I lttrs   : r.l.j.m.s.MailboxService: Refreshing mailboxes since state 15738075
01-26 10:02:56.924 15013 15041 I lttrs   : r.l.j.m.s.EmailService: Refreshing emails since state 15736899
01-26 10:02:56.924 15013 15041 I lttrs   : r.l.j.m.s.ThreadService: Refreshing threads since state 15738075
01-26 10:02:57.830 15013 16306 D lttrs   : r.l.j.c.a.AbstractJmapApiClient: Notified of session state='cyrus-15105862;p-13'
01-26 10:02:57.836 15013 15041 D lttrs   : r.l.a.r.QueryRepository: unable to refreshjava.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:4)
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:49)
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:1)
01-26 10:02:57.836 15013 15041 D lttrs   :      at rs.ltt.jmap.client.JmapClient$$ExternalSyntheticLambda3.apply(Unknown Source:90)
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:2)
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:9)
01-26 10:02:57.836 15013 15041 D lttrs   :      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-26 10:02:57.836 15013 15041 D lttrs   :      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-26 10:02:57.836 15013 15041 D lttrs   :      at java.lang.Thread.run(Thread.java:920)
01-26 10:02:57.836 15013 15041 D lttrs   : Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
01-26 10:02:57.836 15013 15041 D lttrs   :      at rs.ltt.autocrypt.jmap.AutocryptClient.processAutocryptHeader(AutocryptClient.java:3)
01-26 10:02:57.836 15013 15041 D lttrs   :      at rs.ltt.autocrypt.jmap.AutocryptPlugin$$ExternalSyntheticLambda2.onCacheEmail(Unknown Source:13)
01-26 10:02:57.836 15013 15041 D lttrs   :      at rs.ltt.jmap.mua.service.PluginService.executeEmailCacheStagePlugins(PluginService.java:3)
01-26 10:02:57.836 15013 15041 D lttrs   :      at rs.ltt.jmap.mua.service.EmailService$$ExternalSyntheticLambda0.call(Unknown Source:13)
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.CombinedFuture$AsyncCallableInterruptibleTask.runInterruptibly(CombinedFuture.java:1)
01-26 10:02:57.836 15013 15041 D lttrs   :      at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:4)
01-26 10:02:57.836 15013 15041 D lttrs   :      ... 3 common frames omitted

SamWhited avatar Jan 26 '22 15:01 SamWhited

Fixed here https://github.com/iNPUTmice/lttrs-autocrypt/commit/ab025ad3947c5f2c1d811f755a413fa1a2af741b (but Ltt.rs needs to bump the library version)

iNPUTmice avatar Jan 26 '22 15:01 iNPUTmice

Hi Sam,

thank your for reporting this. If you have a moment would you mind checking if current master fixes the issue? (Or if now that this is fixed we run into other problems further down the processing chain)

Our CI has debug builds here: https://github.com/iNPUTmice/lttrs-android/actions/runs/1755476653 if you don’t want to build this yourself.

iNPUTmice avatar Jan 27 '22 09:01 iNPUTmice

I tried installing that and got "Could not store account credentials" after I type my password and try to log in. The same now happens with the actual builds from the play store. I don't see anything that looks related in the logs. I closed ltt.rs and opened it though and it looks like the account has been added once for every time I clicked "Next" or "Login" or whatever and I have 5 copies of it in the sidebar.

It does appear that it's working again, but it also appears to be working using the play store version (after re-installing), so whatever email was causing the problem may have already been deleted.

SamWhited avatar Jan 27 '22 11:01 SamWhited

I've added more logging around the code in question. https://github.com/iNPUTmice/lttrs-android/actions/runs/1756425673

Probably something going wrong during retrieval of the Autocrypt Setup message but. I do however have no issues with my Fastmail account though.

iNPUTmice avatar Jan 27 '22 13:01 iNPUTmice

I also just got the "Could not store account credentials" message after the password prompt.

tobiasgrosser avatar Apr 08 '22 08:04 tobiasgrosser