{"record":{"id":"bbe4b5aba22c854b","repo":"DioxusLabs/dioxus","slug":"cargo-metadata-took-too-long-to-respond-try-again","errorCode":null,"errorMessage":"cargo metadata took too long to respond, try again with --offline","messagePattern":"cargo metadata took too long to respond, try again with --offline","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/workspace.rs","lineNumber":90,"sourceCode":"                eprintln!(\"{GLOW_STYLE}warning{GLOW_STYLE:#}: (Try {x}) Taking a while...\");\n\n                if x % 10 == 0 {\n                    eprintln!(\n                        \"{GLOW_STYLE}warning{GLOW_STYLE:#}: maybe check your network connection or build lock?\"\n                    );\n                }\n            }\n        };\n\n        let krates = tokio::select! {\n            f = krates_future => {\n                let res = f?;\n                if let Err(krates::Error::Metadata(e)) = res {\n                    bail!(\"{e}\");\n                }\n                res?\n            },\n            _ = spin_future => bail!(\"cargo metadata took too long to respond, try again with --offline\"),\n        };\n\n        let settings = CliSettings::global_or_default();\n        let sysroot = Self::get_rustc_sysroot()\n            .await\n            .context(\"Failed to get rustc sysroot\")?;\n        let rustc_version = Self::get_rustc_version()\n            .await\n            .context(\"Failed to get rustc version\")?;\n\n        let wasm_opt = which::which(\"wasm-opt\").ok();\n\n        let ignore = Self::workspace_gitignore(krates.workspace_root().as_std_path());\n\n        let cargo_toml = crate::cargo_toml::load_manifest_from_path(\n            krates.workspace_root().join(\"Cargo.toml\").as_std_path(),\n        )\n        .context(\"Failed to load Cargo.toml\")?;","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/workspace.rs#L72-L108","documentation":"Timeout branch of the tokio::select! in Workspace::current: fires when the cargo-metadata invocation does not complete within the CLI's generous wait window (100 x 2s), typically due to network problems fetching the registry index or another process holding the cargo build lock. The message directs the user to rerun with --offline.","triggerScenarios":"Thrown at packages/cli/src/workspace.rs:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["cargo metadata timed out. Retry with --offline."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}