apache/iceberg · error · IllegalStateException

Parameter 'warehouse' not set, Nessie can't store data.

Error message

Parameter 'warehouse' not set, Nessie can't store data.

What it means

NessieCatalog.warehouseLocation requires a 'warehouse' location because Nessie itself does not store data — it only tracks metadata. If neither 'warehouse' nor a resolvable warehouse location is present in the catalog options, initialization fails with this IllegalStateException since tables would have nowhere to be written.

Source

Thrown at nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java:210

      //    Pair<CatalogPlugin, Identifier> catalogIdentifier =
      // SparkUtil.catalogAndIdentifier(nameParts,
      //        catalogName ->  {
      //          try {
      //            return catalogManager.catalog(catalogName);
      //          } catch (Exception e) {
      //            return null;
      //          }
      //        },
      //        Identifier::of,
      //        defaultCatalog,
      //        currentNamespace
      //    );
      LOG.warn(
          "Catalog creation for inputName={} and options {} failed, because parameter "
              + "'warehouse' is not set, Nessie can't store data.",
          name,
          catalogOptions);
      throw new IllegalStateException("Parameter 'warehouse' not set, Nessie can't store data.");
    }

    return LocationUtil.stripTrailingSlash(warehouseLocation);
  }

  @Override
  public void close() throws IOException {
    if (null != closeableGroup) {
      closeableGroup.close();
    }
  }

  @Override
  public String name() {
    return name;
  }

  @Override

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Add 'warehouse' to the catalog properties, e.g. setProperty("warehouse", "s3://bucket/path") or an HDFS/absolute file path.
  2. If using Spark SQL, set the catalog warehouse in spark SQL conf: spark.sql.catalog.nessie.warehouse=... .
  3. If creating a single table, alternatively give the table an explicit 'location' — though the warehouse property remains the recommended fix.

Example fix

// before
conf.set("spark.sql.catalog.nessie.uri", "http://nessie:19120/api/v2");
// after
conf.set("spark.sql.catalog.nessie.uri", "http://nessie:19120/api/v2");
conf.set("spark.sql.catalog.nessie.warehouse", "s3://my-bucket/warehouse");
Defensive patterns

Strategy: validation

Validate before calling

if (properties.get("warehouse") == null) {
  throw new IllegalArgumentException("Nessie catalog requires the 'warehouse' property (e.g. s3://bucket/warehouse)");
}

Try / catch

try {
  catalog.initialize(name, props, conf);
} catch (IllegalStateException e) {
  if (e.getMessage().contains("warehouse")) {
    props.put("warehouse", "s3://my-bucket/warehouse");
    catalog.initialize(name, props, conf);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling NessieCatalog.initialize with catalog properties that omit the 'warehouse' key (and no default warehouse configured), then creating/loading any table, which resolves warehouseLocation during initialize.

Common situations: Configuring a Nessie catalog for the first time and only setting uri/ref; migrating configs from catalogs that don't need a warehouse; Spark SQL DDL where only the location clause was expected to provide paths.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/57d9f9d1a789b1f7. Report an issue: GitHub.