{"record":{"id":"563ee0adee778384","repo":"Hmbown/CodeWhale","slug":"codewhale-install-failed-result-stderr-or-resu","errorCode":null,"errorMessage":"Codewhale install failed: ${(result.stderr or result.stdout).strip()[-500:]}","messagePattern":"Codewhale install failed: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","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/8880682c63083a91624de936797efa3ce9e498fd/integrations/verifiers-codewhale/codewhale_harness/harness.py#L121-L157","documentation":"Without binary_path, setup() runs a generated POSIX install script via sh -c: it enforces Linux on x86_64/arm64, bootstraps curl/sha256sum/flock through apt-get or apk, flocks the install dir, downloads three platform assets plus a sha256 manifest from https://github.com/Hmbown/CodeWhale/releases/download/v<version>, verifies every checksum, and installs into /tmp/vf-codewhale/bin. Any non-zero exit raises RuntimeError embedding the last 500 characters of stderr/stdout, which names the failing step.","triggerScenarios":"Non-Linux or unsupported-architecture runtimes; blocked egress to github.com; a release tag missing an asset or its manifest; checksum mismatch from truncated downloads; minimal images lacking curl with neither apt-get nor apk available.","commonSituations":"Training containers with allow-listed network policies; freshly tagged releases whose assets are still uploading; TLS-intercepting proxies breaking curl -fsSL; distroless images without a package manager.","solutions":["Read the 500-char stderr tail embedded in the exception; it identifies the exact failing command","Verify egress to https://github.com/Hmbown/CodeWhale/releases and retry; transient curl failures clear on a second rollout","On non-Linux or unusual-arch hosts, preinstall the binary and set binary_path instead","Confirm the pinned tag has all assets (codewhale-<platform>, codew-<platform>, codewhale-tui-<platform>) and the sha256 manifest","Bake curl, ca-certificates, coreutils, and util-linux into the image, or preinstall the binaries and use binary_path"],"exampleFix":"# before\nconfig = CodewhaleHarnessConfig(version='0.9.1')  # runtime blocks github.com egress\n# after\nconfig = CodewhaleHarnessConfig(version='0.9.1', binary_path='/opt/codewhale/bin/codewhale')","handlingStrategy":"retry","validationCode":"import platform, shutil\ninstallable = (\n    platform.system() == 'Linux'\n    and platform.machine() in ('x86_64', 'amd64', 'aarch64', 'arm64')\n    and shutil.which('curl') is not None\n)\nif not installable:\n    config = config.model_copy(update={'binary_path': '/opt/codewhale/bin/codewhale'})","typeGuard":null,"tryCatchPattern":"last = None\nfor attempt in range(3):\n    try:\n        await harness.setup(runtime)\n        break\n    except RuntimeError as e:\n        last = e\n        if 'install failed' not in str(e):\n            raise\n        await asyncio.sleep(2 ** attempt)\nelse:\n    raise last","preventionTips":["Allow-list egress to github.com release downloads in training containers","Pre-bake the pinned binaries and switch to binary_path on locked-down runtimes","Pin only release tags whose assets and sha256 manifest are fully uploaded","Bake curl, ca-certificates, coreutils, and util-linux into runtime images"],"tags":["install","network","release","setup","harness","linux"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}