Skip to content

Getting RESOURCE_EXHAUSTED randomly #7655

Closed
@gilamran

Description

@gilamran

Operating System

macOS 13.6 (22G120)

Browser Version

Node 18 or Latest Chrome

Firebase SDK Version

10.4.0

Firebase SDK Product:

Firestore

Describe your project's tooling

nodejs or browser with firestore

Describe the problem

Using the simplest project with only one collection with 30,000 items in the collection. each doc in the collection looks like this: { id: 1 }. I'm getting RESOURCE_EXHAUSTED randomly.
The project is in Blaze!

The projectId is test2-82c47

Steps and code to reproduce issue

The simplest example will be to just paste this code into index.js and run node index.js
The error happens randomly, for me it happened around 50% of tires, so if it did not happen re-run.

This is the error that I got:

[2023-09-27T10:31:41.763Z]  @firebase/firestore: Firestore (10.4.0): GrpcConnection RPC 'Listen' stream 0x6813ca3b error. Code: 8 Message: 8 RESOURCE_EXHAUSTED: Resource has been exhausted (e.g. check quota).
[2023-09-27T10:31:41.763Z]  @firebase/firestore: Firestore (10.4.0): FirebaseError: [code=resource-exhausted]: 8 RESOURCE_EXHAUSTED: Resource has been exhausted (e.g. check quota).
[2023-09-27T10:31:41.763Z]  @firebase/firestore: Firestore (10.4.0): Using maximum backoff delay to prevent overloading the backend.
const firebase = require("firebase/compat/app");
require("firebase/compat/firestore");
require("firebase/compat/auth");

const FIREBASE_CONFIG = {
.
.
.
};

const firebaseApp = firebase.initializeApp(FIREBASE_CONFIG);
const firestore = firebaseApp.firestore();

const getData = async () => {
  console.log("starting query");
  // collection has 30,000 items, each with one object that looks like this: { id: 1 }
  const query = await firestore.collection("supportedAssets").get();
  console.log(`query returned ${query.docs.length} items`);
  firebaseApp.delete();
};

getData();

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions