Skip to content

restcatalog::namespace_exists always fails #1234

@gfee-home

Description

@gfee-home

Apache Iceberg Rust version

0.4.0 (latest version)

Describe the bug

Calling this method always generates an error with content:

Unexpected, context: { code: 200 OK, method: HEAD, url: http://localhost:8181/v1/namespaces/default, json: } => Failed to parse response from rest catalog server!, source: EOF while parsing a value at line 1 column 0

To Reproduce

Repro:

  1. Bring up minio and rest catalog using your test harness configuration
  2. Run this:

const REST_CATALOG_IP: &str = "localhost";
const REST_CATALOG_PORT: i16 = 8181;
const S3_ENDPOINT: &str = "localhost:9000";
const MINIO_IP: &str = "localhost";
const S3_ACCESS_KEY_ID: &str = "admin";
const S3_SECRET_ACCESS_KEY: &str = "password";
const S3_REGION: &str = "us-east-1";

async fn repro() -> () {
let config = RestCatalogConfig::builder()
.uri(format!("http://{}:{}", REST_CATALOG_IP, REST_CATALOG_PORT))
.props(HashMap::from([
(
S3_ENDPOINT.to_string(),
format!("http://{}:{}", MINIO_IP, 9000),
),
(S3_ACCESS_KEY_ID.to_string(), "admin".to_string()),
(S3_SECRET_ACCESS_KEY.to_string(), "password".to_string()),
(S3_REGION.to_string(), "us-east-1".to_string()),
]))
.build();

let catalog = RestCatalog::new(config);
let namespace_ident = NamespaceIdent::new("does_not_matter".to_string());

catalog.namespace_exists(&namespace_ident).await.unwrap();

}

Expected: runs without error
Actual: panics

Expected behavior

This method should return an Ok(false) for the repro above. It should return an Ok(true) if you add a line to create the namespace first.

Willingness to contribute

I would be willing to contribute a fix for this bug with guidance from the Iceberg community

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions