{"record":{"id":"b3af461272e803a2","repo":"FlowiseAI/Flowise","slug":"invalid-sqlite-path-database-path-is-required","errorCode":null,"errorMessage":"Invalid SQLite path: database path is required","messagePattern":"Invalid SQLite path: database path is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/validator.ts","lineNumber":333,"sourceCode":" *\n * @param {string | undefined} userProvidedPath - File path supplied by the user in the node config\n * @returns {string} A validated, absolute path within an allowed base directory\n * @throws {Error} If the path is missing, contains traversal patterns, or is outside allowed directories\n */\nexport const validateSQLitePath = (userProvidedPath: string | undefined): string => {\n    const allowedDirs = getAllowedSQLiteBaseDirs()\n    const defaultDir = allowedDirs[0]\n\n    if (process.env.PATH_TRAVERSAL_SAFETY === 'false') {\n        if (!userProvidedPath || userProvidedPath.trim() === '') {\n            return path.join(defaultDir, 'database.sqlite')\n        }\n        const bypassPath = userProvidedPath.trim()\n        return path.isAbsolute(bypassPath) ? bypassPath : path.resolve(path.join(defaultDir, bypassPath))\n    }\n\n    if (!userProvidedPath || userProvidedPath.trim() === '') {\n        throw new Error('Invalid SQLite path: database path is required')\n    }\n\n    const basePath = userProvidedPath.trim()\n\n    if (basePath.includes('..')) throw new Error('Invalid SQLite path: path traversal attempt detected')\n    if (basePath.toLowerCase().includes('%2e') || basePath.toLowerCase().includes('%2f') || basePath.toLowerCase().includes('%5c'))\n        throw new Error('Invalid SQLite path: encoded path traversal attempt detected')\n    // eslint-disable-next-line no-control-regex\n    if (/\\0/.test(basePath) || /[\\x00-\\x1f]/.test(basePath))\n        throw new Error('Invalid SQLite path: null bytes or control characters detected')\n    if (/^[a-zA-Z]:\\\\/.test(basePath)) throw new Error('Invalid SQLite path: Windows absolute paths are not allowed')\n    if (/^\\\\\\\\[^\\\\]/.test(basePath)) throw new Error('Invalid SQLite path: UNC paths are not allowed')\n    if (/^\\\\\\\\\\?\\\\/.test(basePath)) throw new Error('Invalid SQLite path: extended-length paths are not allowed')\n\n    const resolvedPath = path.isAbsolute(basePath) ? path.resolve(basePath) : path.resolve(path.join(defaultDir, basePath))\n\n    if (resolvedPath.includes('..')) throw new Error('Invalid SQLite path: path traversal detected in resolved path')\n","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/validator.ts#L315-L351","documentation":"Thrown by validateSQLitePath (packages/components/src/validator.ts:333) when no database path is supplied (undefined, null, or whitespace-only). Unlike the vector store helper, validateSQLitePath has NO default file — SQLite requires an explicit path. (A default 'database.sqlite' is only used when PATH_TRAVERSAL_SAFETY=false.)","triggerScenarios":"A SQL Database Chain / Sql Database node is created with an empty Database Path field, or the node param is omitted from the API/chatflow payload.","commonSituations":"New node config left blank because the UI did not mark the field required; migration from an older version that defaulted the path; programmatic chatflow creation that skips the field.","solutions":["Provide an explicit SQLite file path, e.g. 'database.sqlite' (resolves to ~/.flowise/database.sqlite) or an absolute path under an allowed dir.","If importing an old chatflow, fill in the Database Path field and re-save.","When scripting chatflow creation, always set the databasePath node param."],"exampleFix":"// before\nvalidateSQLitePath(undefined)\n\n// after\nvalidateSQLitePath('database.sqlite')   // -> ~/.flowise/database.sqlite","handlingStrategy":"validation","validationCode":"if (typeof databasePath !== 'string' || databasePath.trim() === '') throw new Error('SQLite Database Path is required');","typeGuard":"const isNonEmptyString = (p: unknown): p is string => typeof p === 'string' && p.trim() !== '';","tryCatchPattern":"try { validateSQLitePath(databasePath) } catch (e) { if (e instanceof Error && /database path is required/.test(e.message)) { databasePath = 'database.sqlite' } else throw e }","preventionTips":["Always set Database Path when creating a Sql Database node.","Make the field required in your chatflow-creation UI/API.","Default to 'database.sqlite' in templates that ship to users."],"tags":["validation","sqlite","configuration","required-field","flowise","database"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}