{"record":{"id":"1bd8bc24aa84bdf3","repo":"Hmbown/CodeWhale","slug":"codewhale-install-failed-stderr-or-stdout","errorCode":null,"errorMessage":"Codewhale install failed: {stderr_or_stdout}","messagePattern":"Codewhale install failed: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"integrations/verifiers-codewhale/codewhale_harness/harness.py","lineNumber":139,"sourceCode":"        self._validate_config()\n        if self.config.binary_path:\n            logger.info(\"codewhale: verifying preinstalled %s\", self.binary)\n            result = await runtime.run([self.binary, \"--version\"], {})\n            version_text = f\"{result.stdout}\\n{result.stderr}\"\n            if result.exit_code != 0 or not _has_version(\n                version_text, self.config.version\n            ):\n                raise RuntimeError(\n                    \"configured Codewhale binary is unavailable or does not report \"\n                    f\"version {self.config.version}\"\n                )\n            return\n\n        logger.info(\"codewhale: ensuring Codewhale %s is installed\", self.config.version)\n        script = _install_script(self.config.version)\n        result = await runtime.run([\"sh\", \"-c\", script], {})\n        if result.exit_code != 0:\n            raise RuntimeError(\n                \"Codewhale install failed: \"\n                + (result.stderr or result.stdout).strip()[-500:]\n            )\n\n    async def launch(\n        self,\n        ctx: ModelContext,\n        trace: Trace,\n        runtime: Runtime,\n        endpoint: str,\n        secret: str,\n        mcp_urls: dict[str, str],\n    ) -> ProgramResult:\n        self._validate_config()\n        system, prompt = self.resolve_prompt(trace.task.data)\n        trace_key = hashlib.sha256(str(trace.id).encode()).hexdigest()[:32]\n        home = f\".vf-codewhale/{trace_key}\"\n        mcp_path = f\"{home}/mcp.json\"","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/integrations/verifiers-codewhale/codewhale_harness/harness.py#L121-L157","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the appended stderr/stdout in the message for the specific script failure (download vs checksum vs platform)","Verify the runtime is Linux x86_64 or aarch64 and has network access to github.com; otherwise build locally and set config.binary_path","Install curl, ca-certificates, coreutils (sha256sum), and util-linux (flock) in the runtime image","Confirm the pinned config.version release exists (check the release assets URL) and retry setup()"],"exampleFix":"// before\nCodewhaleHarnessConfig()  # auto-install in offline macOS container fails\n// after\nCodewhaleHarnessConfig(binary_path=\"/usr/local/bin/codewhale\", version=\"0.9.1\")  # preinstalled","handlingStrategy":"retry","validationCode":"# before setup, check prerequisites in the runtime\nassert platform.system() == \"Linux\"\nassert shutil.which(\"curl\") and shutil.which(\"sha256sum\") and shutil.which(\"flock\")\nassert socket.getaddrinfo(\"github.com\", 443)","typeGuard":null,"tryCatchPattern":"try:\n    await harness.setup(runtime)\nexcept RuntimeError as e:\n    if e.args[0].startswith(\"Codewhale install failed:\"):\n        logger.error(\"install output: %s\", e)\n        # inspect tail of stderr, fix env, then retry setup()\n    else:\n        raise","preventionTips":["Ensure Linux x86_64/aarch64 runtimes with curl, sha256sum, flock and network to github.com","For offline/minimal images, preinstall and set binary_path","Verify the pinned release tag and assets exist before rolling out"],"tags":["install","network","environment"],"backgroundTag":"http-request-failed","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}