Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Step Functions: State.EnteredTime format does not match AWS #10713

Open
1 task done
attila opened this issue Apr 24, 2024 · 0 comments
Open
1 task done

bug: Step Functions: State.EnteredTime format does not match AWS #10713

attila opened this issue Apr 24, 2024 · 0 comments
Labels
aws:stepfunctions AWS Step Functions status: backlog Triaged but not yet being worked on type: bug Bug report

Comments

@attila
Copy link

attila commented Apr 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I just noticed that the State.EnteredTime in the context object has a differently formatted timestamp compared to what's in the AWS service or in stepfunctions-local.

This mismatch of formats can also be observed between Execution.StartTime and State.EnteredTime, where the former is correct.

I only noticed this because we use State.EnteredTime as an "updated_at" attribute in our DynamoDB records.

Using the example below, the parsed output we receive is:

{
  "Result": {
    "Execution_StartTime": "2024-04-24T06:27:25.830Z",
    "State_EnteredTime": "2024-04-24T06:27:25.839938+00:00"
  }
}

Note the granularity of the sub-second element, and the timezone offset notation.

Expected Behavior

The date formats should match for both context attributes:

{
  "Result": {
    "Execution_StartTime": "2024-04-24T06:27:25.830Z",
    "State_EnteredTime": "2024-04-24T06:27:25.840Z"
  }
}

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 compose up

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

Create state machine

awslocal stepfunctions create-state-machine \
  --name 'example' \
  --role-arn "arn:aws:iam::000000000000:role/stepfunctions-role" \
  --definition '{"StartAt":"Debug","States":{"Debug":{"Type":"Pass","Parameters":{"Execution_StartTime.$":"$$.Execution.StartTime","State_EnteredTime.$":"$$.State.EnteredTime"},"ResultPath":"$.Result","End":true}}}'

Start an execution

awslocal stepfunctions start-execution \
  --state-machine-arn "arn:aws:states:eu-west-1:000000000000:stateMachine:example" \
  --name 'test1'

Describe execution

awslocal stepfunctions describe-execution \
  --execution-arn "arn:aws:states:eu-west-1:000000000000:execution:example:test1"

Environment

- OS: MacOS
- LocalStack: nightly (2024-04-23)

Anything else?

For readability, this is the state machine definition used in the above example:

{
  "StartAt": "Debug",
  "States": {
    "Debug": {
      "Type": "Pass",
      "Parameters": {
        "Execution_StartTime.$": "$$.Execution.StartTime",
        "State_EnteredTime.$": "$$.State.EnteredTime"
      },
      "ResultPath": "$.Result",
      "End": true
    }
  }
}
@attila attila added status: triage needed Requires evaluation by maintainers type: bug Bug report labels Apr 24, 2024
@viren-nadkarni viren-nadkarni added the aws:stepfunctions AWS Step Functions label Apr 26, 2024
@MarcelStranak MarcelStranak added status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:stepfunctions AWS Step Functions status: backlog Triaged but not yet being worked on type: bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants