{"record":{"id":"8865e5dfc7eb848c","repo":"ToolJet/ToolJet","slug":"method-not-found-8865e5","errorCode":null,"errorMessage":"Method not found","messagePattern":"Method not found","errorType":"exception","errorClass":"QueryError","httpStatus":null,"severity":"error","filePath":"plugins/packages/dynamodb/lib/index.ts","lineNumber":147,"sourceCode":"    if (Object.keys(values).length === 0) return {};\n    return { ExpressionAttributeValues: values };\n  }\n\n  private mergeExpressionAttributeValues(condition: any, pairs?: [string, string][]): void {\n    const values = this.buildExpressionAttributeValues(pairs);\n    if (Object.keys(values).length === 0) return;\n    condition.ExpressionAttributeValues = {\n      ...(condition.ExpressionAttributeValues || {}),\n      ...values,\n    };\n  }\n\n  async invokeMethod(methodName: string, _context: unknown, sourceOptions: SourceOptions, args?: any): Promise<unknown> {\n    if (methodName === 'listTables') {\n      const client = await this.getConnection(sourceOptions, { operation: 'list_tables' });\n      return await this._listAllTables(client, args);\n    }\n    throw new QueryError('Method not found', `Method '${methodName}' is not supported by the DynamoDB plugin`, {});\n  }\n\n  private async _listAllTables(\n    client: DynamoDBClient,\n    args?: any\n  ): Promise<{ items: Array<{ value: string; label: string }>; totalCount: number }> {\n    const tables: string[] = [];\n    let lastEvaluatedTableName: string | undefined;\n\n    try {\n      do {\n        const command = new ListTablesCommand({ ExclusiveStartTableName: lastEvaluatedTableName, Limit: 100 });\n        const data = await client.send(command);\n        tables.push(...(data.TableNames || []));\n        lastEvaluatedTableName = data.LastEvaluatedTableName;\n      } while (lastEvaluatedTableName);\n    } catch (err) {\n      throw new QueryError('Could not fetch tables', err.message, {});","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/ToolJet/ToolJet/blob/20602a8e101f2e59686c9afde0d1402aac2c8871/plugins/packages/dynamodb/lib/index.ts#L129-L165","documentation":"invokeMethod is the plugin's dynamic-method entry point used by ToolJet for inspector/dropdown data loading. The DynamoDB implementation only registers 'listTables'; any other methodName reaches the unconditional throw at the end of the method. This is a capability guard, not a transient failure — the plugin deliberately exposes a single method.","triggerScenarios":"ToolJet (or a custom client) calls invokeMethod with a methodName other than 'listTables' — for example 'getItems', 'describe', or a method name that exists on another plugin (e.g. MongoDB's listDatabases) but was copy-pasted into a DynamoDB query. Also fires if methodName is undefined because a component binding resolved to nothing.","commonSituations":"Reusing a query or component configuration from a different datasource plugin that exposes more invokeMethod hooks. A frontend schema/widget that enumerates methods generically and surfaces one DynamoDB does not implement. An older app definition referencing a method that was never implemented or was removed.","solutions":["Confirm the only supported methodName for DynamoDB is 'listTables'; change the caller to use it or pick a different operation.","If you need table metadata beyond names, run a 'describe_table' operation through run() instead of invokeMethod.","If methodName arrives empty, fix the upstream binding so it resolves to 'listTables'."],"exampleFix":"// before\nawait plugin.invokeMethod('describeTables', ctx, sourceOptions, args);\n// after — use the run() path for describe, invokeMethod only for listing\nawait plugin.run(sourceOptions, { operation: 'describe_table', table: 'myTable' });","handlingStrategy":"validation","validationCode":"const SUPPORTED_METHODS = ['listTables'];\nif (!SUPPORTED_METHODS.includes(methodName)) {\n  throw new Error(`DynamoDB invokeMethod supports only: ${SUPPORTED_METHODS.join(', ')}`);\n}","typeGuard":"function isDynamoInvokeMethod(m: unknown): m is 'listTables' { return m === 'listTables'; }","tryCatchPattern":"try { await plugin.invokeMethod(methodName, ctx, sourceOptions, args); }\ncatch (e) { if (e instanceof QueryError && e.message === 'Method not found') { /* fall back to run() with operation */ } else throw e; }","preventionTips":["Do not reuse method names from other plugins against DynamoDB.","Bind dropdowns that call invokeMethod to the single supported value.","Prefer run() with operation for anything beyond listing tables."],"tags":["dynamodb","method-dispatch","validation","tooljet"],"backgroundTag":null,"analyzedSha":"20602a8e101f2e59686c9afde0d1402aac2c8871","analyzedAt":"2026-08-13T05:58:54.221Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}