Guard against a None RpcError details in DaprWorkflowClient.get_workflow_state - #1224
Open
magic-peach wants to merge 1 commit into
Open
magic-peach wants to merge 1 commit into
magic-peach wants to merge 1 commit into
Conversation
…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>
CasperGN
approved these changes
Sep 22, 2026
CasperGN
left a comment
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 opaqueTypeError: argument of type 'NoneType' is not iterableinstead 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: