Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dirk-nicolab opened this issue Nov 5, 2024 · 6 comments

Comments

@dirk-nicolab
Copy link

dirk-nicolab commented Nov 5, 2024

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.

@dirk-nicolab dirk-nicolab added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Nov 5, 2024
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@jbalidiong jbalidiong added api: auth needs-attention and removed needs-triage new A new issue that hasn't be categoirzed as question, bug or feature request labels Nov 5, 2024
@DellaBitta
Copy link
Contributor

Hi @dirk-nicolab,

That error message string isn't within our SDK source base. It might be a message sent to you by the service in response instead. Could you share the code that you invoke and how you parse the error from the result? Thanks!

@DellaBitta
Copy link
Contributor

It seems that this error message can stem from the Auth service for a variety of reasons. It would be worth checking out #4256 to see if any of the discussion is also applicable to your problem. Of specific note in that issue is this message from the Auth team with notes of what the main cause of this issue could be.

If none of that information is applicable, then please do provide more information about how to reproduce the issue. Thanks!

@dirk-nicolab
Copy link
Author

Hi @DellaBitta thanks for you reply.

If I look at the topic I see many people with the same problem and no viable solution is provided as we already adhere to all best practices for the login.

What happens is:

  • Firebase is initialized
  • The user logs in using signInWithRedirect provider is either GoogleAuthProvider, SAMLAuthProvider, or OAuthProvider (it happens for all these providers)
  • User enters their credentials and is redirected back
  • User is met with the error as mentioned

@dlarocque
Copy link
Contributor

@dirk-nicolab Could you please share the code that performs the steps you've listed?

Without a code snippet it will be challenging for us to reproduce this issue. If we write a test app that follows the steps you've listed but we don't see the error message after several attempts, we can't know whether we need to continue attempting reproduction, or if our reproduction code does not match the real code that reproduces the issue (the code in your app).

@google-oss-bot
Copy link
Contributor

Hey @dirk-nicolab. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants