{"record":{"id":"65e97eac4080104c","repo":"FuelLabs/sway","slug":"failed-to-send-request-to-github-to-obtain-package","errorCode":null,"errorMessage":"Failed to send request to github to obtain package index file from registry {e}","messagePattern":"Failed to send request to github to obtain package index file from registry (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"forc-pkg/src/source/reg/mod.rs","lineNumber":636,"sourceCode":"\n    let path = location_from_root(github_resolver.chunk_size, &source.namespace, pkg_name)\n        .display()\n        .to_string();\n    let index_repo_owner = github_resolver.repo_org();\n    let index_repo_name = github_resolver.repo_name();\n    let reference = format!(\"refs/heads/{}\", github_resolver.branch_name());\n    let github_endpoint = format!(\n        \"https://raw.githubusercontent.com/{index_repo_owner}/{index_repo_name}/{reference}/{path}\"\n    );\n    let client = reqwest::Client::new();\n    let timeout_duration = Duration::from_millis(GithubRegistryResolver::DEFAULT_TIMEOUT_MS);\n    let index_response = client\n        .get(github_endpoint)\n        .timeout(timeout_duration)\n        .send()\n        .await\n        .map_err(|e| {\n            anyhow!(\n                \"Failed to send request to github to obtain package index file from registry {e}\"\n            )\n        })?\n        .error_for_status()\n        .map_err(|_| anyhow!(\"Failed to fetch {pkg_name}\"))?;\n\n    let contents = index_response.text().await?;\n    let index_file: IndexFile = serde_json::from_str(&contents).with_context(|| {\n        format!(\"Unable to deserialize a github registry lookup response. Body was: \\\"{contents}\\\"\")\n    })?;\n\n    let res = f(index_file).await?;\n    Ok(res)\n}\n\n/// Execute an async block on a Tokio runtime.\n///\n/// If we are already in a runtime, this will spawn a new OS thread to create a new runtime.","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/FuelLabs/sway/blob/47e5e902faa42baf652dd6a0c88cd23390c1a614/forc-pkg/src/source/reg/mod.rs#L618-L654","documentation":"Error \"Failed to send request to github to obtain package index file from registry {e}\" thrown in FuelLabs/sway.","triggerScenarios":"Thrown at forc-pkg/src/source/reg/mod.rs:636 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"47e5e902faa42baf652dd6a0c88cd23390c1a614","analyzedAt":"2026-08-16T07:57:45.555Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}