apache/seatunnel · error · MilvusConnectorException

DATABASE_NO_COLLECTIONS

DATABASE_NO_COLLECTIONS

Error message

DATABASE_NO_COLLECTIONS

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/utils/MilvusConvertUtils.java:106

        String database = config.get(MilvusSourceOptions.DATABASE);
        List<String> collectionList = new ArrayList<>();
        if (StringUtils.isNotEmpty(config.get(MilvusSourceOptions.COLLECTION))) {
            collectionList.add(config.get(MilvusSourceOptions.COLLECTION));
        } else {
            R<ShowCollectionsResponse> response =
                    client.showCollections(
                            ShowCollectionsParam.newBuilder()
                                    .withDatabaseName(database)
                                    .withShowType(ShowType.All)
                                    .build());
            if (response.getStatus() != R.Status.Success.getCode()) {
                throw new MilvusConnectorException(
                        MilvusConnectionErrorCode.SHOW_COLLECTIONS_ERROR);
            }

            ProtocolStringList collections = response.getData().getCollectionNamesList();
            if (CollectionUtils.isEmpty(collections)) {
                throw new MilvusConnectorException(
                        MilvusConnectionErrorCode.DATABASE_NO_COLLECTIONS, database);
            }
            collectionList.addAll(collections);
        }

        Map<TablePath, CatalogTable> map = new HashMap<>();
        for (String collection : collectionList) {
            CatalogTable catalogTable = getCatalogTable(client, database, collection);
            TablePath tablePath = TablePath.of(database, null, collection);
            map.put(tablePath, catalogTable);
        }
        client.close();
        return map;
    }

    public CatalogTable getCatalogTable(
            MilvusServiceClient client, String database, String collection) {
        R<DescribeCollectionResponse> response =

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the configured database actually contains collections (check in Attu or via milvus_cli)
  2. Correct the database name in the source config (names are case-sensitive)
  3. Create the collections in the target database or move the config to the database that holds them
  4. If you intended the default database, omit/adjust the database option so 'default' is used

Example fix

// before
database = "prod_db" // exists but is empty
// after: point at the database holding your collections
database = "prod"
Defensive patterns

Strategy: validation

Validate before calling

// List collections in the target DB before configuring the source
R<ShowCollectionsResponse> r = client.showCollections(ShowCollectionsParam.newBuilder()
    .withDatabaseName(db).build());
if (r.getStatus() != R.Status.Success.getCode() || r.getData().getCollectionNamesList().isEmpty())
    throw new IllegalStateException("Database has no collections: " + db);

Try / catch

try {
  source.read();
} catch (MilvusConnectorException e) {
  if (e.getErrorCode() == MilvusConnectionErrorCode.DATABASE_NO_COLLECTIONS) {
    logger.error("Database {} is empty or wrong; check config", e.getMessage());
  } else { throw e; }
}

Prevention

When it happens

Trigger: showCollections on the configured database returns Success but with zero collection names, during MilvusSource catalog/table discovery.

Common situations: 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.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/4aef40216b011edc. Report an issue: GitHub.