【以下的问题经过翻译处理】 我正在编写一个非常简单的 step function 状态机,使用AWS SDK从S3中检索文件。
每次运行时,从S3获取文件的任务都会失败,并显示一个"S3.InvalidContent"错误,"Failed to convert 'Body' to string"是原因。
我的状态机的完整定义如下:
{
"Comment": "A description of my state machine",
"StartAt": "GetAudioFile",
"States": {
"GetAudioFile": {
"Type": "Task",
"Parameters": {
"Bucket": "11123",
"Key": "test.wav"
},
"Resource": "arn:aws:states:::aws-sdk:s3:getObject",
"End": true
}
}
}
TaskFailed事件的完整文本是:
{
"resourceType": "aws-sdk:s3",
"resource": "getObject",
"error": "S3.InvalidContent",
"cause": "Failed to convert 'Body' to string"
}
具有错误的CloudWatch日志条目的完整文本如下:
{
"id": "5",
"type": "TaskFailed",
"details": {
"cause": "Failed to convert 'Body' to string",
"error": "S3.InvalidContent",
"resource": "getObject",
"resourceType": "aws-sdk:s3"
},
"previous_event_id": "4",
"event_timestamp": "1651894187569",
"execution_arn": "arn:aws:states:us-east-1:601423303632:execution:test:44ae6102-b544-3cfa-e186-181cdf331493"
}
- 我做错了什么?
- 我该如何解决?
- 您还需要哪些其他信息?
- 最重要的是,我在哪里可以找到答案来回答这些问题?