{"record":{"id":"3e668ceff283694b","repo":"FlowiseAI/Flowise","slug":"key-prefix-cannot-contain-key-separator-chara","errorCode":null,"errorMessage":"Key prefix cannot contain \"${KEY_SEPARATOR}\" character","messagePattern":"Key prefix cannot contain \"(.+?)\" character","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/AWSDynamoDBKVStorage/AWSDynamoDBKVStorage.ts","lineNumber":365,"sourceCode":"            }\n        }\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const credentials = await getAWSCredentials(nodeData, options)\n\n        const region = (nodeData.inputs?.region as string) || DEFAULT_AWS_REGION\n        const tableName = nodeData.inputs?.tableName as string\n        const keyPrefix = (nodeData.inputs?.keyPrefix as string) || ''\n        const operation = (nodeData.inputs?.operation as string) || Operation.STORE\n\n        if (!tableName || tableName === ERROR_PLACEHOLDER) {\n            throw new Error('Valid DynamoDB Table selection is required')\n        }\n\n        // Validate key prefix doesn't contain separator\n        if (keyPrefix && keyPrefix.includes(KEY_SEPARATOR)) {\n            throw new Error(`Key prefix cannot contain \"${KEY_SEPARATOR}\" character`)\n        }\n\n        const dynamoClient = createDynamoDBClient(credentials, region)\n\n        if (operation === Operation.STORE) {\n            return new DynamoDBStoreTool(dynamoClient, tableName, keyPrefix)\n        } else {\n            return new DynamoDBRetrieveTool(dynamoClient, tableName, keyPrefix)\n        }\n    }\n}\n\nmodule.exports = { nodeClass: AWSDynamoDBKVStorage_Tools }\n","sourceCodeStart":347,"sourceCodeEnd":379,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/AWSDynamoDBKVStorage/AWSDynamoDBKVStorage.ts#L347-L379","documentation":"Thrown in init() when a non-empty keyPrefix contains the literal '#' character, which is reserved as KEY_SEPARATOR. The tool composes DynamoDB partition keys as `${keyPrefix}#${key}`, so an embedded '#' would corrupt the prefix/key boundary and cause silent collisions or unreachable records. Validation happens once at construction, never at query time.","triggerScenarios":"Entering a keyPrefix like 'tenant#prod', 'env#staging', or any value copied from a path that uses '#' as a delimiter; using URL fragments or namespace strings verbatim as a prefix.","commonSituations":"Reusing an existing resource-name convention (e.g. 'app#v2') as the prefix without realizing the tool reserves '#'; migrating from another KV store that allowed '#'; copy-paste from a config file that uses '#' for comments inadvertently.","solutions":["Strip or replace '#' in the intended prefix before saving the node (e.g. 'tenant#prod' -> 'tenant_prod').","If hierarchical prefixes are needed, encode them with a different delimiter ('_', '-', '.') since '#' is hard-reserved.","Add a UI-level input validator on keyPrefix so the user is warned before init() runs."],"exampleFix":"// before\nconst keyPrefix = (nodeData.inputs?.keyPrefix as string) || 'tenant#prod'\n// after\nconst keyPrefix = ((nodeData.inputs?.keyPrefix as string) || '').replace(/#/g, '_')","handlingStrategy":"validation","validationCode":"const KEY_SEPARATOR = '#'\nfunction sanitizeKeyPrefix(prefix: string): string {\n  if (prefix.includes(KEY_SEPARATOR)) {\n    throw new Error(`Key prefix cannot contain \"${KEY_SEPARATOR}\"; got: ${prefix}`)\n  }\n  return prefix\n}","typeGuard":"function isSafeKeyPrefix(prefix: unknown, sep = '#'): prefix is string {\n  return typeof prefix === 'string' && (!prefix || !prefix.includes(sep))\n}","tryCatchPattern":null,"preventionTips":["Reserve '#' mentally as the DynamoDB partition-key delimiter for this tool.","Add a UI input mask that rejects '#' on the keyPrefix field.","Document the delimiter in the node's help tooltip."],"tags":["aws","dynamodb","validation","config","delimiter"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}