How to fix Error: Your Cloud Firestore database is in maintenance mode in Firebase

FirebaseBEGINNERMEDIUMUpdated Dec 22, 2025ยท 164 views

Your Cloud Firestore database is in maintenance mode, preventing read/write operations. This typically occurs during initial setup, configuration updates, or Firebase infrastructure maintenance. Wait for the operation to complete or check your database settings.

Quick fix

Fixes Error: Your Cloud Firestore database is in maintenance mode

1. Open the [Firebase Console](https://console.firebase.google.com/)
  1. Check the Firebase Console status
  2. Verify database initialization is complete
  3. Check the Firebase Status Dashboard
  4. Implement retry logic with exponential backoff
firebase โ€” error
1. Open the [Firebase Console](https://console.firebase.google.com/)
Error: Your Cloud Firestore database is in maintenance mode

What this error means

This error occurs when your Firestore database is temporarily unavailable due to maintenance operations. Firestore may enter maintenance mode during several scenarios: initial database setup and initialization, database type conversion or upgrades, schema updates or index creation, Firebase infrastructure updates or patches, and configuration changes. When in maintenance mode, all data operations (reads, writes, transactions) are blocked until the maintenance completes. This is a safety mechanism to prevent data conflicts or loss during critical operations.

Typical symptoms

  • All Firestore read operations fail with maintenance mode error
  • Write operations are rejected immediately
  • Transactions fail to execute
  • Offline persistence does not work
  • Firebase Admin SDK calls return service unavailable errors
  • Web applications cannot perform CRUD operations on Firestore

Common causes

  1. Database is currently undergoing scheduled maintenance by Google Cloud
  2. Firestore is performing automatic backups or index creation
  3. Database configuration or schema changes are being applied
  4. Database type conversion from Datastore to Native mode is in progress
  5. Firebase infrastructure update or patch is being deployed
  6. Initial database setup and initialization is still running

How to fix "Error: Your Cloud Firestore database is in maintenance mode"

1Check the Firebase Console status
javascript
1. Open the [Firebase Console](https://console.firebase.google.com/)

2. Navigate to Firestore Database
3. Look for a blue banner or status message at the top indicating maintenance
4. Note any estimated completion time provided by Google

If you see an active maintenance message, your database is legitimately under maintenance and you need to wait.

2Verify database initialization is complete

1. In Firebase Console, go to Firestore Database
2. Check if the database appears in the list with a checkmark status
3. If database appears grayed out or shows "initializing", wait for initialization to complete
4. Refresh the page after 30-60 seconds to check status

A newly created database can take several minutes to fully initialize.

3Check the Firebase Status Dashboard
javascript
1. Visit [Firebase Status Dashboard](https://status.firebase.google.com/)

2. Look for any reported incidents affecting Firestore in your region
3. Check recent status updates and estimated resolution times
4. Subscribe to updates if you want to receive notifications

If there's a reported outage, the issue is on Google's side and requires waiting.

4Implement retry logic with exponential backoff

While waiting for maintenance to complete, add client-side retry logic:

javascript
import { getFirestore, collection, getDocs } from 'firebase/firestore';

async function getDataWithRetry(maxRetries = 5, initialDelay = 1000) {
  const db = getFirestore();
  let delay = initialDelay;

  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    try {
      const snapshot = await getDocs(collection(db, 'your-collection'));
      return snapshot.docs.map(doc => doc.data());
    } catch (error) {
      if (error.code === 'service-unavailable' || error.message.includes('maintenance mode')) {
        if (attempt === maxRetries) throw error;

        console.log(`Maintenance mode detected. Retrying in ${delay}ms... (Attempt ${attempt}/${maxRetries})`);
        await new Promise(resolve => setTimeout(resolve, delay));
        delay = Math.min(delay * 2, 30000); // Cap at 30 seconds
      } else {
        throw error;
      }
    }
  }
}

getDataWithRetry()
  .then(data => console.log('Success:', data))
  .catch(err => console.error('Failed after retries:', err));
5Enable offline persistence as a temporary fallback

For web applications, enable offline persistence to serve cached data while maintenance is ongoing:

javascript
import { initializeApp } from 'firebase/app';
import { getFirestore, enableIndexedDbPersistence } from 'firebase/firestore';

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

enableIndexedDbPersistence(db)
  .catch((err) => {
    if (err.code === 'failed-precondition') {
      console.log('Multiple tabs open, persistence can only be enabled in one tab');
    } else if (err.code === 'unimplemented') {
      console.log('Current browser does not support persistence');
    }
  });

This allows your app to read cached data from previous successful queries even during maintenance.

6Wait for maintenance completion

Firebase maintenance typically completes within hours. You should:
1. Do NOT attempt to modify database rules or settings during maintenance
2. Do NOT delete or recreate the database
3. Monitor the Firebase Console periodically for status updates
4. Check Firebase Status Dashboard for incident resolution
5. Keep your app running with retry logic enabled

Your data is safe during maintenance - no loss occurs. Normal operations will resume once maintenance completes.

Advanced notes

Multiple Databases: Each Firebase project can have multiple Firestore databases. If one database is in maintenance, others in the same project may still be accessible. You can temporarily route traffic to an alternate database if available.

Datastore vs Native Mode: If you see "Cloud Firestore in Datastore mode suddenly appeared" in your console, this indicates a database mode conversion. During conversion to Native mode, the database enters maintenance until the operation completes. Allow 15-30 minutes for this process.

Offline-First Architecture: For critical applications, implement an offline-first architecture using IndexedDB (web) or local storage (mobile) to gracefully handle extended maintenance windows. Sync with Firestore once maintenance completes.

Regional Considerations: Firestore maintenance windows may be scheduled regionally. Check if maintenance is affecting only your database's region or the entire service.

No API to Check Maintenance Status: Currently, Firebase does not provide an API endpoint to programmatically check if a database is in maintenance mode. The status is visible only in the Firebase Console and requires manual checking.

Frequently asked questions

What does "Error: Your Cloud Firestore database is in maintenance mode" mean?
This error occurs when your Firestore database is temporarily unavailable due to maintenance operations. Firestore may enter maintenance mode during several scenarios: initial database setup and initialization, database type conversion or upgrades, schema updates or index creation, Firebase infrastructure updates or patches, and configuration changes. When in maintenance mode, all data operations (reads, writes, transactions) are blocked until the maintenance completes.
How do I fix "Error: Your Cloud Firestore database is in maintenance mode"?
Your Cloud Firestore database is in maintenance mode, preventing read/write operations. This typically occurs during initial setup, configuration updates, or Firebase infrastructure maintenance. Wait for the operation to complete or check your database settings.
What causes "Error: Your Cloud Firestore database is in maintenance mode"?
Database is currently undergoing scheduled maintenance by Google Cloud Firestore is performing automatic backups or index creation Database configuration or schema changes are being applied
Is the "Error: Your Cloud Firestore database is in maintenance mode" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading