FuelLabs/fuels-rs · error · anyhow::Error

Failed to extract wasm executor from the archive

Error message

Failed to extract wasm executor from the archive

What it means

Thrown by the e2e build script after a successful download: the tar.gz was fetched and scanned, but no entry matched the expected path fuel-core-<VERSION>-x86_64-unknown-linux-gnu/fuel-core-wasm-executor.wasm. It means the release artifact was downloaded fine but its internal layout does not contain the executor at the expected location.

Source

Thrown at e2e/build.rs:83

        ))
        .join(Self::EXECUTOR_FILE_NAME);

        for entry in archive.entries()? {
            let mut entry = entry?;

            if entry.path()? == executor_in_tar {
                entry.unpack(self.executor_path())?;
                std::fs::write(
                    self.version_path(),
                    format!("{SUPPORTED_FUEL_CORE_VERSION}"),
                )?;

                extracted = true;
                break;
            }
        }
        if !extracted {
            anyhow::bail!("Failed to extract wasm executor from the archive");
        }

        Ok(())
    }

    fn make_cargo_watch_downloaded_files(&self) {
        let executor_path = self.executor_path();
        println!("cargo:rerun-if-changed={}", executor_path.display());

        let version_path = self.version_path();
        println!("cargo:rerun-if-changed={}", version_path.display());
    }

    fn executor_path(&self) -> PathBuf {
        self.dir.join(Self::EXECUTOR_FILE_NAME)
    }

    fn version_path(&self) -> PathBuf {

View on GitHub (pinned to d9a250a518)

Solutions

  1. Inspect what you actually downloaded: curl the same URL and run `tar -tzf fuel-core-*.tar.gz | grep wasm` to see the real internal path.
  2. If the executor lives elsewhere or in a separate asset, update e2e/build.rs (executor_in_tar / LINK_TEMPLATE) or upgrade the fuels repo to a revision matching the new layout.
  3. If the downloaded file is HTML (proxy error page), fix the network path and re-download.
  4. Pre-seed OUT_DIR with the executor and version file as a local workaround.

Example fix

# diagnose the archive layout
curl -fL "$EXECUTOR_URL" -o /tmp/fc.tar.gz
tar -tzf /tmp/fc.tar.gz | grep -i wasm
# after: if the path differs, adjust executor_in_tar in e2e/build.rs to the actual entry, e.g.
# let executor_in_tar = Path::new("fuel-core-wasm-executor.wasm");
Defensive patterns

Strategy: validation

Validate before calling

let url = format!("https://github.com/FuelLabs/fuel-core/releases/download/v{V}/fuel-core-{V}-x86_64-unknown-linux-gnu.tar.gz");
let bytes = reqwest::blocking::get(&url)?.error_for_status()?.bytes()?;
let mut arch = tar::Archive::new(flate2::read::GzDecoder::new(&bytes[..]));
let expected = format!("fuel-core-{V}-x86_64-unknown-linux-gnu/fuel-core-wasm-executor.wasm");
assert!(arch.entries()?.any(|e| e.unwrap().path().unwrap().to_str() == Some(&expected)), "archive layout changed");

Try / catch

match downloader.download() {
    Err(e) if e.to_string().contains("Failed to extract") => {
        eprintln!("archive layout drift — inspect with: tar -tzf <downloaded> | grep wasm");
        std::process::exit(1);
    }
    other => other,
}

Prevention

When it happens

Trigger: The fuel-core release tarball for SUPPORTED_FUEL_CORE_VERSION ships with a different directory name or no fuel-core-wasm-executor.wasm at the archive root (e.g. the wasm executor was moved to a separate release asset, the top-level folder was renamed, or an unrelated/HTML error page was served with a 200 status and parsed as a tar).

Common situations: Upgrading the SDK to a fuel-core version whose packaging changed; a mirror/proxy returning an HTML body with status 200; release-asset naming drift between fuel-core versions.

Related errors


AI-assisted analysis of FuelLabs/fuels-rs@d9a250a518 (2026-08-16). Data as JSON: /api/errors/698237ec4b20780e. Report an issue: GitHub.