SEZ9 opened a new issue, #12535:
URL: https://github.com/apache/seatunnel/issues/12535

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   ### Description
   
   When a job fails, `seatunnel-cli` passes the failure to the model as a raw 
stack trace truncated to a fixed character budget. Two fields identify a 
SeaTunnel failure:
   
   - the error code, formatted by `SeaTunnelErrorCode#getErrorMessage` as 
`ErrorCode:[JDBC-05], ErrorDescription:[Connect to database failed]`
   - the innermost `Caused by`, which is the actual cause rather than the 
wrapper
   
   Neither has a fixed position in a trace, so both are as likely to be cut off 
by the truncation as kept. The CLI has no error parsing at all today — it only 
redacts credentials and truncates — so it cannot lead with either field, group 
repeated failures, or tell a missing-driver failure apart from a wrong-password 
failure.
   
   ### Proposal
   
   Add `seatunnel_cli/diagnostics/errors.py` with a `parse_error(text) -> 
ParsedError` pure function returning the error code(s), the root-cause 
exception class and message, a category, an actionable hint, and a stable 
dedupe signature. Properties worth fixing by test:
   
   - Descriptions may themselves contain bracketed paths or SQL, so the 
`ErrorDescription:[...]` match must tolerate nesting.
   - The innermost `Caused by` outranks the outer wrapper: a generic 
`SeaTunnelRuntimeException` says less than what it wrapped.
   - Only non-connector namespaces (`API`, `COMMON`, `SE`, `TRANSFORM_COMMON`, 
...) should be enumerated; anything else is a connector namespace, so new 
connectors classify correctly without editing the module. A hardcoded connector 
list would rot on every new connector.
   - A concrete text match such as `auth` or `missing_dependency` should 
outrank the namespace category — "Access denied for user" is more useful than 
"a JDBC error happened".
   - Unrecognised input must return `category="unknown"` with no hint. A wrong 
hint is worse than a missing one, because it sends both the model and the user 
down the wrong path with false confidence.
   
   No I/O, no network, no model calls, so the behaviour is pinned by unit tests 
rather than by a live cluster. This is the parsing half of the diagnosis work 
under umbrella #11616; the consumer that feeds the parsed fields into the 
repair prompt follows separately, so that its effect on the repair rate can be 
measured on its own.
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to