8000 bug: Lambda SendTaskSuccess to Step Function causes internal server error · Issue #8247 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content
bug: Lambda SendTaskSuccess to Step Function causes internal server error #8247
Closed
@evbo

Description

@evbo

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

My Lambda sent a SendTaskSuccess message following the usual asynchronous step function procedure. Debug logs in localstack show that it caused an internal server error, albeit it is true that the token had expired (it was already sent before - unrelated issue in my own code...)

localstack-main | 2023-05-03 19:43:50.463: SendTaskSuccess => {"requestClientOptions":{"readLimit":131073,"skipAppendUriPath":false},"requestMetricCollector":null,"customRequestHeaders":null,"customQueryParameters":null,"cloneSource":null,"sdkRequestTimeout":null,"sdkClientExecutionTimeout":null,"taskToken":"bbe331ba-37fc-4af2-898d-b66e3c7e2781","output":"{"id":"badc2a75-3b55-41a1-abff-156329e4d74f"}
localstack-main | 2023-05-03 19:43:50.464: [400] SendTaskSuccess <= Task Timed Out: 'arn:aws:states:us-west-1:000000000000:lambda:invoke.waitForTaskToken'
localstack-main | 2023-05-03T19:43:50.465 INFO --- [ asgi_gw_12] localstack.request.aws : AWS stepfunctions.SendTaskSuccess => 400 (TaskTimedOut)
localstack-main | 2023-05-03T19:43:50.480 WARN --- [ asgi_gw_24] l.s.a.i.executor_endpoint : Execution environment startup failed: {"errorType":"&alloc::boxed::Box<dyn core::error::Error + core::marker::Send + core::marker::Sync>","errorMessage":"service error"}
localstack-main | 2023-05-03T19:43:50.480 ERROR --- [ asgi_gw_24] l.aws.handlers.logging : exception during call chain
localstack-main | Traceback (most recent call last):
localstack-main | File "/opt/code/localstack/localstack/aws/chain.py", line 90, in handle
localstack-main | handler(self, self.context, response)
localstack-main | File "/opt/code/localstack/localstack/aws/handlers/routes.py", line 27, in call
localstack-main | router_response = self.router.dispatch(context.request)
localstack-main | File "/opt/code/localstack/localstack/http/router.py", line 440, in dispatch
localstack-main | return self.dispatcher(request, handler, args)
localstack-main | File "/opt/code/localstack/localstack/http/dispatcher.py", line 70, in _dispatch
localstack-main | result = endpoint(request, **args)
localstack-main | File "/opt/code/localstack/localstack/services/awslambda/invocation/executor_endpoint.py", line 82, in status_error
localstack-main | self.service_endpoint.status_error(executor_id=executor_id)
localstack-main | File "/opt/code/localstack/localstack/services/awslambda/invocation/version_manager.py", line 747, in status_error
localstack-main | self.set_environment_failed(executor_id=executor_id)
localstack-main | File "/opt/code/localstack/localstack/services/awslambda/invocation/version_manager.py", line 511, in set_environment_failed
localstack-main | environment.errored()
localstack-main | File "/opt/code/localstack/localstack/services/awslambda/invocation/runtime_environment.py", line 233, in errored
localstack-main | raise InvalidStatusException("Runtime Handler can only error while starting")

Expected Behavior

An error in my Lambda should occur due to the SendTaskSuccess message failing, but it shouldn't cause an exception in LocalStack itself

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker run localstack/localstack

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

Run a Lambda that sends a task success to AWS Step Function that has already sent the same token before.

Environment

- OS:arm64/Ubuntu22.04
- LocalStack: 2.0.2-arm64

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0