Skip to content

Feat: Propagate Error Through Context #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 18, 2025

Conversation

mrkaye97
Copy link
Contributor

@mrkaye97 mrkaye97 commented Jan 16, 2025

Propagating errors in upstream step runs through the context by attaching a new field to the input that's errors, which is a dictionary of key-value pairs where the keys are the step names.

Really not sure if this is implemented in a reasonable way, but it does seem to work - would love some feedback here :)

Example input from running the on failure example in Go:

{
  "input": {},
  "errors": {
    "step-one": "\"test on failure\""
  },
  "parents": {},
  "overrides": {},
  "user_data": null,
  "triggered_by": "manual"
}

Copy link

vercel bot commented Jan 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2025 11:29pm

@mrkaye97
Copy link
Contributor Author

Is there a way to test this with the other SDKs? I was trying to run a Python worker against my local setup but having issues:

[ERROR] 🪓 -- 2025-01-16 14:21:25,080 - Could not put workflow: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:443: Ssl handshake failed (TSI_PROTOCOL_FAILURE): SSL_ERROR_SSL: error:10000438:SSL routines:OPENSSL_internal:TLSV1_ALERT_INTERNAL_ERROR: Invalid certificate verification context"
        debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2025-01-16T14:21:25.079756-05:00", grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:443: Ssl handshake failed (TSI_PROTOCOL_FAILURE): SSL_ERROR_SSL: error:10000438:SSL routines:OPENSSL_internal:TLSV1_ALERT_INTERNAL_ERROR: Invalid certificate verification context"}"
>

@reillyse
Copy link
Contributor

I need a bit more context here to understand what we are trying to do.

@mrkaye97
Copy link
Contributor Author

I need a bit more context here to understand what we are trying to do.

Ah yeah, sorry about that 😅

A couple of people have been asking for if they can access the error that was thrown upstream in their on_failure steps, presumably to do different things depending on the error. So I was trying to hook up the Python SDK to my local dev setup to see if I could e.g. run the on_failure example there and see how the error propagated through / how it'd need to be parsed, but not sure how to do that (was having issues - error up there ^^)

@abelanger5
Copy link
Contributor

Is there a way to test this with the other SDKs? I was trying to run a Python worker against my local setup but having issues:

[ERROR] 🪓 -- 2025-01-16 14:21:25,080 - Could not put workflow: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:443: Ssl handshake failed (TSI_PROTOCOL_FAILURE): SSL_ERROR_SSL: error:10000438:SSL routines:OPENSSL_internal:TLSV1_ALERT_INTERNAL_ERROR: Invalid certificate verification context"
        debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2025-01-16T14:21:25.079756-05:00", grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:443: Ssl handshake failed (TSI_PROTOCOL_FAILURE): SSL_ERROR_SSL: error:10000438:SSL routines:OPENSSL_internal:TLSV1_ALERT_INTERNAL_ERROR: Invalid certificate verification context"}"
>

@mrkaye97 I usually have to trust the Caddy root cert:

HATCHET_CLIENT_TLS_ROOT_CA_FILE="/Users/belanger/Library/Application Support/Caddy/pki/authorities/local/root.crt"

Also, ensure that HATCHET_CLIENT_TLS_STRATEGY is not set

Co-authored-by: abelanger5 <belanger@sas.upenn.edu>
@mrkaye97 mrkaye97 merged commit 9efd56c into main Jan 18, 2025
30 checks passed
@mrkaye97 mrkaye97 deleted the feat--propagate-error-through-context branch January 18, 2025 02:49
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.

3 participants