Skip to content

0.38.0 does not compile without the remote feature: job.rs uses the remote-gated Error::Http variant #4142

Closed
akchhayasharma/lancedb
#1

Description

@uqio

Summary

lancedb 0.38.0 does not compile without the remote feature: src/job.rs is compiled unconditionally (pub mod job; in src/lib.rs) and constructs Error::Http { … }, but that variant is declared behind #[cfg(feature = "remote")] in src/error.rs. Since the crate's default feature set is empty, a plain lancedb = "0.38" dependency (with or without default-features = false) fails to build. 0.37.1 builds fine with the same feature set.

Reproduction

[dependencies]
lancedb = "0.38"   # default features are empty, so `default-features = false` makes no difference
$ cargo check
error[E0599]: no variant named `Http` found for enum `error::Error`
  --> …/lancedb-0.38.0/src/job.rs:56:40
   |
56 |             Some(request_id) => Error::Http {
   |                                        ^^^^ variant not found in `error::Error`
   |
  ::: …/lancedb-0.38.0/src/error.rs:55:1

error[E0599]: no variant named `Http` found for enum `error::Error`
  --> …/lancedb-0.38.0/src/job.rs:66:40
   |
66 |             Some(request_id) => Error::Http {
   |                                        ^^^^ variant not found in `error::Error`

rustc 1.98.0 (88d9e12ae 2026-08-18), macOS aarch64. Enabling remote makes it compile, but that pulls in reqwest/http/urlencoding and the lance-namespace-impls REST adapters, which a local-only embedding has no use for.

Where

  • src/lib.rs:188 — pub mod job; (ungated)
  • src/job.rs:56 and :66 — Error::Http { source, request_id, status_code }
  • src/error.rs:111 — #[cfg(feature = "remote")] on the Http variant

Suggested fix

Either gate the module (#[cfg(feature = "remote")] pub mod job;) if the job API is remote-only, or gate the two Error::Http arms in job.rs behind remote and fall through to the existing non-HTTP variant otherwise. A cargo check --no-default-features (which for this crate is the default build) in CI would catch this class.

Thanks — happy to open a PR for whichever shape you prefer.

Activity

  1. akchhayasharma commented on Sep 8, 2026

    @akchhayasharma

    I'd like to take this. Plan: keep pub mod job; ungated (the module isn't
    remote-only — it has local job support), and instead gate the two
    Error::Http arms in TerminalResult::decode() behind
    #[cfg(feature = "remote")], falling through to the existing
    Error::Runtime variant otherwise. request_id is only Some for remote
    jobs, so the fallback is unreachable in practice without the feature.
    Will verify with cargo check -p lancedb --no-default-features and
    --features remote.

  2. SIDDARTHAREDDY8 commented on Sep 20, 2026

    @SIDDARTHAREDDY8
    Contributor

    I hit this too while building lancedb without default features. @akchhayasharma claimed this on Sep 8 with a plan but no PR has appeared in the 12 days since, so I went ahead and implemented the same approach: TerminalResult::decode in rust/lancedb/src/job.rs now builds the failure through a small remote_job_error helper that is Error::Http with the remote feature and falls back to Error::Runtime without it (where the Http variant does not exist). Verified cargo check -p lancedb --no-default-features fails with the reported E0599 before the change and passes after, and --features remote still passes. Opening a PR shortly — happy to step aside if you already have one in flight.

  3. Goldziher commented on Oct 3, 2026

    @Goldziher

    0.39.0 has the same defect. In rust/lancedb/src/job.rs the two decode() arms still construct
    Error::Http { … } unconditionally (~lines 102/112), while error.rs gates the variant behind
    #[cfg(feature = "remote")]. With the default (empty) feature set, lancedb = "0.39" fails with
    the same E0599: no variant named 'Http'; --features remote compiles. 0.37.1 remains the last
    release that builds with default features.

  4. assiotis commented on Oct 16, 2026

    @assiotis

    This continues to be a problem in the upcoming release. I reckon this is a good opportunity to also address that TerminalResult can theoretically represent combinations that make no sense TerminalResult { value: None, request_id: None }. I think a better representation is:

    #[derive(Clone)]
    pub(crate) enum TerminalResult {
        Local(Value),
        Remote { value: Option<Value>, request_id: String },
    }

    Since visibility is pub(crate) external API doesn't break. You can even #[cfg(feature = "remote")] gate the Remote variant. So a more complete solution would look like:

    #[derive(Clone)]
    pub(crate) enum TerminalResult {
        Local(Value),
        #[cfg(feature = "remote")]
        Remote { value: Option<Value>, request_id: String },
    }
    
    impl TerminalResult {
        #[cfg(feature = "remote")] 
        pub(crate) fn value(&self) -> Option<&Value> {
            match self {
                Self::Local(value) => Some(value),
                Self::Remote { value, .. } => value.as_ref(),
            }
        }
    
        fn decode<T: DeserializeOwned>(self) -> Result<T> {
            match self {
                Self::Local(value) => serde_json::from_value(value).map_err(|error| Error::Runtime {
                    message: format!("failed to parse typed job result: {error}"),
                }),
                #[cfg(feature = "remote")]
                Self::Remote { value, request_id } => crate::remote::job::decode_result(value, request_id), // new function, can return Error::Http
            }
        }
    }

    That said, if there's appetite for a breaking change, I don't think it makes sense for a parsing error to become an HTTP error. If there's no non-200 HTTP status code in the code, it's by convention, not an HTTP error. I recommend adding another error variant to the Error enum, but it will break the public API.

  5. terapyon commented on Oct 21, 2026

    @terapyon

    Still reproducible with lancedb = "=0.40.0" from crates.io (its src/job.rs is identical to tag v0.40.0), and main @ <MAIN_SHA> (0.41.0-beta.10) still has the same ungated Error::Http arms at rust/lancedb/src/job.rs:104 and :114.

    $ cargo build   # lancedb = "=0.40.0", default features
    error[E0599]: no variant named `Http` found for enum `error::Error`
       --> .../lancedb-0.40.0/src/job.rs:102:40
    error[E0599]: no variant named `Http` found for enum `error::Error`
       --> .../lancedb-0.40.0/src/job.rs:112:40
    

    rustc 1.97.1, Linux x86_64. The regression came in with 426684c (#3985, 2026-08-21), so tags v0.38.0, v0.39.0 and v0.40.0 all contain it.

    One more data point on why CI does not catch it: the "Run clippy (without remote feature)" step in .github/workflows/rust.yml runs with --workspace, and both python/Cargo.toml and nodejs/Cargo.toml enable lancedb/remote by default, so feature unification turns remote back on for lancedb. <MAIN_CHECK_RESULT>
    #4100 added a package-scoped cargo check -p lancedb --no-default-features step for exactly this, but it was closed unmerged, and the two open PRs (#4103, #4233) only touch job.rs. It might be worth adding that CI step together with whichever fix lands.

    Our use case: we embed lancedb in-process (cdylib loaded by a .NET host) for local-only storage, so we would prefer not to enable remote. For now we work around it with features = ["remote"], which adds 18 crates to the dependency tree (419 → 437 with cargo tree -e normal), including axum, tonic, arrow-flight, oauth2 and webbrowser.

  6. added a commit that references this issue on Oct 22, 2026
    d37a6b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions