rust-lang/rust · critical · Exception

Unable to parse transfer manifest

Error message

Unable to parse transfer manifest

What it means

Raised by TestEnvironment.start() when json.loads(output) or the subsequent ['transfer_manifest_url'] access on ffx's 'product lookup' JSON output fails. The runner looks up the product bundle transfer manifest URL from ffx to download the emulator image; any parsing/key failure is fatal because there is no URL to download. The original exception is chained via 'raise ... from e'.

Solutions

  1. Run the exact ffx command manually to see the raw output: `ffx --machine json product lookup minimal.{arch} {sdk_version} --base-url gs://fuchsia/development/{sdk_version}` and inspect the JSON.
  2. Confirm the SDK version (read from {sdk_dir}/meta/manifest.json 'id') actually exists in the gs://fuchsia/development catalog.
  3. Authenticate ffx / ensure network and GCS access, then retry 'start'.
  4. Use --use-local-product-bundle-if-exists with a pre-downloaded bundle to bypass the lookup entirely.
  5. Update fuchsia-test-runner.py to match a newer ffx output schema if the key was renamed.

Example fix

// before
$ fuchsia-test-runner.py start --sdk ... --target aarch64-unknown-fuchsia ...
# Exception: Unable to parse transfer manifest

// after - reproduce the ffx call to see the real error
$ ffx --machine json product lookup minimal.arm64 <sdk_id> --base-url gs://fuchsia/development/<sdk_id>
# fix auth / network / version, then re-run start
Defensive patterns

Strategy: try-catch

Validate before calling

import json, subprocess

out = subprocess.run(
    [ffx_path, "--machine", "json", "product", "lookup", product_name, sdk_version,
     "--base-url", f"gs://fuchsia/development/{sdk_version}"],
    stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=ffx_env,
).stdout
try:
    url = json.loads(out)["transfer_manifest_url"]
except Exception:
    raise SystemExit(f"ffx product lookup did not return a transfer_manifest_url; raw output:\n{out!r}")

Type guard

def has_transfer_manifest_url(payload) -> bool:
    return isinstance(payload, dict) and isinstance(payload.get("transfer_manifest_url"), str)

Try / catch

try:
    test_env.start()
except Exception as e:
    if "Unable to parse transfer manifest" in str(e):
        logging.error("ffx product lookup failed; check SDK version, network, and ffx auth.")
    raise

Prevention

When it happens

Trigger: Reached at fuchsia-test-runner.py:521-525 during 'start' when use_local_pb is false or the local product bundle path does not exist. ffx product lookup returned output that is not JSON, or JSON missing the 'transfer_manifest_url' key (e.g. an error payload, empty output, or a schema change in a newer ffx).

Common situations: SDK/ffx version mismatch (ffx returns an error object instead of a lookup result); no network access so ffx emitted a connection error to stdout; product name / SDK version do not exist in the catalog; ffx authentication to the storage backend failed; ffx output schema changed between SDK releases.

Understand the failure class

Related errors


AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10). Data as JSON: /api/errors/88ce9107d1562f93. Report an issue: GitHub.

Appendix: source

Thrown at src/ci/docker/scripts/fuchsia-test-runner.py:525

                    "--machine",
                    "json",
                    "product",
                    "lookup",
                    product_name,
                    sdk_version,
                    "--base-url",
                    "gs://fuchsia/development/" + sdk_version,
                ],
                env=ffx_env,
                stdout_handler=self.subprocess_logger.debug,
                stderr_handler=self.subprocess_logger.debug,
            )

            try:
                transfer_manifest_url = json.loads(output)["transfer_manifest_url"]
            except Exception as e:
                print(e)
                raise Exception("Unable to parse transfer manifest") from e

            # Download the product bundle.
            self.env_logger.info("Downloading the product bundle...")
            check_call_with_logging(
                [
                    ffx_path,
                    "product",
                    "download",
                    transfer_manifest_url,
                    self.local_pb_path,
                ],
                env=ffx_env,
                stdout_handler=self.subprocess_logger.debug,
                stderr_handler=self.subprocess_logger.debug,
            )

        # Start emulator
        self.env_logger.info("Starting emulator...")

View on GitHub (pinned to 7088e4b63a)