{"record":{"id":"9ec817ddd5884c35","repo":"apache/seatunnel","slug":"table-tablepath-does-not-exist-in-catalog-nam","errorCode":null,"errorMessage":"Table ${tablePath} does not exist in catalog ${name()}","messagePattern":"Table (.+?) does not exist in catalog (.+?)","errorType":"exception","errorClass":"TableNotExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/mongodb/catalog/MongodbCatalog.java","lineNumber":149,"sourceCode":"        if (tableExists(tablePath)) {\n            if (ignoreIfExists) return;\n            throw new TableAlreadyExistException(name(), tablePath);\n        }\n        try {\n            MongoDatabase db = mongoClient.getDatabase(tablePath.getDatabaseName());\n            db.createCollection(tablePath.getTableName());\n        } catch (Exception e) {\n            throw new CatalogException(\n                    \"Failed to create collection: \" + tablePath.getFullName(), e);\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        if (!tableExists(tablePath)) {\n            if (ignoreIfNotExists) return;\n            throw new TableNotExistException(name(), tablePath);\n        }\n        try {\n            MongoDatabase db = mongoClient.getDatabase(tablePath.getDatabaseName());\n            db.getCollection(tablePath.getTableName()).drop();\n        } catch (Exception e) {\n            throw new CatalogException(\"Failed to drop collection: \" + tablePath.getFullName(), e);\n        }\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)\n            throws DatabaseAlreadyExistException, CatalogException {\n        throw CommonError.unsupportedOperation(name(), \"create database \");\n    }\n\n    @Override\n    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)\n            throws DatabaseNotExistException, CatalogException {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/mongodb/catalog/MongodbCatalog.java#L131-L167","documentation":"This error is raised by MongodbCatalog.dropTable when the requested collection does not exist and ignoreIfNotExists is false. It fires when a drop-table operation targets a database or collection name that has no corresponding collection in MongoDB, typically due to a misspelled collection name, wrong database, or a collection already dropped by a concurrent job; pass ignoreIfNotExists=true to make the drop a no-op instead.","triggerScenarios":"Calling dropTable on a (database, collection) that does not exist with ignoreIfNotExists=false; typo in the table path; the collection was already dropped by a previous run or another process.","commonSituations":"Cleanup scripts running twice, wrong environment (dropping in prod vs dev name), case mismatch in the collection name.","solutions":["Pass ignoreIfNotExists=true to make dropping a missing collection a no-op.","Check catalog.tableExists(tablePath) before dropping.","Verify the table path (database and collection names) matches the target environment.","If it must exist, investigate why it is missing before dropping (was it dropped already?)."],"exampleFix":"// before\ncatalog.dropTable(tablePath, false);\n// after\ncatalog.dropTable(tablePath, true); // idempotent drop","handlingStrategy":"validation","validationCode":"if (!catalog.tableExists(tablePath)) {\n    return; // nothing to drop\n}","typeGuard":null,"tryCatchPattern":"try {\n    catalog.dropTable(tablePath, false);\n} catch (TableNotExistException e) {\n    // expected on idempotent cleanup; ignore or log\n}","preventionTips":["Use ignoreIfNotExists=true for cleanup scripts","Check tableExists before destructive operations","Verify environment-specific table paths"],"tags":["mongodb","catalog","table-not-exist"],"backgroundTag":"entity-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"}