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

Firebase app check 429 errors #5052

Closed
febg11 opened this issue Jun 20, 2021 · 8 comments · Fixed by #5055
Closed

Firebase app check 429 errors #5052

febg11 opened this issue Jun 20, 2021 · 8 comments · Fixed by #5055

Comments

@febg11
Copy link

febg11 commented Jun 20, 2021

I am trying to use firebase app-check but I constantly receive error 429. I can't see how I am exhausting the server. If i load it and refresh the page once they show up.

The networks requests are calling the following api

https://content-firebaseappcheck.googleapis.com/v1beta/projects

(I have removed some project specific get params)

There seems to be other people experiencing this:

https://stackoverflow.com/questions/67982348/firebase-appcheck-web-app-not-working-in-debug-mode

@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.

@steurt
Copy link

steurt commented Jun 21, 2021

I experience the same issue. In my case the exchangeDebugToken is requested multiple times in close succession.
https://content-firebaseappcheck.googleapis.com/v1beta/projects/{projectId}/apps/{appId}:exchangeDebugToken?key={apiKey}

Resulting in the following error:

FirebaseError: AppCheck: Fetch server returned an HTTP error status. HTTP status: 429. (appCheck/fetch-status-error)

When the request does succeed, I get the response containing the attestationToken and the ttl of 3600s. Seeing that the request is executed multiple it seems the ttl might not be considered correctly.

@hsubox76
Copy link
Contributor

hsubox76 commented Jun 21, 2021

Can you describe how you are using App Check? Are you using debug mode like the Stack Overflow question or something else? Also which products are you using it with? Functions? Storage? Realtime Database? Can you show the code for what you are doing with each of those?

@febg11
Copy link
Author

febg11 commented Jun 21, 2021

I am using the debug mode yes. I am also using angular and I am initialising it like the chosen answer in this stackoverflow question

https://stackoverflow.com/questions/67908846/how-to-initialise-firebase-app-check-in-angular

I am using it with Functions, Storage and Realtime Database and they all throw the errors. Occassionally some requests get through and say a storage getDownloadLnk requests works but 99% of the time there will be at least 1 429 error when the page is loaded.

I have added the debug token generated by the library (also that was hard to find as it only seems to print once then stops logging it as its in local storage.. had to debug the minified code to get it)

Any help is really appreciated as this is blocking my local development.

@hsubox76
Copy link
Contributor

I think this may be caused because if you are in debug mode, the App Check token is not cached, and instead it hits the App Check exchange endpoint on every request. That would be a bug on our part and I'll look into fixing it.

@febg11
Copy link
Author

febg11 commented Jun 21, 2021

Thanks a lot 😄

@febg11
Copy link
Author

febg11 commented Jun 26, 2021

Hi is there any update with this?

@hsubox76
Copy link
Contributor

This has just been merged. It missed the cutoff for this week's release but should be released next week.

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

Successfully merging a pull request may close this issue.

5 participants