{"record":{"id":"4336fee6df391414","repo":"louislam/dockge","slug":"unknown-database-type","errorCode":null,"errorMessage":"Unknown Database type: ","messagePattern":"Unknown Database type: ","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"backend/database.ts","lineNumber":130,"sourceCode":"            Dialect.prototype._driver = () => sqlite;\n\n            config = {\n                client: Dialect,\n                connection: {\n                    filename: Database.sqlitePath,\n                    acquireConnectionTimeout: acquireConnectionTimeout,\n                },\n                useNullAsDefault: true,\n                pool: {\n                    min: 1,\n                    max: 1,\n                    idleTimeoutMillis: 120 * 1000,\n                    propagateCreateError: false,\n                    acquireTimeoutMillis: acquireConnectionTimeout,\n                }\n            };\n        } else {\n            throw new Error(\"Unknown Database type: \" + dbConfig.type);\n        }\n\n        const knexInstance = knex(config);\n\n        // @ts-ignore\n        R.setup(knexInstance);\n\n        if (process.env.SQL_LOG === \"1\") {\n            R.debug(true);\n        }\n\n        // Auto map the model to a bean object\n        R.freeze(true);\n\n        if (autoloadModels) {\n            R.autoloadModels(\"./backend/models\", \"ts\");\n        }\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/louislam/dockge/blob/f809ae192b571944ad773e9866d3e67064ae8043/backend/database.ts#L112-L148","documentation":"Database.connect builds a knex config only for dbConfig.type === 'sqlite'; any other string reaches the else branch and throws 'Unknown Database type: <type>'. This build only ships a sqlite driver, so mysql/mariadb/postgres values in db-config.json are rejected at startup. This one is thrown inside connect() itself, and while readDBConfig errors are caught, this error propagates.","triggerScenarios":"db-config.json contains {\"type\": \"mariadb\"} (copied from Uptime Kuma) or \"mysql\"/\"postgres\"; running a Dockge version that dropped a previously-supported dialect.","commonSituations":"Users migrating from Uptime Kuma assume the same db types are supported; hand-edited config; file copied between apps sharing a data dir.","solutions":["Set db-config.json type to \"sqlite\" (the only supported type in this build)","Delete db-config.json and restart so the default sqlite config is written","If you need another database, check the project version/docs — this codebase only implements sqlite"],"exampleFix":"// before (db-config.json)\n{\"type\": \"mariadb\"}\n// after\n{\"type\": \"sqlite\"}","handlingStrategy":"validation","validationCode":"const SUPPORTED = [\"sqlite\"];\nconst cfg = JSON.parse(fs.readFileSync(dataDir + \"/db-config.json\", \"utf-8\"));\nif (!SUPPORTED.includes(cfg.type)) { throw new Error(`Unsupported db type '${cfg.type}'; only ${SUPPORTED.join(', ')} is supported`); }","typeGuard":"function isSupportedDBConfig(v: unknown): v is { type: \"sqlite\" } { return typeof v === \"object\" && v !== null && (v as any).type === \"sqlite\"; }","tryCatchPattern":"try { await Database.connect(); } catch (e) { if (String(e.message).startsWith(\"Unknown Database type\")) { fs.writeFileSync(dataDir + \"/db-config.json\", JSON.stringify({ type: \"sqlite\" })); return Database.connect(); } throw e; }","preventionTips":["Do not copy db-config.json from Uptime Kuma or other projects — Dockge only supports sqlite","Check the supported dialects in Database.connect before editing the config","Keep a validated backup of a known-good db-config.json"],"tags":["database","config","sqlite","unsupported"],"backgroundTag":"unsupported-config-value","analyzedSha":"f809ae192b571944ad773e9866d3e67064ae8043","analyzedAt":"2026-08-31T19:13:50.919Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}