n8n-io/n8n · error · UserError
Database type currently not supported
Error message
Database type currently not supported
What it means
UserError thrown by DbConnectionOptions.getOptions() when config.DB_TYPE is neither 'sqlite' nor 'postgresdb'. The switch has only those two cases; any other value (or an unset/misspelled type) hits the default and rejects with extra.dbType attached. UserError indicates the user caused it via configuration.
Source
Thrown at packages/@n8n/db/src/connection/db-connection-options.ts:42
getPostgresOverrides() {
return {
database: this.config.postgresdb.database,
host: this.config.postgresdb.host,
port: this.config.postgresdb.port,
username: this.config.postgresdb.user,
password: this.config.postgresdb.password,
};
}
getOptions(): DataSourceOptions {
const { type: dbType } = this.config;
switch (dbType) {
case 'sqlite':
return this.getSqliteConnectionOptions();
case 'postgresdb':
return this.getPostgresConnectionOptions();
default:
throw new UserError('Database type currently not supported', { extra: { dbType } });
}
}
private getCommonOptions() {
const { tablePrefix: entityPrefix, logging: loggingConfig } = this.config;
let loggingOption: LoggerOptions = loggingConfig.enabled;
if (loggingOption) {
const optionsString = loggingConfig.options.replace(/\s+/g, '');
if (optionsString === 'all') {
loggingOption = optionsString;
} else {
loggingOption = optionsString.split(',') as LoggerOptions;
}
}
return {
entityPrefix,View on GitHub (pinned to 5ac6606e81)
Solutions
- Set DB_TYPE to exactly 'sqlite' or 'postgresdb' (lowercase) in your env/config.
- If you need Postgres, also set DB_POSTGRESDB_HOST, _PORT, _USER, _PASSWORD, _DATABASE.
- For local dev/CI, use 'sqlite' (default) with DB_SQLITE_FILENAME.
- Double-check the env var name is DB_TYPE (not DATABASE_TYPE or similar) to avoid a silent default.
Example fix
// before DB_TYPE=mysql // after DB_TYPE=postgresdb
Defensive patterns
Strategy: validation
Validate before calling
const allowed = new Set(['sqlite', 'postgresdb']);
if (!allowed.has(process.env.DB_TYPE ?? 'sqlite')) {
throw new Error(`Unsupported DB_TYPE '${process.env.DB_TYPE}'. Use 'sqlite' or 'postgresdb'.`);
} Type guard
function isSupportedDbType(value: string): value is 'sqlite' | 'postgresdb' {
return value === 'sqlite' || value === 'postgresdb';
} Prevention
- Pin DB_TYPE in config-as-code so it can't drift to an unsupported value.
- Document explicitly that only sqlite and postgresdb are supported.
- Add a startup assertion on DB_TYPE before the app boots.
When it happens
Trigger: Setting DB_TYPE to an unsupported value (e.g. 'mysql', 'mongodb', 'mariadb'), misspelling it ('postgres', 'PSQL'), or leaving it unset so it falls through to a non-matching default. Triggered at boot when DataSource options are constructed.
Common situations: Copy-pasting a connection string from a MySQL project; assuming n8n supports MariaDB/MySQL (it does not — only sqlite and postgres); a CI env with DB_TYPE inherited from a different service; case sensitivity ('PostgresDB' vs 'postgresdb').
Related errors
- Unknown agents module: "${moduleName}". ${validTokens ? `Val
- Wrong driver: "${driverType}" given. Supported drivers are:
- MCP server "${cfg.name}": exactly one of "url" or "command"
- MCP server "${cfg.name}": provide either "url" or "command",
- Azure Blob container name not configured. Please set `N8N_EX
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/db5718c7372b27c1.
Report an issue: GitHub.