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

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Bug%22)
 and found no similar issues.
   
   ### What happened
   
   When a job fails, the AI CLI asks the model to repair the config. The error 
text it forwards is cut with `error_text[:3000]` 
(`seatunnel-cli/seatunnel_cli/cli.py`, `_show_error_and_diagnose`), which keeps 
the **front** of the trace.
   
   A Java trace prints the outer wrapper first and the innermost `Caused by` 
last, so on any trace longer than 3000 characters this keeps the generic 
wrapper and throws away the part that identifies the failure. The model is then 
asked to fix the config while seeing only:
   
   ```
   org.apache.seatunnel.core.starter.exception.CommandExecuteException: 
SeaTunnel job executed failed
   ```
   
   The error code and the real cause — `ErrorCode:[JDBC-05]`, `Access denied 
for user ...` — are in the discarded tail.
   
   Measured on a 4107-character trace of the realistic shape (wrapper first, 
deep frame chain, `Caused by` last):
   
   | | error code recovered | root cause in forwarded text |
   |---|---|---|
   | `error_text[:3000]` | none | no |
   | tail of the same text | `JDBC-05` | yes |
   
   `parse_error()` (added in #12537) already extracts these fields, but it has 
no caller outside its own tests, so nothing in the running CLI benefits from it.
   
   Note that the same file already tail-truncates its locally captured output 
(`proc.stdout[-3000:]`) for exactly this reason, so the two paths disagree with 
each other.
   
   ### SeaTunnel Version
   
   dev
   
   ### SeaTunnel Config
   
   ```conf
   Not config-specific — affects any job whose failure trace exceeds 3000 
characters.
   ```
   
   ### Running Command
   
   ```shell
   # any AI CLI session where the submitted job fails with a long trace
   ./bin/seatunnel-ai.sh
   ```
   
   ### Error Exception
   
   ```log
   org.apache.seatunnel.core.starter.exception.CommandExecuteException: 
SeaTunnel job executed failed
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:100)
        ... deep frame chain ...
   Caused by: org.apache.seatunnel.common.exception.SeaTunnelRuntimeException: 
ErrorCode:[JDBC-05], ErrorDescription:[Connect to database failed]
   Caused by: java.sql.SQLException: Access denied for user 'bench'
   ```
   
   ### Zeta or Flink or Spark Version
   
   Zeta
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit 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