{"record":{"id":"2935ca10d3e89033","repo":"apache/seatunnel","slug":"failed-truncate-table-in-catalog-s-2935ca","errorCode":null,"errorMessage":"Failed TRUNCATE TABLE in catalog %s","messagePattern":"Failed TRUNCATE TABLE in catalog (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java","lineNumber":253,"sourceCode":"                        StarRocksSaveModeUtil.INSTANCE.getDropTableSql(\n                                tablePath, ignoreIfNotExists));\n            }\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed listing database in catalog %s\", catalogName), e);\n        }\n    }\n\n    public void truncateTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        try {\n            if (ignoreIfNotExists) {\n                try (Statement stmt = conn.createStatement()) {\n                    stmt.execute(StarRocksSaveModeUtil.INSTANCE.getTruncateTableSql(tablePath));\n                }\n            }\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed TRUNCATE TABLE in catalog %s\", tablePath.getFullName()),\n                    e);\n        }\n    }\n\n    public void executeSql(TablePath tablePath, String sql) {\n        try {\n            try (Statement stmt = conn.createStatement()) {\n                stmt.execute(sql);\n            }\n        } catch (Exception e) {\n            throw new CatalogException(String.format(\"Failed EXECUTE SQL in catalog %s\", sql), e);\n        }\n    }\n\n    public boolean isExistsData(TablePath tablePath) {\n        String sql = String.format(\"select * from %s limit 1\", tablePath.getFullName());\n        try (Statement statement = conn.createStatement();","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java#L235-L271","documentation":"This error is raised by StarRocksCatalog.truncateTable when executing the TRUNCATE TABLE statement against StarRocks fails (unless ignoreIfNotExists suppresses a missing table). It fires when the table cannot be truncated — for example the table does not exist, the user lacks privilege, or the JDBC statement fails — and callers such as testCatalog will see it as a CatalogException wrapping the underlying SQL error.","triggerScenarios":"Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the table exists and the user has TRUNCATE privilege","Check FE connectivity and retry after transient failures","Inspect the wrapped exception for the exact StarRocks error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}