n8n-io/n8n · critical · MissingDriverError
Wrong driver: "${driverType}" given. Supported drivers are:
Error message
Wrong driver: "${driverType}" given. Supported drivers are: "postgres", "sqlite", "sqlite-pooled". What it means
MissingDriverError is thrown by DriverFactory.getDriver when the DataSource options.type does not match one of the supported drivers ('postgres', 'sqlite', 'sqlite-pooled'). This is n8n's vendored TypeORM fork, so only those three types are accepted regardless of what upstream TypeORM supports.
Source
Thrown at packages/@n8n/typeorm/src/driver/DriverFactory.ts:14
import type { Driver, DriverConstructor } from './Driver';
import type { DataSource } from '../data-source/DataSource';
import { MissingDriverError } from '../error/MissingDriverError';
const getDriver = async (type: DataSource['options']['type']): Promise<DriverConstructor> => {
switch (type) {
case 'postgres':
return (await import('./postgres/PostgresDriver.js')).PostgresDriver;
case 'sqlite':
return (await import('./sqlite/SqliteDriver.js')).SqliteDriver;
case 'sqlite-pooled':
return (await import('./sqlite-pooled/SqliteReadWriteDriver.js')).SqliteReadWriteDriver;
default:
throw new MissingDriverError(type, ['postgres', 'sqlite', 'sqlite-pooled']);
}
};
/**
* Helps to create drivers.
*/
export class DriverFactory {
/**
* Creates a new driver depend on a given connection's driver type.
*/
static async create(connection: DataSource): Promise<Driver> {
const { type } = connection.options;
return new (await getDriver(type))(connection);
}
}
View on GitHub (pinned to 5ac6606e81)
Solutions
- Set DB_TYPE (or options.type) to one of 'postgres', 'sqlite', 'sqlite-pooled' exactly as spelled.
- For PostgreSQL deployments use 'postgres'; for the default local install use 'sqlite' (or 'sqlite-pooled' if using the pooled driver).
- If you genuinely need another database, n8n does not support it; do not try to bypass this guard.
- Check for trailing whitespace / case in the env var (the comparison is case-sensitive).
Example fix
// before DB_TYPE=postgress // typo // after DB_TYPE=postgres
Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = new Set(['postgres', 'sqlite', 'sqlite-pooled']);
function assertDriverType(type: string): void {
if (!SUPPORTED.has(type)) {
throw new Error(`Unsupported DB type '${type}'. Use one of: ${[...SUPPORTED].join(', ')}`);
}
}
Type guard
const DRIVER_TYPES = ['postgres', 'sqlite', 'sqlite-pooled'] as const;
type DriverType = (typeof DRIVER_TYPES)[number];
function isDriverType(x: unknown): x is DriverType {
return typeof x === 'string' && (DRIVER_TYPES as readonly string[]).includes(x);
}
Try / catch
import { MissingDriverError } from '@n8n/typeorm/error/MissingDriverError';
try {
await DriverFactory.create(ds);
} catch (e) {
if (e instanceof MissingDriverError) {
failStartup(`DB_TYPE must be one of postgres|sqlite|sqlite-pooled (got '${e.args?.[0]}')`);
}
throw e;
}
Prevention
- Validate DB_TYPE at config load against the allow-list before initializing the DataSource.
- Keep the supported set in a single shared constant reused by config validation and tests.
- Add a unit test that asserts each unsupported value raises MissingDriverError.
- Document the exact allowed strings (case-sensitive) in the deployment guide.
When it happens
Trigger: DB_TYPE / dataSource.options.type is set to an unsupported value such as 'mysql', 'mariadb', 'mssql', 'mongodb', or a typo like 'postgress' / 'SQLITE'. The switch falls through to the default branch and raises.
Common situations: An operator copies a generic TypeORM example and sets type:'mysql'; an env var has a typo; a config migration sets a value that is not in the allow-list; a developer tries to add a new driver without extending the switch.
Related errors
- Database type currently not supported
- Postgres package has not been found installed. Try to instal
- SQLite package has not been found installed. Try to install
- Transactions aren't supported by ${this.connection.driver.op
- 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/2f0ade6eeb1097ab.
Report an issue: GitHub.