How to fix database/not-found in Firebase

FirebaseBEGINNERMEDIUMUpdated Dec 22, 2025ยท 137 views

The "database/not-found" error occurs when your Firebase Realtime Database configuration is missing, incorrect, or points to a non-existent database. Fix it by ensuring your databaseURL is properly configured in your Firebase initialization code.

Quick fix

Fixes database/not-found

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "your-project.firebaseapp.com",
  projectId: "your-project",
  storageBucket: "your-project.appspot.com",
  messagingSenderId: "YOUR_SENDER_ID",
  appId: "YOUR_APP_ID",
  databaseURL: "https://your-project.firebaseio.com" // Add this line
};

firebase.initializeApp(firebaseConfig);
  1. Verify your database URL in Firebase console
  2. Add databaseURL to your Firebase configuration
  3. Use correct URL format for regional databases
  4. Initialize Firebase before accessing the database
firebase โ€” error
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "your-project.firebaseapp.com",
projectId: "your-project",
storageBucket: "your-project.appspot.com",
messagingSenderId: "YOUR_SENDER_ID",
appId: "YOUR_APP_ID",
databaseURL: "https://your-project.firebaseio.com" // Add this line
};
firebase.initializeApp(firebaseConfig);
database/not-found

What this error means

The "database/not-found" error is thrown when your application cannot locate or connect to the Firebase Realtime Database instance. This typically happens when the database URL is missing from your Firebase configuration, incorrectly formatted, or points to a database that does not exist in your Firebase project. Unlike Firestore (which is included by default), Realtime Database requires an explicit URL to be configured. Firebase cannot automatically determine which database instance you want to use, especially if your project has multiple databases or databases in different regions.

Typical symptoms

  • Application crashes when trying to access Firebase Realtime Database
  • Error messages contain "database/not-found" or "Can't determine Firebase Database URL"
  • Database operations fail silently without specific error messages
  • Firebase functions deployment fails with database URL errors
  • Realtime Database listener does not initialize or fires cancellation callbacks

Common causes

  1. The databaseURL is missing from your Firebase configuration object during initialization
  2. The databaseURL is incorrectly formatted (wrong region format or typo in project name)
  3. The database exists in a non-us-central1 region but you're using the wrong URL format
  4. Firebase is not properly initialized before attempting to access the database
  5. You're referencing a database in a different Firebase project than your config points to
  6. The Realtime Database service is not enabled in your Firebase console for that project

How to fix "database/not-found"

1Verify your database URL in Firebase console

Log into your Firebase Console, navigate to "Realtime Database", and find your database instance. Copy the full database URL (it will appear at the top of the database tab). It should look like:
- https://YOUR_PROJECT_ID.firebaseio.com (for us-central1)
- https://YOUR_PROJECT_ID.REGION.firebasedatabase.app (for other regions like europe-west1, asia-southeast1)

2Add databaseURL to your Firebase configuration

Update your Firebase initialization to include the databaseURL. In a web/JavaScript app:

javascript
const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "your-project.firebaseapp.com",
  projectId: "your-project",
  storageBucket: "your-project.appspot.com",
  messagingSenderId: "YOUR_SENDER_ID",
  appId: "YOUR_APP_ID",
  databaseURL: "https://your-project.firebaseio.com" // Add this line
};

firebase.initializeApp(firebaseConfig);
3Use correct URL format for regional databases

If your database is in a region other than us-central1, ensure you use the correct URL format with the region included:

javascript
// For Europe region
databaseURL: "https://my-db.europe-west1.firebasedatabase.app"

// For Asia Southeast region
databaseURL: "https://my-db.asia-southeast1.firebasedatabase.app"

Do not use the old .firebaseio.com format for regional databases.

4Initialize Firebase before accessing the database

Ensure Firebase is fully initialized before calling any database methods. In a Node.js/Admin SDK context:

javascript
const admin = require("firebase-admin");
const serviceAccount = require("./serviceAccountKey.json");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://your-project.firebaseio.com"
});

const database = admin.database();
// Now database calls will work
5Check that Realtime Database is enabled

Visit your Firebase Console project settings and confirm that the Firebase Realtime Database is enabled. If you only see Firestore options or if the database is not created, click "Create database" in the Realtime Database section. Choose your preferred security rules and location.

Advanced notes

Regional databases require special attention when migrating or using multiple database instances. If your project has multiple Realtime Database instances, each one will have a unique URL. You can create multiple database references by passing different URLs to getInstance() methods in your SDK. In React Native and Flutter, the database URL parameter is required even for the default us-central1 database. When deploying Firebase Functions, ensure your firebase.json includes the correct databaseURL in the functions configuration section.

Frequently asked questions

What does "database/not-found" mean?
The "database/not-found" error is thrown when your application cannot locate or connect to the Firebase Realtime Database instance. This typically happens when the database URL is missing from your Firebase configuration, incorrectly formatted, or points to a database that does not exist in your Firebase project. Unlike Firestore (which is included by default), Realtime Database requires an explicit URL to be configured.
How do I fix "database/not-found"?
The "database/not-found" error occurs when your Firebase Realtime Database configuration is missing, incorrect, or points to a non-existent database. Fix it by ensuring your databaseURL is properly configured in your Firebase initialization code.
What causes "database/not-found"?
The databaseURL is missing from your Firebase configuration object during initialization The databaseURL is incorrectly formatted (wrong region format or typo in project name) The database exists in a non-us-central1 region but you're using the wrong URL format
Is the "database/not-found" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading