Skip to content

Crash with "Active account not logged in" #3706

@gnprice

Description

@gnprice

One recurring error we see in the crash logs looks like this:

com.facebook.react.common.JavascriptException: Error: Error: Error: Error: Active account not logged in
This error is located at:
in Connect(n)
in s
in RCTView
in RCTView
in u
[...]
in c, stack:
h@572:1357
<unknown>@1742:2080
w@388:786
run@372:3903
onStateChange@372:2816
<unknown>@-1
notify@376:741
notifyNestedSubs@376:395
<unknown>@-1
onStateChange@372:2971
[...]
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java
  at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException (ExceptionsManagerModule.java:38)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
[...]

E.g. it's one of the types of errors in this "cluster" on the Play Console.

The error message comes from getAuth:

/**
 * The auth object for the active, logged-in account; throws if none.
 *
 * For use in all the normal-use screens and codepaths of the app, which
 * assume there is an active, logged-in account.
 *
 * See:
 *  * `tryGetAuth` for the meaning of "active, logged-in".
 *  * `tryGetAuth` again, for use where there might not be such an account.
 */
export const getAuth = (state: GlobalState): Auth => {

So apparently some code is assuming there's an active, logged-in account when there isn't. Fixing the bug means finding where that code is, and either making it handle the alternative case (e.g. with tryGetAuth) or preventing getting there in that case. Probably the first step is to repro it.

In this Sentry record, it looks from the breadcrumbs like the user was using one account, and tried to either switch to another or add another (there's a /server_settings call for one org after a bunch of activity in a different one); and then this hit 10 seconds later. So that may be a clue.

Here's a Sentry search for more examples, which may provide further clues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions