Lambda Function works but Step Function Fails

0

I am working with a Lambda Function that receives the below payload. I run this in test for my Lambda function and it runs successfully. When I run my Step Function it errors with the below error message. This is confusing me because I am expecting my testing in Lambda Function to work in Step Function as well.

What am I missing?

Error Message from Step Function: "errorMessage": "the JSON object must be str, bytes or bytearray, not list". Payload from Step Function Input "[{"AWSDT": "2024-03-06 04:00:00", "DATALOADCONFIGID": 1, "PROC": "info.usp_Load_F7", "TABLENAME": "Info.F7", "FILENAME": "F7_202403060400.csv"}]"

Test Payload: "[{"AWSDT": "2024-03-06 04:00:00", "DATALOADCONFIGID": 1, "PROC": "info.usp_Load_F7", "TABLENAME": "Info.F7", "FILENAME": "F7_202403060400.csv"}]"

Execution Results from Lambda Function: Test Event Name (unsaved) TestInt

Response null

Function Logs
[INFO]	2024-03-06T04:20:11.600Z		Found credentials in environment variables.
[INFO]	2024-03-06T04:20:11.768Z		SUCCESS: Connection to RDS for MySQL instance succeeded
START RequestId: aae1f5bf-2ba3-45c8-b972-e12f86176e86 Version: $LATEST
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	loading event data
[{"AWSDT": "2024-03-06 04:00:00", "DATALOADCONFIGID": 1, "PROC": "info.usp_Load_F7", "TABLENAME": "Info.F7", "FILENAME": "F7_202403060400.csv"}]
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	Length of dictionary = 163
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	setting variables
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	Variables loaded
[INFO]	2024-03-06T04:20:11.772Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	Values used ['info.usp_Load_F7'],[1],['Info.F7'],['F7_202403060400.csv'],['2024-03-06 04:00:00'],
END RequestId: aae1f5bf-2ba3-45c8-b972-e12f86176e86
REPORT RequestId: aae1f5bf-2ba3-45c8-b972-e12f86176e86	Duration: 14.08 ms	Billed Duration: 15 ms	Memory Size: 128 MB	Max Memory Used: 89 MB	Init Duration: 660.16 ms
Monty
已提問 2 個月前檢視次數 292 次
1 個回答
1
已接受的答案

If you are using python for your lambda, this could be coming from using json.loads to parse the input, if that is the case try switching that out for json.dumps and it may solve your issue.

AWS
Gillian
已回答 2 個月前
profile picture
專家
已審閱 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南