jdx/mise · error

cloned request builder should remain cloneable

Error message

cloned request builder should remain cloneable

What it means

The Lua http module retries requests by cloning a template reqwest::RequestBuilder each attempt. try_clone returns None if the builder holds a non-cloneable (streaming) body, so mise panics with this message. Plugin HTTP helpers are expected to send in-memory bodies only.

Source

Thrown at crates/vfox/src/lua_mod/http.rs:46

        () = cancelled => Err(mlua::Error::runtime("interrupted")),
    }
}

async fn send_with_retry(builder: RequestBuilder) -> std::result::Result<Response, reqwest::Error> {
    let url = builder
        .try_clone()
        .and_then(|b| b.build().ok())
        .map(|r| r.url().to_string())
        .unwrap_or_default();
    let Some(template) = builder.try_clone() else {
        return builder.send().await;
    };

    let attempts = http_retry_attempts().max(1);
    for attempt in 0..attempts {
        let response = template
            .try_clone()
            .expect("cloned request builder should remain cloneable")
            .send()
            .await;

        let transient_err: Option<String> = match response {
            Ok(resp) if should_retry_status(resp.status()) && attempt + 1 < attempts => {
                Some(format!("HTTP {}", resp.status()))
            }
            Ok(resp) => return Ok(resp),
            Err(err) if is_transient(&err) && attempt + 1 < attempts => Some(err.to_string()),
            Err(err) => return Err(err),
        };

        if let Some(msg) = transient_err {
            let delay = retry_delay(attempt);
            log::warn!(
                "HTTP {} attempt {} failed (transient): {}; retrying in {:?}",
                url,
                attempt + 1,

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Update the vfox plugin and mise to latest versions
  2. If a specific plugin triggers it, report to that plugin and/or mise with the plugin name and a stack trace
  3. As a workaround, use a plugin version/variant that uses simple in-memory requests

Example fix

// plugin code, before
http:post(url, io_reader_body)
// after
http:post(url, "in-memory-body-string")
Defensive patterns

Strategy: try-catch

Try / catch

// panic path; avoid by keeping plugin HTTP bodies in-memory
assert!(template.try_clone().is_some(), "plugin http requests must be cloneable");

Prevention

When it happens

Trigger: A vfox plugin's Lua http:get/head call path (get_with_cancellation, head, try_* wrappers) -> send_with_retry when the request builder acquired a streaming body — usually from a plugin bug or a mise regression in how the request template is built.

Common situations: Third-party vfox plugins doing POSTs with streaming bodies; recent mise/plugin version mismatch; normally not reachable for plain GET/HEAD.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/1aa790f3f2af7c28. Report an issue: GitHub.