Skip to content

grpc Status response to query errors contains malformed details #7487

Open
@Sushisource

Description

@Sushisource

I went to try to finish temporalio/sdk-core#867 real quick only to find it's very difficult to inspect the full Failure responses in anything other than Go.

When you get back from a client query call looks like this:

[core/../tests/integ_tests/queries_tests.rs:273:5] &q_resp = Status {
    code: InvalidArgument,
    message: "oh no broken",
    details: b"\x08\x03\x12\x0coh no broken\x1a\\\nCtype.googleapis.com/temporal.api.errordetails.v1.QueryFailedFailure\x12\x15\n\x13\n\x0coh no broken\x12\x03src",
    metadata: MetadataMap {
        headers: {
            "content-type": "application/grpc",
        },
    },
    source: None,
}

There are a few issues here:
https://github.com/temporalio/api/blob/master/temporal/api/workflowservice/v1/service.proto#L551 's comment should say something about how the encoded failure is packed into the Status details field, which ostensibly, should be that it follows the guidance here: https://google.aip.dev/193#statusdetails and attaches some an Any containing an ErrorInfo followed by an Any Wrapping a QueryFailedFailure
AFAICT it's not doing that, though. I can't actually tell how this binary string is constructed. Luckily no SDK is using this yet so we can fix it. If it's not following the guidance (maybe it is and somehow I'm just not unpacking it right, but I don't think so), we should adhere to that.

From my reading of the binary it looks like it's just directly serializing a https://github.com/temporalio/api-go/blob/master/serviceerror/query_failed.go#L35 somehow, which maybe is OK for api-go users, but isn't for anyone else.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions