{"record":{"id":"2f0ade6eeb1097ab","repo":"n8n-io/n8n","slug":"wrong-driver-drivertype-given-supported-dri","errorCode":null,"errorMessage":"Wrong driver: \"${driverType}\" given. Supported drivers are: \"postgres\", \"sqlite\", \"sqlite-pooled\".","messagePattern":"Wrong driver: \"(.+?)\" given\\. Supported drivers are: \"postgres\", \"sqlite\", \"sqlite-pooled\"\\.","errorType":"exception","errorClass":"MissingDriverError","httpStatus":null,"severity":"critical","filePath":"packages/@n8n/typeorm/src/driver/DriverFactory.ts","lineNumber":14,"sourceCode":"import type { Driver, DriverConstructor } from './Driver';\nimport type { DataSource } from '../data-source/DataSource';\nimport { MissingDriverError } from '../error/MissingDriverError';\n\nconst getDriver = async (type: DataSource['options']['type']): Promise<DriverConstructor> => {\n\tswitch (type) {\n\t\tcase 'postgres':\n\t\t\treturn (await import('./postgres/PostgresDriver.js')).PostgresDriver;\n\t\tcase 'sqlite':\n\t\t\treturn (await import('./sqlite/SqliteDriver.js')).SqliteDriver;\n\t\tcase 'sqlite-pooled':\n\t\t\treturn (await import('./sqlite-pooled/SqliteReadWriteDriver.js')).SqliteReadWriteDriver;\n\t\tdefault:\n\t\t\tthrow new MissingDriverError(type, ['postgres', 'sqlite', 'sqlite-pooled']);\n\t}\n};\n\n/**\n * Helps to create drivers.\n */\nexport class DriverFactory {\n\t/**\n\t * Creates a new driver depend on a given connection's driver type.\n\t */\n\tstatic async create(connection: DataSource): Promise<Driver> {\n\t\tconst { type } = connection.options;\n\t\treturn new (await getDriver(type))(connection);\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/driver/DriverFactory.ts#L1-L30","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)."],"exampleFix":"// before\nDB_TYPE=postgress  // typo\n// after\nDB_TYPE=postgres\n","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['postgres', 'sqlite', 'sqlite-pooled']);\nfunction assertDriverType(type: string): void {\n  if (!SUPPORTED.has(type)) {\n    throw new Error(`Unsupported DB type '${type}'. Use one of: ${[...SUPPORTED].join(', ')}`);\n  }\n}\n","typeGuard":"const DRIVER_TYPES = ['postgres', 'sqlite', 'sqlite-pooled'] as const;\ntype DriverType = (typeof DRIVER_TYPES)[number];\nfunction isDriverType(x: unknown): x is DriverType {\n  return typeof x === 'string' && (DRIVER_TYPES as readonly string[]).includes(x);\n}\n","tryCatchPattern":"import { MissingDriverError } from '@n8n/typeorm/error/MissingDriverError';\ntry {\n  await DriverFactory.create(ds);\n} catch (e) {\n  if (e instanceof MissingDriverError) {\n    failStartup(`DB_TYPE must be one of postgres|sqlite|sqlite-pooled (got '${e.args?.[0]}')`);\n  }\n  throw e;\n}\n","preventionTips":["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."],"tags":["typeorm","database","config","driver","startup"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}