Skip to content

states:GetExecutionHistory fails in ruby3.4 Lambda environment #3231

@amancevice

Description

@amancevice

Describe the bug

In the Lambda ruby3.4 runtime using the latest version of the aws-sdk-states gem, the states:GetExecutionHistory encounters a JSON parsing error if the execution history contains unicode characters.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Aws::States::Client.new.get_execution_history(execution_arn: 'arn:aws...') should succeed

Current Behavior

When a Step Function state machine's execution history contains an emdash (Unicode U+2014) the Ruby SDK throws an error parsing the JSON response.

/var/lang/lib/ruby/gems/3.4.0/gems/json-2.10.2/lib/json/common.rb:248:in 'String#encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError)

Reproduction Steps

  1. Create a state machine that contains an emdash (—) character in its output or variable assignment
  2. Create an execution for the state machine and take note of the execution ARN
  3. Open Lambda ruby3.4 runtime shell: docker run --rm -it --entrypoint=bash public.ecr.aws/lambda/ruby
  4. Install the states gem: gem install aws-sdk-states
  5. Open an IRB session: irb
  6. Try to get the execution history: Aws::States::Client.new.get_execution_history(execution_arn: 'arn:aws:...')
  7. See error

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-states

Environment details (Version of Ruby, OS environment)

Lambda ruby3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingIssue is being investigated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions