This is an automated email from the ASF dual-hosted git repository.
singhpk234 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new db43b88a6c Nessie: Don't log catalog options when warehouse is unset
(#18474)
db43b88a6c is described below
commit db43b88a6c0d470bd4f8acf08a18328750aeed20
Author: raashed <[email protected]>
AuthorDate: Tue Oct 13 05:18:03 2026 +0530
Nessie: Don't log catalog options when warehouse is unset (#18474)
When warehouse is not set, NessieCatalog logged the full catalog options
at WARN before failing. Those options can contain Nessie auth tokens and
storage credentials. Log only the catalog name and the missing property.
Closes #17804
---
.../java/org/apache/iceberg/nessie/NessieCatalog.java | 5 ++---
.../apache/iceberg/nessie/TestCustomNessieClient.java | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
b/nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
index dd9774fe58..62d7dbe99e 100644
--- a/nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
+++ b/nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
@@ -203,10 +203,9 @@ public class NessieCatalog extends BaseMetastoreViewCatalog
// currentNamespace
// );
LOG.warn(
- "Catalog creation for inputName={} and options {} failed, because
parameter "
+ "Catalog creation for inputName={} failed, because parameter "
+ "'warehouse' is not set, Nessie can't store data.",
- name,
- catalogOptions);
+ name);
throw new IllegalStateException("Parameter 'warehouse' not set, Nessie
can't store data.");
}
diff --git
a/nessie/src/test/java/org/apache/iceberg/nessie/TestCustomNessieClient.java
b/nessie/src/test/java/org/apache/iceberg/nessie/TestCustomNessieClient.java
index 02c68431b3..6db6fe3e5f 100644
--- a/nessie/src/test/java/org/apache/iceberg/nessie/TestCustomNessieClient.java
+++ b/nessie/src/test/java/org/apache/iceberg/nessie/TestCustomNessieClient.java
@@ -123,6 +123,23 @@ public class TestCustomNessieClient extends
BaseTestIceberg {
.hasMessage("catalogOptions must be non-null");
}
+ @Test
+ void initializeWithoutWarehouse() {
+ NessieCatalog catalog = new NessieCatalog();
+ NessieIcebergClient client = new NessieIcebergClient(null, null, null,
null);
+ FileIO fileIO = new TestCatalogUtil.TestFileIONoArg();
+
+ assertThatThrownBy(
+ () ->
+ catalog.initialize(
+ "nessie",
+ client,
+ fileIO,
+ ImmutableMap.of("nessie.authentication.token",
"secret-token")))
+ .isInstanceOf(IllegalStateException.class)
+ .hasMessage("Parameter 'warehouse' not set, Nessie can't store data.");
+ }
+
@SuppressWarnings("rawtypes")
public static final class DummyClientBuilderImpl extends
AbstractNessieClientBuilder {