Skip to content

Bedrock Runtime - Start Async Invoke fails with s3Location

0

I'm trying to invoke the Twelve Labs marengo-embed-2-7-v1:0. Whenever I try to pass an S3Location I get an InternalServerException, and the output location is filled with folders with a manifest.json in them, without an output.

I'm passing a uri from the same account so I tried to not pass the bucketOwner parameter but this yields required property 'bucketOwner' not found, even though according to the api reference it's not a required property.

asked a year ago401 views

1 Answer
1
Accepted Answer

When using TwelveLabs Marengo Embed 2.7 model with StartAsyncInvoke API, you're encountering two issues that need to be addressed.

First, regarding the "bucketOwner" parameter: Despite the API reference indicating that this parameter is optional for the AsyncInvokeS3OutputDataConfig, it appears to be required specifically for the TwelveLabs Marengo Embed 2.7 model when specifying an S3 location for input media. The error message "required property 'bucketOwner' not found" confirms this requirement. You should include your AWS account ID as the bucketOwner parameter even when the bucket belongs to your own account.

For the InternalServerException issue, this could be happening for several reasons:

  1. The S3 URI format might be incorrect - ensure it follows the pattern: s3://[bucket-name]/[object-path]
  2. The model might not have proper permissions to access your S3 bucket
  3. The video file format might not be supported by the model

For your output configuration, make sure you're providing a valid S3 URI for the outputDataConfig.s3OutputDataConfig.s3Uri parameter. The empty folders with manifest.json files suggest that the async job is starting but failing during processing.

Here's a corrected request format example:

{
"modelId": "twelvelabs.marengo-embed-2-7-v1:0",
"modelInput": {
"inputType": "video",
"mediaSource": {
"s3Location": {
"uri": "s3://your-video-object-s3-path",
"bucketOwner": "your-12-digit-aws-account-id"
}
}
},
"outputDataConfig": {
"s3OutputDataConfig": {
"s3Uri": "s3://your-bucket-name/output-path"
}
}
}

For additional reference, you can check our Blog post 'TwelveLabs video understanding models are now available in Amazon Bedrock' [1] which provides a working example of the Marengo model implementation. The blog post includes code samples in Python using boto3 and demonstrates both base64 and S3 input methods. This can help you validate your implementation against a known working example. Here's the link to the blog post [1]

Make sure your IAM permissions are correctly set up to allow Bedrock to read from and write to the specified S3 locations.

References: [1] https://aws.amazon.com/blogs/aws/twelvelabs-video-understanding-models-are-now-available-in-amazon-bedrock/ [2] https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-marengo.html [3] https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_StartAsyncInvoke.html

answered a year ago

AWS
SUPPORT ENGINEER

revised a year ago

  • It's indeed an issue with permissions to access the S3 bucket, where or what policy should I change to allow it?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.