mozilla-lockwise / lockwise-android

Firefox's Lockwise app for Android
https://mozilla-lockwise.github.io/lockwise-android/
Mozilla Public License 2.0
623 stars 104 forks source link

Crash at startup when account isn't in a good state #838

Open mhammond opened 5 years ago

mhammond commented 5 years ago

Steps to reproduce

I think that all you need to do here is configure Lockwise and close it. Then, on another device, change the account password or delete the account. Then restart lockwise.

I reproduced in an emulator when HEAD was 3942f6b6def87c07eb10e4badc15dfd9617f7d33. In the log output I see the output below. The crash happens here because support.syncConfig is null. I spent a little time digging into how to best detect this but didn't have much success, so over to you :)

W/fxa_client::ffi: Authentication error: Error(

    Remote server error: '401' '110' 'Unauthorized' 'Invalid authentication token in request signature' 'https://github.com/mozilla/fxa/blob/master/packages/fxa-auth-server/docs/api.md#response-format')
W/FirefoxAccount: Auth error while running: get access token
I/Adjust: Google Play Services Advertising ID read correctly at start time
E/mozilla.lockbo: No package ID ff found for ID 0xffffffff.
I/chatty: uid=10092(mozilla.lockbox) identical 1 line
E/mozilla.lockbo: No package ID ff found for ID 0xffffffff.
D/EGL_emulation: eglMakeCurrent: 0xd35dc900: ver 3 0 (tinfo 0xd3855150)
I/Adjust: Session tracked
I/AppServices: Using logins_ffi_lib_name: lockbox
D/logins_ffi: sync15_passwords_state_new
D/logins_ffi: sync15_passwords_get_all
D/logins_ffi: sync15_passwords_get_all
W/System.err: io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | null
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
        at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:67)
        at com.jakewharton.rxrelay2.ReplayRelay$SizeBoundReplayBuffer.replay(ReplayRelay.java:637)
        at com.jakewharton.rxrelay2.ReplayRelay.accept(ReplayRelay.java:220)
        at mozilla.lockbox.store.DataStore$unlockInternal$4.invoke(DataStore.kt:205)
        at mozilla.lockbox.store.DataStore$unlockInternal$4.invoke(DataStore.kt:39)
        at mozilla.lockbox.store.DataStore$sam$io_reactivex_functions_Consumer$0.accept(Unknown Source:21)
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
        at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
        at io.reactivex.internal.operators.observable.ObservableTake$TakeObserver.onNext(ObservableTake.java:64)
        at io.reactivex.internal.operators.observable.ObservableSkip$SkipObserver.onNext(ObservableSkip.java:56)
        at io.reactivex.internal.operators.observable.ObservableDoOnEach$DoOnEachObserver.onNext(ObservableDoOnEach.java:101)
        at io.reactivex.internal.operators.observable.ObservableSwitchMap$SwitchMapObserver.drain(ObservableSwitchMap.java:297)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableSwitchMap$SwitchMapInnerObserver.onNext(ObservableSwitchMap.java:374)
        at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.test(BehaviorRelay.java:354)
        at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.emitNext(BehaviorRelay.java:348)
        at com.jakewharton.rxrelay2.BehaviorRelay.accept(BehaviorRelay.java:127)
        at mozilla.lockbox.store.DataStore$updateList$1.invoke(DataStore.kt:279)
        at mozilla.lockbox.store.DataStore$updateList$1.invoke(DataStore.kt:39)
        at mozilla.lockbox.store.DataStore$sam$io_reactivex_functions_Consumer$0.accept(Unknown Source:21)
        at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
        at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(SingleCreate.java:67)
        at kotlinx.coroutines.rx2.RxSingleCoroutine.onCompleted(RxSingle.kt:45)
        at kotlinx.coroutines.AbstractCoroutine.onCompletionInternal(AbstractCoroutine.kt:102)
        at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:274)
        at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:784)
        at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:764)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)
W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)
    Caused by: kotlin.KotlinNullPointerException
        at mozilla.lockbox.store.DataStore.sync(DataStore.kt:243)
        at mozilla.lockbox.store.DataStore.syncIfRequired(DataStore.kt:232)
        at mozilla.lockbox.store.DataStore.access$syncIfRequired(DataStore.kt:39)
        at mozilla.lockbox.store.DataStore$1.accept(DataStore.kt:94)
        at mozilla.lockbox.store.DataStore$1.accept(DataStore.kt:39)
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
        ... 31 more
D/io.sentry.android.event.helper.AndroidEventBuilderHelper: Proguard UUIDs file not found.
W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
    SLF4J: Defaulting to no-operation MDCAdapter implementation.
