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

  1. Set DB_TYPE to exactly 'sqlite' or 'postgresdb' (lowercase) in your env/config.
  2. If you need Postgres, also set DB_POSTGRESDB_HOST, _PORT, _USER, _PASSWORD, _DATABASE.
  3. For local dev/CI, use 'sqlite' (default) with DB_SQLITE_FILENAME.
  4. 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

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


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/db5718c7372b27c1. Report an issue: GitHub.