Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-intuitive Error Message When Using HTTP with ObjectStore #14546

Open
WetABQ opened this issue Feb 7, 2025 · 0 comments
Open

Non-intuitive Error Message When Using HTTP with ObjectStore #14546

WetABQ opened this issue Feb 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@WetABQ
Copy link

WetABQ commented Feb 7, 2025

Describe the bug

When attempting to use the object_store crate with an HTTP URL, the error message returned is non-intuitive. The error is caused by the object_store crate enforcing HTTPS, but the error message does not clearly indicate this. Instead, it returns a generic error message that can be confusing to users.

Error Message:

ObjectStore(Generic { store: "HTTP", source: Request { source: Reqwest { retries: 0, max_retries: 10, elapsed: 65.417µs, retry_timeout: 180s, source: reqwest::Error { kind: Builder, url: "http://127.0.0.1:3000/hits_0.parquet", source: BadScheme } } } })

To Reproduce

Set up a local HTTP server serving a Parquet (or whatever) file at http://127.0.0.1:3000/hits_0.parquet.

Use the following code snippet to attempt to register the Parquet file with a DataFusion context:

 use std::sync::Arc;
 use datafusion::prelude::{ParquetReadOptions, SessionConfig, SessionContext};
 use object_store::http::HttpBuilder;
 use url::Url;

 #[tokio::main]
 async fn main() -> datafusion::error::Result<()> {
     let mut config = SessionConfig::new();
     let ctx = SessionContext::new_with_config(config);

     let base_url = Url::parse("http://127.0.0.1:3000/").unwrap();
     let object_store = HttpBuilder::new()
           .with_url(base_url.clone())
           .build()
           .unwrap();
     ctx.register_object_store(&base_url, Arc::new(object_store));

     ctx.register_parquet(
         "hits",
         "http://127.0.0.1:3000/hits_0.parquet",
         ParquetReadOptions::default()
     ).await?;

     Ok(())
 }

Expected behavior

The error should be raised after the object store has been retrieved, and it should clearly indicate that the issue is related to the use of HTTP instead of HTTPS. A more intuitive error message would help users quickly identify and resolve the issue.

Additional context

Config Option: https://docs.rs/object_store/0.11.2/object_store/enum.ClientConfigKey.html

@WetABQ WetABQ added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant