Hmbown/CodeWhale · error · RuntimeError

Codewhale install failed

Error message

Codewhale install failed: {stderr_or_stdout}

What it means

When no binary_path is set, setup() runs the generated install script (downloads pinned release artifacts from GitHub, verifies sha256 checksums) via 'sh -c'. A non-zero exit code raises this RuntimeError with the last 500 characters of stderr (or stdout), e.g. missing curl/flock, unsupported architecture, failed download, or checksum mismatch.

Solutions

  1. Read the appended stderr/stdout in the message for the specific script failure (download vs checksum vs platform)
  2. Verify the runtime is Linux x86_64 or aarch64 and has network access to github.com; otherwise build locally and set config.binary_path
  3. Install curl, ca-certificates, coreutils (sha256sum), and util-linux (flock) in the runtime image
  4. Confirm the pinned config.version release exists (check the release assets URL) and retry setup()

Example fix

// before
CodewhaleHarnessConfig()  # auto-install in offline macOS container fails
// after
CodewhaleHarnessConfig(binary_path="/usr/local/bin/codewhale", version="0.9.1")  # preinstalled
Defensive patterns

Strategy: retry

Validate before calling

# before setup, check prerequisites in the runtime
assert platform.system() == "Linux"
assert shutil.which("curl") and shutil.which("sha256sum") and shutil.which("flock")
assert socket.getaddrinfo("github.com", 443)

Try / catch

try:
    await harness.setup(runtime)
except RuntimeError as e:
    if e.args[0].startswith("Codewhale install failed:"):
        logger.error("install output: %s", e)
        # inspect tail of stderr, fix env, then retry setup()
    else:
        raise

Prevention

When it happens

Trigger: setup() on a runtime where the install script fails: non-Linux OS, unsupported CPU architecture, no network access to github.com releases, missing curl/sha256sum/flock without apt/apk, disk/permission failure under /tmp/vf-codewhale, or a checksum verification failure.

Common situations: Air-gapped or firewalled CI runners; macOS or ARM-unsupported environments; minimal containers lacking curl; the pinned release tag not existing on GitHub; corrupted download failing the sha256 check.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/1bd8bc24aa84bdf3. Report an issue: GitHub.

Appendix: source

Thrown at integrations/verifiers-codewhale/codewhale_harness/harness.py:139

        self._validate_config()
        if self.config.binary_path:
            logger.info("codewhale: verifying preinstalled %s", self.binary)
            result = await runtime.run([self.binary, "--version"], {})
            version_text = f"{result.stdout}\n{result.stderr}"
            if result.exit_code != 0 or not _has_version(
                version_text, self.config.version
            ):
                raise RuntimeError(
                    "configured Codewhale binary is unavailable or does not report "
                    f"version {self.config.version}"
                )
            return

        logger.info("codewhale: ensuring Codewhale %s is installed", self.config.version)
        script = _install_script(self.config.version)
        result = await runtime.run(["sh", "-c", script], {})
        if result.exit_code != 0:
            raise RuntimeError(
                "Codewhale install failed: "
                + (result.stderr or result.stdout).strip()[-500:]
            )

    async def launch(
        self,
        ctx: ModelContext,
        trace: Trace,
        runtime: Runtime,
        endpoint: str,
        secret: str,
        mcp_urls: dict[str, str],
    ) -> ProgramResult:
        self._validate_config()
        system, prompt = self.resolve_prompt(trace.task.data)
        trace_key = hashlib.sha256(str(trace.id).encode()).hexdigest()[:32]
        home = f".vf-codewhale/{trace_key}"
        mcp_path = f"{home}/mcp.json"

View on GitHub (pinned to 433685b202)