{"record":{"id":"8a17068a902c6a7b","repo":"apache/seatunnel","slug":"failed-to-drop-table-s-in-catalog-s-8a1706","errorCode":null,"errorMessage":"Failed to drop table %s in catalog %s","messagePattern":"Failed to drop table (.+?) in catalog (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/catalog/TypesenseCatalog.java","lineNumber":175,"sourceCode":"            return;\n        }\n        typesenseClient.createCollection(tablePath.getTableName());\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        checkNotNull(tablePath);\n        if (!tableExists(tablePath)) {\n            if (!ignoreIfNotExists) {\n                throw new TableNotExistException(catalogName, tablePath);\n            }\n            return;\n        }\n        try {\n            typesenseClient.dropCollection(tablePath.getTableName());\n        } catch (Exception ex) {\n            throw new CatalogException(\n                    String.format(\n                            \"Failed to drop table %s in catalog %s\",\n                            tablePath.getTableName(), catalogName),\n                    ex);\n        }\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)\n            throws DatabaseAlreadyExistException, CatalogException {\n        createTable(tablePath, null, ignoreIfExists);\n    }\n\n    @Override\n    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)\n            throws DatabaseNotExistException, CatalogException {\n        dropTable(tablePath, ignoreIfNotExists);\n    }","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/catalog/TypesenseCatalog.java#L157-L193","documentation":"TypesenseCatalog.dropTable wraps any exception from typesenseClient.dropCollection() in a CatalogException reporting that the collection (table) could not be dropped. It is raised in dropTable and also propagates via dropDatabase.","triggerScenarios":"typesenseClient.dropCollection(tableName) throws: HTTP 404 (collection doesn't exist), HTTP 401/403 (bad API key), network error to the Typesense node, or the client library failing on the delete request.","commonSituations":"Dropping a table that was already removed (or never created because a prior job failed); wrong/misconfigured apiKey lacking delete permission; unreachable Typesense host/port in catalog config; case-sensitive collection name mismatches.","solutions":["Verify the collection exists: GET /collections and compare the exact (case-sensitive) name.","Check the Typesense API key has delete permissions and matches the target cluster.","Confirm network reachability to the Typesense node (host/port/protocol) from the client.","If the table may already be gone, check existence first (tableExists) or tolerate 404 before calling dropTable."],"exampleFix":"// before\ncatalog.dropTable(TablePath.of(\"db\", \"mycollection\"));\n// after\nif (catalog.tableExists(TablePath.of(\"db\", \"mycollection\"))) {\n    catalog.dropTable(TablePath.of(\"db\", \"mycollection\"));\n}","handlingStrategy":"try-catch","validationCode":"// Check collection exists before dropping\nboolean exists = catalog.tableExists(TablePath.of(\"db\", \"mycollection\"));","typeGuard":null,"tryCatchPattern":"try {\n    catalog.dropTable(tablePath);\n} catch (CatalogException e) {\n    if (!catalog.tableExists(tablePath)) {\n        log.warn(\"Collection already absent; treating drop as no-op\");\n    } else { throw e; }\n}","preventionTips":["Check tableExists before dropTable to tolerate re-runs","Use an API key with delete permissions and the correct cluster","Verify Typesense host/port connectivity from the job environment","Respect Typesense's case-sensitive collection names in config"],"tags":["typesense","catalog","drop-table","http"],"backgroundTag":"http-error-response","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"}