{"record":{"id":"20315b6cfa148e37","repo":"jdx/mise","slug":"failed-to-create-reqwest-client","errorCode":null,"errorMessage":"Failed to create reqwest client","messagePattern":"Failed to create reqwest client","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/vfox/src/http.rs","lineNumber":12,"sourceCode":"use reqwest::header::HeaderMap;\nuse reqwest::{Client, ClientBuilder, StatusCode, Url};\nuse std::sync::Arc;\nuse std::sync::LazyLock;\nuse std::time::Duration;\nuse tokio::sync::watch;\n\npub(crate) static CLIENT: LazyLock<Client> = LazyLock::new(|| {\n    ClientBuilder::new()\n        .user_agent(format!(\"vfox.rs/{}\", env!(\"CARGO_PKG_VERSION\")))\n        .build()\n        .expect(\"Failed to create reqwest client\")\n});\n\npub(crate) const URL_REWRITER_REGISTRY_KEY: &str = \"url_rewriter_fn\";\npub(crate) const HTTP_HEADERS_RESOLVER_REGISTRY_KEY: &str = \"http_headers_resolver_fn\";\npub(crate) type HttpHeadersResolver = Arc<dyn Fn(&Url) -> HeaderMap + Send + Sync>;\n\nstatic HTTP_CANCELLATION: LazyLock<HttpCancellation> = LazyLock::new(Default::default);\n\n#[derive(Clone)]\npub(crate) struct HttpCancellation {\n    signal: watch::Sender<()>,\n}\n\npub(crate) struct HttpCancellationReceiver {\n    signal: watch::Receiver<()>,\n}\n\nimpl Default for HttpCancellation {","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/crates/vfox/src/http.rs#L1-L30","documentation":"The vfox crate builds a shared reqwest::Client once (LazyLock) with a user agent. If client construction fails — which for a default ClientBuilder essentially only happens with broken TLS backend initialization — this expect panics at first use. It indicates the HTTP stack itself is unusable in this environment.","triggerScenarios":"First HTTP use in the vfox plugin runtime triggers LazyLock initialization; ClientBuilder::build() fails, almost always due to TLS backend (native-tls/openssl) load failures — missing/incorrect OpenSSL libraries, musl/static-link issues, or corrupt SSL cert configuration.","commonSituations":"Linux systems with missing libssl versions after upgrades; Alpine/musl builds without proper TLS; container images stripped of CA certificates or OpenSSL; LD_LIBRARY_PATH pointing to incompatible libs.","solutions":["Fix the system TLS: reinstall/repair OpenSSL (e.g. apt install libssl3 / apk add openssl) and CA certificates (ca-certificates)","Reinstall mise with a prebuilt binary matching your platform (avoids broken local TLS linkage)","Check LD_LIBRARY_PATH for conflicting libssl/libcrypto versions","Report the environment (OS, mise version, mise doctor output) if it persists"],"exampleFix":"// before (Debian/Ubuntu, missing TLS)\nmise install vfox-plugin\n// after\nsudo apt-get install -y libssl3 ca-certificates\nmise install vfox-plugin","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// LazyLock panics on failure; verify TLS availability in deployment checks\nldd \"$(which mise)\" | grep -E 'libssl|libcrypto' || echo 'check TLS libs'","preventionTips":["Install CA certificates and OpenSSL on minimal/container images","Prefer official prebuilt mise binaries over locally built ones on exotic platforms","Re-check LD_LIBRARY_PATH in CI images after base image upgrades"],"tags":["http","tls","panic","vfox"],"backgroundTag":"module-init-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}