firebase / firebase/firebase-js-sdk

app/invalid-credential error when the clock is out of sync

Open
#1,467 2 comments 0 reactions 1 assignee Claimed by @hiranya911 View on GitHub
api: database feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

Whenever the SDK is deployed on a server where the clock happens to be out of sync, the RTDB client logs the following error and goes into a tight loop, from which it can never recover:

```
@firebase/database: FIREBASE WARNING: {\"code\":\"app/invalid-credential\",\"message\":\"Credential implementation provided to initializeApp() via the \\\"credential\\\" property failed to fetch a valid Google OAuth2 access token with the following error: \\\"Failed to parse access token response: Error: Server responded with status 400.\\\".\"}
```

To the developer it appears the SDK is stuck/hung. Can we improve this behavior by:
1. Logging a more detailed and actionable error message (specifically, mention the clock is possibly out of sync)
2. Not going into a tight retry loop when this happens, and instead fail fast.

Related bug reports:
https://github.com/firebase/firebase-admin-node/issues/435
https://github.com/firebase/firebase-admin-node/issues/436

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.