Skip to content

BedRock InvokeFlow boto3 fails intermittently Internal Server Exception

0

boto3: Version: 1.35.14 Python 3.11.9

Code

    bedrock = boto3.client('bedrock-agent-runtime')
    document_names = ['doc1', 'doc2']

    response = bedrock.invoke_flow(
        flowAliasIdentifier=settings.flow_alias_identifier,
        flowIdentifier=settings.flow_identifier,
        inputs=[
            {
                'content': {
                    'document': document_names
                },
                'nodeName': 'FlowInputNode',
                'nodeOutputName': 'document'
            },
        ]
    )

botocore.errorfactory.InternalServerException: An error occurred (InternalServerException) when calling the InvokeFlow operation (reached max retries: 4): Internal Server Exception

Trace: File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/fastapi/applications.py", line 269, in call await super().call(scope, receive, send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/applications.py", line 124, in call await self.middleware_stack(scope, receive, send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 84, in call await self.app(scope, receive, send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/exceptions.py", line 93, in call raise exc File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/exceptions.py", line 82, in call await self.app(scope, receive, sender) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/routing.py", line 670, in call await route.handle(scope, receive, send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/routing.py", line 266, in handle await self.app(scope, receive, send) File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/starlette/routing.py", line 65, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/fastapi/routing.py", line 227, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/fastapi/routing.py", line 160, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/zygao/Documents/nextjs-template/src/server/main.py", line 65, in invoke_flow response = bedrock.invoke_flow( ^^^^^^^^^^^^^^^^^^^^ File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/botocore/client.py", line 569, in _api_call return self._make_api_call(operation_name, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/zygao/Documents/python3.11/lib/python3.11/site-packages/botocore/client.py", line 1023, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.InternalServerException: An error occurred (InternalServerException) when calling the InvokeFlow operation (reached max retries: 4): Internal Server Exception

asked 2 years ago201 views

1 Answer
0

I would recommend opening a Support Case for this to allow support engineer to investigate logs and figure out the source of the issue.

AWS
EXPERT

answered a year ago

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.