You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "gfee-home (via GitHub)" <gi...@apache.org> on 2025/04/23 01:32:44 UTC

[I] restcatalog::namespace_exists always fails [iceberg-rust]

gfee-home opened a new issue, #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234

   ### 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2833348081

   Should be fixed by https://github.com/apache/iceberg-rust/pull/1266


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2828060271

   Let me get this fixed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "gfee-home (via GitHub)" <gi...@apache.org>.
gfee-home commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2833533706

   thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2823572337

   @gfee-home Thanks for raising this.
   
   This is actually a bug in the catalog, as it should return `204` instead of `200`:
   
   https://github.com/apache/iceberg/blob/321e66ffc97349f7221096e15129a7eddb5ab81d/open-api/rest-catalog-open-api.yaml#L380-L381
   
   However, I think we can adapt the Rust code to also accept `200`. Are you interested in providing a PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2833345165

   After deeply investigating this issue, I've found that the real problem isn't related to how we handle the status code. 
   
   We already allow both `204` and `200`:
   
   https://github.com/apache/iceberg-rust/blob/5677d446dec1361459d42a6c3672d8ec605a289a/crates/catalog/rest/src/catalog.rs#L449
   
   The real problem here is that `HEAD` request won't return a http body, but we still trying to decode it into json:
   
   https://github.com/apache/iceberg-rust/blob/5677d446dec1361459d42a6c3672d8ec605a289a/crates/catalog/rest/src/client.rs#L252-L267
   
   So it's in fact a bug that need to fix instead of just a workaround.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 closed issue #1234: restcatalog::namespace_exists always fails
URL: https://github.com/apache/iceberg-rust/issues/1234


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2825097292

   I seems to suffer the same issue, so temporarily I workaround with list + contains:
   ```rust
   let namespaces = catalog.list_namespaces(None).await?;
   let namespace_exists = namespaces.contains(&namespace_ident);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 closed issue #1234: restcatalog::namespace_exists always fails
URL: https://github.com/apache/iceberg-rust/issues/1234


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] restcatalog::namespace_exists always fails [iceberg-rust]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #1234:
URL: https://github.com/apache/iceberg-rust/issues/1234#issuecomment-2828059696

   Similar to https://github.com/apache/iceberg-python/issues/1363 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org