W/System.err: SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-3
    Process: mozilla.lockbox, PID: 24665
    io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | null
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
        at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:67)
        at com.jakewharton.rxrelay2.ReplayRelay$SizeBoundReplayBuffer.replay(ReplayRelay.java:637)
        at com.jakewharton.rxrelay2.ReplayRelay.accept(ReplayRelay.java:220)
        at mozilla.lockbox.store.DataStore$unlockInternal$4.invoke(DataStore.kt:205)
        at mozilla.lockbox.store.DataStore$unlockInternal$4.invoke(DataStore.kt:39)
        at mozilla.lockbox.store.DataStore$sam$io_reactivex_functions_Consumer$0.accept(Unknown Source:21)
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
        at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
        at io.reactivex.internal.operators.observable.ObservableTake$TakeObserver.onNext(ObservableTake.java:64)
        at io.reactivex.internal.operators.observable.ObservableSkip$SkipObserver.onNext(ObservableSkip.java:56)
        at io.reactivex.internal.operators.observable.ObservableDoOnEach$DoOnEachObserver.onNext(ObservableDoOnEach.java:101)
        at io.reactivex.internal.operators.observable.ObservableSwitchMap$SwitchMapObserver.drain(ObservableSwitchMap.java:297)
        at io.reactivex.internal.operators.observable.ObservableSwitchMap$SwitchMapInnerObserver.onNext(ObservableSwitchMap.java:374)
        at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.test(BehaviorRelay.java:354)
        at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.emitNext(BehaviorRelay.java:348)
        at com.jakewharton.rxrelay2.BehaviorRelay.accept(BehaviorRelay.java:127)
        at mozilla.lockbox.store.DataStore$updateList$1.invoke(DataStore.kt:279)
        at mozilla.lockbox.store.DataStore$updateList$1.invoke(DataStore.kt:39)
        at mozilla.lockbox.store.DataStore$sam$io_reactivex_functions_Consumer$0.accept(Unknown Source:21)
        at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
        at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(SingleCreate.java:67)
        at kotlinx.coroutines.rx2.RxSingleCoroutine.onCompleted(RxSingle.kt:45)
        at kotlinx.coroutines.AbstractCoroutine.onCompletionInternal(AbstractCoroutine.kt:102)
        at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:274)
        at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:784)
        at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:764)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)
     Caused by: kotlin.KotlinNullPointerException
        at mozilla.lockbox.store.DataStore.sync(DataStore.kt:243)
        at mozilla.lockbox.store.DataStore.syncIfRequired(DataStore.kt:232)
        at mozilla.lockbox.store.DataStore.access$syncIfRequired(DataStore.kt:39)
        at mozilla.lockbox.store.DataStore$1.accept(DataStore.kt:94)
        at mozilla.lockbox.store.DataStore$1.accept(DataStore.kt:39)
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
        at com.jakewharton.rxrelay2.ReplayRelay$SizeBoundReplayBuffer.replay(ReplayRelay.java:637) 
        at com.jakewharton.rxrelay2.ReplayRelay.accept(ReplayRelay.java:220) 
        at mozilla.lockbox.store.DataStore$unlockInternal$4.invoke(DataStore.kt:205) 
        at mozilla.lockbox.store.DataStore$unlockInternal$4.invoke(DataStore.kt:39) 
        at mozilla.lockbox.store.DataStore$sam$io_reactivex_functions_Consumer$0.accept(Unknown Source:21) 
        at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63) 
        at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62) 
        at io.reactivex.internal.operators.observable.ObservableTake$TakeObserver.onNext(ObservableTake.java:64) 
        at io.reactivex.internal.operators.observable.ObservableSkip$SkipObserver.onNext(ObservableSkip.java:56) 
        at io.reactivex.internal.operators.observable.ObservableDoOnEach$DoOnEachObserver.onNext(ObservableDoOnEach.java:101) 
        at io.reactivex.internal.operators.observable.ObservableSwitchMap$SwitchMapObserver.drain(ObservableSwitchMap.java:297) 
        at io.reactivex.internal.operators.observable.ObservableSwitchMap$SwitchMapInnerObserver.onNext(ObservableSwitchMap.java:374) 
        at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.test(BehaviorRelay.java:354) 
        at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.emitNext(BehaviorRelay.java:348) 
        at com.jakewharton.rxrelay2.BehaviorRelay.accept(BehaviorRelay.java:127) 
        at mozilla.lockbox.store.DataStore$updateList$1.invoke(DataStore.kt:279) 
        at mozilla.lockbox.store.DataStore$updateList$1.invoke(DataStore.kt:39) 
        at mozilla.lockbox.store.DataStore$sam$io_reactivex_functions_Consumer$0.accept(Unknown Source:21) 
        at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62) 
        at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(SingleCreate.java:67) 
        at kotlinx.coroutines.rx2.RxSingleCoroutine.onCompleted(RxSingle.kt:45) 
        at kotlinx.coroutines.AbstractCoroutine.onCompletionInternal(AbstractCoroutine.kt:102) 
        at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:274) 
        at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:784) 
        at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:764) 
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111) 
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) 
        at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) 
I/Process: Sending signal. PID: 24665 SIG: 9
Application terminated.
eliserichards commented 5 years ago

Thanks @mhammond!