Skip to content

Dapr workflow doesn't work when Amazon DynamoDB is used as actor state store #3643

Closed as not planned
@distkloc

Description

@distkloc

Expected Behavior

Dapr workflow should complete without error when the actor state store is DynamoDB.
If the value which is saved in DynamoDB state store is any binary data, save it as DynamoDB binary data type.

Actual Behavior

The following error occurs when the workflow quickstart code runs.

2025/01/10 00:05:00 failed to start workflow: failed to start orchestrator: rpc error: code = Unknown desc = error from internal actor: InternalFailure: The request processing has failed because of an unknown error, exception or failure.
== APP - order-processor ==     status code: 500, request id: 263b9cb8-2ddd-4ef1-9bcc-402853c8319c
== APP - order-processor == exit status 1
The App process exited with error code: exit status 1

This is because DynamoDB state store doesn't fully support binary data value.
When a state is saved in DynamoDB state store, the value is converted to string. If the string contains invalid UTF-8 sequences, DynamoDB throws error.

スクリーンショット 2025-01-10 1 13 29

Steps to Reproduce the Problem

  1. Create DynamoDB table with primary key (attribute name: key)
  2. git clone https://github.com/dapr/quickstarts.git
  3. Remove workflows/components/statestore_redis.yaml
  4. Add workflows/components/statestore_dynamodb.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: statestore
spec:
  type: state.aws.dynamodb
  version: v1
  metadata:
  - name: region
    value: ap-northeast-1
  - name: table
    value: dapr_state
  - name: actorStateStore
    value: "true"
  1. cd workflows/go/sdk
  2. dapr run -f .

Release Note

RELEASE NOTE:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions