appsmithorg/appsmith · critical · Error
Database URL not found. Please check APPSMITH_DB_URL or APPS
Error message
Database URL not found. Please check APPSMITH_DB_URL or APPSMITH_MONGODB_URI configuration.
What it means
Thrown by run() in enable_form_login.ts when utils.getDburl() returns falsy. getDburl() is expected to read APPSMITH_DB_URL or APPSMITH_MONGODB_URI; without a MongoDB connection string the script cannot run mongosh to toggle form login on the default organization, so it aborts up front.
Source
Thrown at app/client/packages/rts/src/ctl/enable_form_login.ts:9
import * as utils from "./utils";
export async function run() {
const dbUrl = utils.getDburl();
const redisUrl = utils.getRedisUrl();
// Validate required configuration
if (!dbUrl) {
throw new Error(
"Database URL not found. Please check APPSMITH_DB_URL or APPSMITH_MONGODB_URI configuration.",
);
}
if (!redisUrl) {
throw new Error(
"Redis URL not found. Please check APPSMITH_REDIS_URL configuration.",
);
}
await utils.ensureSupervisorIsRunning();
let organizationId: string;
try {
// First, check if the organization exists
const orgCheckResult = await utils.execCommandReturningOutput([
"mongosh",View on GitHub (pinned to 8cd9021c24)
Solutions
- Set APPSMITH_DB_URL (or APPSMITH_MONGODB_URI) to a valid MongoDB URI before running the ctl.
- Source the runtime env first: '. /appsmith-stacks/runtime.env' inside the container shell, then re-run.
- Confirm the var is exported in the shell with 'echo $APPSMITH_DB_URL' (prints the name only, never log the value).
- Verify utils.getDburl() actually reads the var name you set — check for a rename in your Appsmith version.
Example fix
# before $ appsmith ctl enable-form-login # -> Database URL not found... # after $ export APPSMITH_DB_URL='mongodb://...' $ appsmith ctl enable-form-login
Defensive patterns
Strategy: validation
Validate before calling
const dbUrl = process.env.APPSMITH_DB_URL || process.env.APPSMITH_MONGODB_URI;
if (!dbUrl) throw new Error('Set APPSMITH_DB_URL or APPSMITH_MONGODB_URI before running the ctl.'); Type guard
const hasDbUrl = (env: NodeJS.ProcessEnv): boolean => Boolean(env.APPSMITH_DB_URL || env.APPSMITH_MONGODB_URI);
Prevention
- Source /appsmith-stacks/runtime.env before running ctls.
- Centralize required-env checks in a shared bootstrap used by every ctl.
- Fail fast in container entrypoints if required env is missing.
When it happens
Trigger: Running 'appsmith ctl enable-form-login' (or equivalent) in a container/shell where neither APPSMITH_DB_URL nor APPSMITH_MONGODB_URI is set, or where getDburl() returns undefined because the underlying reader has no fallback.
Common situations: Running the ctl in a one-off 'docker exec' shell that does not load /appsmith-stacks/runtime.env; env var renamed between Appsmith versions; fresh install where the bootstrap env has not been written; misconfigured stack.env.
Related errors
- Redis URL not found. Please check APPSMITH_REDIS_URL configu
- Organization with slug 'default' not found in database
- Failed to send error mail. Email provider is not configured,
- Failed to send error mail. Admin email(s) not configured, pl
- The NODE_ENV environment variable is required but was not sp
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/e72cbfc484c8d7b6.
Report an issue: GitHub.