error in lambda , no clue why

0

hi, we are geting this error in the logs and have no clue why, we have a lambda which does a scan on dynambd, the lambda seems to throw an error count at the time, there seems to be nothing in dynamdb, this is the error, can anyone tell me why this is happening? { "errorType": "ValidationException", "errorMessage": "Invalid FilterExpression: Expression size has exceeded the maximum allowed size; expression size: 4172", "code": "ValidationException", "message": "Invalid FilterExpression: Expression size has exceeded the maximum allowed size; expression size: 4172", "time": "2022-09-07T16:12:20.819Z", "requestId": "RG2TJNCJ36LIHKIHPJ8V7BQ3ARVV4KQNSO5AEMVJF66Q9ASUAAJG", "statusCode": 400, "retryable": false, "retryDelay": 6.469955607178434, "stack": [ "ValidationException: Invalid FilterExpression: Expression size has exceeded the maximum allowed size; expression size: 4172", " at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)", " at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)", " at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)", " at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:686:14)", " at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)", " at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)", " at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10", " at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)", " at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:688:12)", " at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18)" ] }

1개 답변
2

From the error message, your filter expression seems to be more than 4KB, which is the maximum allowed.

It is mentioned in the documentation - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html under the Expression Parameters section - "The maximum length of any expression string is 4 KB. For example, the size of the ConditionExpression a=b is 3 bytes."

profile pictureAWS
전문가
답변함 2년 전
profile pictureAWS
전문가
검토됨 2년 전
  • i'm not sure it is that, as at the exact same time a CORS error is thrown, would the CORS error cause a limit rate?

  • From the error message, it does not look like having to do with CORS. The error is being thrown when the lambda function is trying to do a scan on DynamoDB and from the error message what I can see is that the filter expression max length is being violated.

  • I'm getting the same error when trying to update a item via the management console: Invalid ConditionExpression: Expression size has exceeded the maximum allowed size; expression size: 4255 The item has 17KB which is way lower than the 400KB limit for items in DynamoDB.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