{"record":{"id":"d3278964a1aaa057","repo":"apache/seatunnel","slug":"failed-to-drop-table","errorCode":null,"errorMessage":"Failed to drop table: ","messagePattern":"Failed to drop table: ","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java","lineNumber":320,"sourceCode":"    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        DropTableRequest request = new DropTableRequest();\n        List<String> ids = Lists.newArrayList(tablePath.getTableName());\n        request.setId(ids);\n        try {\n            namespace.dropTable(request);\n        } catch (Exception e) {\n            String errorMsg = e.getMessage();\n            if (errorMsg != null\n                    && (errorMsg.contains(\"Table does not exist\")\n                            || errorMsg.contains(\"TABLE_NOT_FOUND\")\n                            || errorMsg.contains(\"404\")\n                            || errorMsg.contains(\"Not found\"))) {\n                if (!ignoreIfNotExists) {\n                    throw new TableNotExistException(catalogName, tablePath, e);\n                }\n            } else {\n                throw new CatalogException(\"Failed to drop table: \" + tablePath.getTableName(), e);\n            }\n        }\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)\n            throws DatabaseAlreadyExistException, CatalogException {}\n\n    @Override\n    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)\n            throws DatabaseNotExistException, CatalogException {}\n\n    private CatalogTable convertTableSchema(\n            JsonArrowSchema arrowSchema, TablePath tablePath, Schema arrowSchemaFromDataset) {\n        if (Objects.isNull(arrowSchema)) {\n            return null;\n        }\n","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java#L302-L338","documentation":"LanceCatalog.dropTable calls the Lance namespace service's dropTable; if it throws and the message does not match known 'table does not exist' patterns (or the table does exist but ignoreIfNotExists is false), the error is wrapped in a CatalogException with the table name. It means the drop operation failed for a reason other than a benign not-exists case.","triggerScenarios":"Calling LanceCatalog.dropTable(tablePath, ignoreIfNotExists) when the namespace backend returns an unexpected exception: connection failures to the namespace service, permission errors, malformed table identifiers, or backend errors whose message does not contain 'Table does not exist'/'TABLE_NOT_FOUND'/'404'/'Not found' even though the root cause is a missing table.","commonSituations":"Namespace service (e.g. Lance REST namespace) is down or unreachable; table path/identifier passed in a format the namespace cannot resolve; IAM/credentials lack delete permission; backend returns a differently-worded not-found error that the string-matching heuristic misses.","solutions":["Inspect the cause (e) for the real backend error — check namespace service connectivity and endpoint config first.","Verify the table identifier is correct and matches how the namespace registers tables (get the exact id via listTables).","Check credentials/permissions of the configured namespace client allow drop operations.","If the table may legitimately be absent and your backend phrases not-found differently, call with ignoreIfNotExists=true and/or pre-check tableExists(tablePath) before dropping."],"exampleFix":"// before\ncatalog.dropTable(tablePath, false);\n// after\nif (catalog.tableExists(tablePath)) {\n    catalog.dropTable(tablePath, true);\n}","handlingStrategy":"validation","validationCode":"if (catalog != null && catalog.tableExists(tablePath)) { catalog.dropTable(tablePath, true); }","typeGuard":null,"tryCatchPattern":"try { catalog.dropTable(tablePath, ignoreIfNotExists); } catch (CatalogException e) { log.error(\"drop table {} failed: {}\", tablePath, e.getCause(), e); throw e; }","preventionTips":["Check tableExists before dropping when the table may be absent.","Use ignoreIfNotExists=true for idempotent pipelines.","Validate namespace service connectivity/credentials before catalog operations.","Log the cause chain — the string-match heuristic may misclassify backend not-found errors."],"tags":["catalog","lance","drop-table","namespace"],"backgroundTag":"resource-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}