Skip to content

Unable to process request due to missing initial state, but works on a retry #8629

@dirk-nicolab

Description

@dirk-nicolab

Operating System

iOS 16.x and up, Android 12 and up, any browser

Environment (if applicable)

React 17.0.1

Firebase SDK Version

10.6.0

Firebase SDK Product(s)

Auth

Project Tooling

React web app.

Detailed Problem Description

Every now and then we are met with the error: "Unable to process request due to missing initial state" whilst trying to log in using Firebase. The problem is usually resolved when the user tries to login a second time.

I see a lot of similar tickets which are all dismissed for not running the helper code on the same origin as the actual application.

I can confirm both our Firebase helper code and application run on the same origin, so this is not the problem.

  • We've tested multiple versions of the Firebase SDK but it seems to be present in every version we try
  • The issue appears on both Android and iOS and is not tied to using a specific browser.
  • It is not a recent error, but has happened for well over a year
  • We follow all best practices for authentication following the guide step-by-step

It appears to be some sort of race condition in the Firebase SDK client code.

image-20241029-151322

Steps and code to reproduce issue

The problem is very hard to reproduce because it seems to happen only sporadically. Nevertheless we receive complaints from our users. Some info that might help:

  • We've seen it happen both on Android and iOS devices on both Chrome and Safari
  • The error doesn't necessarily appear the first time, but can happen after a couple of logins
  • A retry solves the issue (temporarily) in nearly all cases

Like I said it appears to be a race condition which makes it very hard to accurately reproduce. I'll keep retrying to see if there are any specific steps that may help to trigger it more often.

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