{"record":{"id":"2b7c1084f3808fbf","repo":"FlowiseAI/Flowise","slug":"invalid-table-name-must-be-at-most-record-manag","errorCode":null,"errorMessage":"Invalid table name: must be at most ${RECORD_MANAGER_TABLE_NAME_MAX_LENGTH} characters","messagePattern":"Invalid table name: must be at most (.+?) characters","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/recordManagerSecurity.ts","lineNumber":15,"sourceCode":"export const RECORD_MANAGER_TABLE_NAME_MAX_LENGTH = 128\nexport const RECORD_MANAGER_NAMESPACE_MAX_LENGTH = 128\n\n/**\n * Validates record manager table names used in SQL identifiers.\n */\nexport function sanitizeRecordManagerTableName(tableName: string): string {\n    tableName = tableName.trim().toLowerCase().replace(/\\s+/g, '_')\n\n    if (!/^[a-zA-Z0-9_]+$/.test(tableName)) {\n        throw new Error('Invalid table name')\n    }\n\n    if (tableName.length > RECORD_MANAGER_TABLE_NAME_MAX_LENGTH) {\n        throw new Error(`Invalid table name: must be at most ${RECORD_MANAGER_TABLE_NAME_MAX_LENGTH} characters`)\n    }\n\n    return tableName\n}\n\n/**\n * Validates record manager namespace values stored in the database.\n */\nexport function sanitizeRecordManagerNamespace(namespace: string): string {\n    const trimmed = namespace.trim()\n\n    if (!/^[a-zA-Z0-9_-]{1,128}$/.test(trimmed)) {\n        throw new Error('Invalid namespace')\n    }\n\n    if (trimmed.length > RECORD_MANAGER_NAMESPACE_MAX_LENGTH) {\n        throw new Error(`Invalid namespace: must be at most ${RECORD_MANAGER_NAMESPACE_MAX_LENGTH} characters`)\n    }","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/recordManagerSecurity.ts#L1-L33","documentation":"After the character-class check passes, sanitizeRecordManagerTableName rejects names longer than RECORD_MANAGER_TABLE_NAME_MAX_LENGTH (128). This guards against over-long SQL identifiers, which some databases reject or truncate. The constant is exported so callers can pre-truncate.","triggerScenarios":"Passing a generated/composite name longer than 128 chars after normalization, e.g. a long hash or a concatenation of tenant + workflow + node identifiers.","commonSituations":"Multi-tenant systems building table names from UUIDs or long paths; automated naming schemes that don't cap length.","solutions":["Truncate or hash the name to <= RECORD_MANAGER_TABLE_NAME_MAX_LENGTH (128) before calling.","Compute a stable short hash (e.g. sha256 prefix) when the source name is unbounded."],"exampleFix":"// before\nsanitizeRecordManagerTableName(longName) // throws if > 128 chars\n\n// after\nconst name = longName.length > RECORD_MANAGER_TABLE_NAME_MAX_LENGTH\n  ? longName.slice(0, RECORD_MANAGER_TABLE_NAME_MAX_LENGTH)\n  : longName\nsanitizeRecordManagerTableName(name)","handlingStrategy":"validation","validationCode":"import { RECORD_MANAGER_TABLE_NAME_MAX_LENGTH } from './recordManagerSecurity'\n\nfunction truncateTableName(raw: string): string {\n  let n = raw.trim().toLowerCase().replace(/\\s+/g, '_').replace(/[^a-z0-9_]/g, '_')\n  if (n.length > RECORD_MANAGER_TABLE_NAME_MAX_LENGTH) {\n    n = n.slice(0, RECORD_MANAGER_TABLE_NAME_MAX_LENGTH)\n  }\n  return n\n}","typeGuard":"const isWithinTableLength = (s: string): boolean =>\n  s.trim().toLowerCase().replace(/\\s+/g, '_').length <= RECORD_MANAGER_TABLE_NAME_MAX_LENGTH","tryCatchPattern":null,"preventionTips":["Cap generated/composite names at RECORD_MANAGER_TABLE_NAME_MAX_LENGTH (128).","Hash unbounded source names (e.g. sha256 prefix) instead of concatenating identifiers."],"tags":["validation","sql","record-manager"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}