Skip to content

Guard against a None RpcError details in DaprWorkflowClient.get_workflow_state - #1224

Open
magic-peach wants to merge 1 commit into
dapr:mainfrom
magic-peach:fix/sync-workflow-client-get-state-none-details
Open

magic-peach wants to merge 1 commit into
dapr:mainfrom
magic-peach:fix/sync-workflow-client-get-state-none-details

Conversation

@magic-peach

Copy link
Copy Markdown
Contributor

Description

The sync DaprWorkflowClient.get_workflow_state checks if 'no such instance exists' in error.details(): with no None check. RpcError.details() returns None for connection-level failures such as UNAVAILABLE, where the sidecar is unreachable and there is no trailing metadata from the server. That crashes with an opaque TypeError: argument of type 'NoneType' is not iterable instead of the intended "Unhandled RPC error" log and re-raise.

The async client (aio/dapr_workflow_client.py) already guards this correctly with if error.details() and 'no such instance exists' in error.details():. This brings the sync client in line with it.

Issue reference

Please reference the issue this PR will close: #[issue number]

N/A, self-discovered while auditing workflow client error handling, no existing issue filed. The only related issue is #745 (closed), which is a different failure mode (the original "not found" string match).

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

…low_state

The async client already checks error.details() before searching it for
'no such instance exists'. The sync client does not, so any RpcError
whose details() returns None, such as UNAVAILABLE when the sidecar is
unreachable, crashes with a TypeError instead of surfacing the real
error.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
@magic-peach
magic-peach requested review from a team as code owners September 20, 2026 14:26

@CasperGN CasperGN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

RpcError.details() returns None for connection-level failures such as UNAVAILABLE, so 'no such instance exists' in error.details() raised TypeError: argument of type 'NoneType' is not iterable and masked the intended log-and-reraise. The async client in aio/dapr_workflow_client.py already guards this the same way, so this removes a divergence between the two clients rather than adding new behaviour. Test covers the UNAVAILABLE path with details=None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants