Handling of Terminal Errors for Connectors During Discover & Publication #1007
Replies: 2 comments 1 reply
-
From the above, there could be 3 separate lines of work for the backend changes:
|
Beta Was this translation helpful? Give feedback.
-
one tactical thought, is to use One place i have some uncertainty: we have a separate conversation going where we'll use failures of materialization validation to identify when a collection may need to be re-versioned. Currently, we don't have a means to extract which materialization binding is not able to validate. Is this something that should be plumbed through this final error ? That's a bit weird. |
Beta Was this translation helpful? Give feedback.
-
When doing a discover or publication connectors may fail with an error if the configuration does not allow for successful completion of the operation: Wrong credentials, incorrect endpoint, database misconfiguration, etc. For these well-understood cases, the connector can return a specific human readable error message. Work has been done to accomplish this for SQL capture connectors in estuary/connectors#564 and SQL materialization connectors in estuary/connectors#612. We'd like be able to thread these specific error messages back through to the user in as clear of a way as possible.
The proposed mechanism for this is to add the human-readable error message to the
draft_errors
table for the failing draft, while keeping the developer-oriented log lines in the log output.This already pretty much happens for publications, but the message contains additional wrapping from the error bubbling up through the connector & into the connector boilerplate, into
connector-init
via the connectorstderr
, and to the agent via grpc. Errors from discovers are not added to thedraft_errors
table but they do have drafts and could in principal work the same way as errors from publications.For example, the error message in
draft_errors
that is shown to the user in the UI for an incorrect user/password on a postgres materialization publication ends up like this:The essential message that the connector intends to communicate is only the last part, which stripped of the additional wrapping would ideally look like this:
Backend Work
The initial step is to start populating the
draft_errors
table with only the error text from the connector error itself, omitting the included "wrapping". Once the mechanism for threading this basic text message through from the connector to thedraft_errors
table is in place it could be enhanced to support more elaborate presentations like markdown.To achieve this initial step for publications:
stderr
toconnector-init
for errors containing human-readable content.connector-init
will parse this text and include it in the grpc error message to the agentdraft_errors
table. If no human-readable content is present for a connector error,draft_errors
will be populated as"Connector failed. See logs for details"
or something similar.As mentioned before the process for discovers will need to change so that it works like publications and populates the
draft_errors
table with the terminal error for the operation. The agent currently runsflowctl-go
directly and streams all log output from the connector into thelog_lines
table. It will instead need to run the connector itself and interact withconnector-init
so that the human-readable error message content can be extracted.Frontend Work
The scope described so far is limited to simple text errors. Presentation of formatted (markdown, etc.) errors is definitely something we'll want to do as soon as practical, but for now the first step of optimizing the handling of text errors will provide immediate benefits.
There are at least a couple of things we could consider on the frontend:
draft_errors
when shown in the UI underConfiguration Test Failed
. Ideally these newlines would be applied at the "top level" error message shown to the user without needing to expand the logs. See below for example of the current presentation:details
for a failed discover fromdraft_errors
.draft_id
, so the challenge is telling the difference between an error during discovery for adraft_id
vs an error during publication for that samedraft_id
. Practically this should still work with our current UI discover -> publish flow: Every time a new discover is attempted, a new draft (anddraft_id
) is created. If that discover has an error, any errors indraft_errors
for thatdraft_id
must have been a result of the discover. If the discover is successful it is safe to assume during publication that any errors indraft_errors
for thatdraft_id
were a result of the publication. We may want to add more structure to these errors somehow to make the difference in these errors more robust though.Beta Was this translation helpful? Give feedback.
All reactions