{
"@service": "benthos",
"label": "output_pubsub",
"level": "error",
"msg": "Failed to send message to gcp_pubsub: failed to get topic: test-topic-2: failed to validate topic 'test-topic-2': rpc error: code = Unauthenticated desc = transport: per-RPC creds failed due to error: oauth2: cannot fetch token: 400 Bad Request\nResponse: {\n \"error\": \"invalid_grant\",\n \"error_description\": \"Bad Request\"\n}",
"path": "root.output_resources"
}
But when I want to use that in the log_and_metric component to extract the error type and add metric and log, the fallback_error has the field "fallback_error":"message failed to reach a target destination" and not the actual error message.
If I remove the retry component and directly configure output under fallback, the fallback_error correctly returns the error from pubsub.
In the below config,
output_pubsub
is gcp_pubsub component. When there is an exception returned from that component, I see it in the error log.error_log
But when I want to use that in the
log_and_metric
component to extract the error type and add metric and log, thefallback_error
has the field"fallback_error":"message failed to reach a target destination"
and not the actual error message.If I remove the retry component and directly configure output under fallback, the fallback_error correctly returns the error from pubsub.
fallback_error field as expected -
"fallback_error":"failed to get topic: test-topic-2: failed to validate topic 'test-topic-2': rpc error: code = Unauthenticated desc = transport: per-RPC creds failed due to error: oauth2: cannot fetch token: 400 Bad Request\nResponse: {\n \"error\": \"invalid_grant\",\n \"error_description\": \"Bad Request\"\n
How to propagate the error from output components under
retry
to outside components?