{"record":{"id":"382004533e1dedf0","repo":"FlowiseAI/Flowise","slug":"valid-dynamodb-table-selection-is-required","errorCode":null,"errorMessage":"Valid DynamoDB Table selection is required","messagePattern":"Valid DynamoDB Table selection is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/AWSDynamoDBKVStorage/AWSDynamoDBKVStorage.ts","lineNumber":360,"sourceCode":"                        label: 'Error Loading Tables',\n                        name: ERROR_PLACEHOLDER,\n                        description: `Failed to load tables: ${error instanceof Error ? error.message : String(error)}`\n                    }\n                ]\n            }\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 }","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/AWSDynamoDBKVStorage/AWSDynamoDBKVStorage.ts#L342-L378","documentation":"Thrown in init() when tableName is falsy or equals the ERROR_PLACEHOLDER constant ('error'). The placeholder is used as the option name when loadMethods fails to list DynamoDB tables (see lines 266/317/334/343), so 'error' literally means the dropdown could not be populated. The tool refuses to construct a client against an unknown table.","triggerScenarios":"The user left the 'tableName' dropdown empty; the dropdown fell back to 'error' because the ListTables call failed (bad credentials, wrong region, no tables in account); or the flow JSON was hand-edited and tableName was removed.","commonSituations":"First-time setup with credentials that have no DynamoDB read permission, so the table list never loads and 'error' is saved as the selection; region mismatch where tables exist elsewhere; deploying a flow between environments without recreating the table.","solutions":["Re-open the node and pick a concrete table from the dropdown — if the dropdown shows an error, fix the underlying AWS credentials/region first.","Grant the credential IAM identity dynamodb:ListTables on '*' so the dropdown populates.","Confirm the chosen region (default us-east-1) is the one where the table was created.","If hand-editing the flow JSON, set inputs.tableName to the exact, case-sensitive table name."],"exampleFix":"// before\nif (!tableName || tableName === ERROR_PLACEHOLDER) {\n  throw new Error('Valid DynamoDB Table selection is required')\n}\n// after: also tell the user WHY selection is missing\nif (!tableName || tableName === ERROR_PLACEHOLDER) {\n  throw new Error(\n    `Valid DynamoDB Table selection is required (received \"${tableName}\" — ` +\n    `the dropdown likely failed to list tables; check AWS credentials and region)`\n  )\n}","handlingStrategy":"validation","validationCode":"const ERROR_PLACEHOLDER = 'error'\nfunction assertTableName(tableName: string | undefined): asserts tableName is string {\n  if (!tableName || tableName === ERROR_PLACEHOLDER) {\n    throw new Error('Pick a concrete DynamoDB table from the dropdown before saving the node.')\n  }\n}","typeGuard":"function isValidTableName(name: unknown, badSet = new Set(['', 'error'])): name is string {\n  return typeof name === 'string' && !badSet.has(name) && name.length > 0\n}","tryCatchPattern":"try {\n  assertTableName(nodeData.inputs?.tableName)\n} catch (e) {\n  // surface in the UI: 'Re-select the table; the dropdown may have failed to load.'\n  return { error: (e as Error).message }\n}","preventionTips":["Grant dynamodb:ListTables so the dropdown populates and 'error' is never saved.","Validate the table selection at flow-save time, not just at runtime init.","After importing a flow, re-select dependent AWS dropdowns before deploying."],"tags":["aws","dynamodb","config","validation","dropdown"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}