{"record":{"id":"4aef40216b011edc","repo":"apache/seatunnel","slug":"database-no-collections","errorCode":"DATABASE_NO_COLLECTIONS","errorMessage":"DATABASE_NO_COLLECTIONS","messagePattern":"DATABASE_NO_COLLECTIONS","errorType":"error_code","errorClass":"MilvusConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/utils/MilvusConvertUtils.java","lineNumber":106,"sourceCode":"        String database = config.get(MilvusSourceOptions.DATABASE);\n        List<String> collectionList = new ArrayList<>();\n        if (StringUtils.isNotEmpty(config.get(MilvusSourceOptions.COLLECTION))) {\n            collectionList.add(config.get(MilvusSourceOptions.COLLECTION));\n        } else {\n            R<ShowCollectionsResponse> response =\n                    client.showCollections(\n                            ShowCollectionsParam.newBuilder()\n                                    .withDatabaseName(database)\n                                    .withShowType(ShowType.All)\n                                    .build());\n            if (response.getStatus() != R.Status.Success.getCode()) {\n                throw new MilvusConnectorException(\n                        MilvusConnectionErrorCode.SHOW_COLLECTIONS_ERROR);\n            }\n\n            ProtocolStringList collections = response.getData().getCollectionNamesList();\n            if (CollectionUtils.isEmpty(collections)) {\n                throw new MilvusConnectorException(\n                        MilvusConnectionErrorCode.DATABASE_NO_COLLECTIONS, database);\n            }\n            collectionList.addAll(collections);\n        }\n\n        Map<TablePath, CatalogTable> map = new HashMap<>();\n        for (String collection : collectionList) {\n            CatalogTable catalogTable = getCatalogTable(client, database, collection);\n            TablePath tablePath = TablePath.of(database, null, collection);\n            map.put(tablePath, catalogTable);\n        }\n        client.close();\n        return map;\n    }\n\n    public CatalogTable getCatalogTable(\n            MilvusServiceClient client, String database, String collection) {\n        R<DescribeCollectionResponse> response =","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/utils/MilvusConvertUtils.java#L88-L124","documentation":"MilvusConvertUtils.getSourceTables throws DATABASE_NO_COLLECTIONS when the Milvus listCollections RPC succeeds but returns an empty collection list for the configured database. The connector requires at least one collection to build source tables, so an empty database is treated as an error rather than an empty result.","triggerScenarios":"showCollections on the configured database returns Success but with zero collection names, during MilvusSource catalog/table discovery.","commonSituations":"Pointing the source at a freshly created or wrong database name, case-sensitive database name mismatch, or the intended collections living in the default 'default' database while another database was configured.","solutions":["Verify the configured database actually contains collections (check in Attu or via milvus_cli)","Correct the database name in the source config (names are case-sensitive)","Create the collections in the target database or move the config to the database that holds them","If you intended the default database, omit/adjust the database option so 'default' is used"],"exampleFix":"// before\ndatabase = \"prod_db\" // exists but is empty\n// after: point at the database holding your collections\ndatabase = \"prod\"","handlingStrategy":"validation","validationCode":"// List collections in the target DB before configuring the source\nR<ShowCollectionsResponse> r = client.showCollections(ShowCollectionsParam.newBuilder()\n    .withDatabaseName(db).build());\nif (r.getStatus() != R.Status.Success.getCode() || r.getData().getCollectionNamesList().isEmpty())\n    throw new IllegalStateException(\"Database has no collections: \" + db);","typeGuard":null,"tryCatchPattern":"try {\n  source.read();\n} catch (MilvusConnectorException e) {\n  if (e.getErrorCode() == MilvusConnectionErrorCode.DATABASE_NO_COLLECTIONS) {\n    logger.error(\"Database {} is empty or wrong; check config\", e.getMessage());\n  } else { throw e; }\n}","preventionTips":["Verify the database exists and is non-empty (Attu/milvus_cli) before configuring","Remember database and collection names are case-sensitive","Confirm which database holds your collections (default vs custom)"],"tags":["milvus","source","catalog","empty-database"],"backgroundTag":"empty-result-set","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"}