{"record":{"id":"6b3aabdcfabaa5d1","repo":"ArchiveBox/ArchiveBox","slug":"binary-self-binary-name-installation-failed","errorCode":null,"errorMessage":"Binary {self.binary.name} installation failed","messagePattern":"Binary (.+?) installation failed","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"archivebox/machine/models.py","lineNumber":2672,"sourceCode":"        # Check if installation succeeded by looking at updated status\n        # Note: Binary.run() updates self.binary.status internally but doesn't refresh our reference\n        self.binary.refresh_from_db()\n\n        if self.binary.status != Binary.StatusChoices.INSTALLED:\n            # Installation failed - abort transition, stay in queued\n            rprint(f\"[red]      ❌ BinaryMachine - {self.binary.name} installation failed, retrying later[/red]\", file=sys.stderr)\n\n            # Bump retry_at to try again later\n            self.binary.update_and_requeue(\n                retry_at=timezone.now() + timedelta(seconds=300),  # Retry in 5 minutes\n                status=Binary.StatusChoices.QUEUED,  # Ensure we stay queued\n            )\n\n            # Increment health stats for failure\n            self.binary.increment_health_stats(success=False)\n\n            # Abort the transition - this will raise an exception and keep us in queued\n            raise Exception(f\"Binary {self.binary.name} installation failed\")\n\n        rprint(f\"[cyan]      ✅ BinaryMachine - {self.binary.name} installed successfully[/cyan]\", file=sys.stderr)\n\n    @installed.enter\n    def enter_installed(self):\n        \"\"\"Binary installed successfully.\"\"\"\n        self.binary.update_and_requeue(\n            retry_at=None,\n            status=Binary.StatusChoices.INSTALLED,\n        )\n\n        # Increment health stats\n        self.binary.increment_health_stats(success=True)\n\n\n# =============================================================================\n# Process State Machine\n# =============================================================================","sourceCodeStart":2654,"sourceCodeEnd":2690,"githubUrl":"https://github.com/ArchiveBox/ArchiveBox/blob/74564b28220090664f919479e82cbf454125fa34/archivebox/machine/models.py#L2654-L2690","documentation":"Raised by ArchiveBox's BinaryMachine state machine (archivebox/machine/models.py:2672) when a binary-install transition fails. Before raising, the code increments the binary's health stats with success=False, so the failure is recorded, then aborts the transition so the binary remains in the 'queued' state rather than 'installed'. It is a plain Exception used as a state-machine abort signal.","triggerScenarios":"A binary dependency (e.g. chromium, wget, singlefile) fails to download or install during `archivebox install` / `archivebox init --install`, or when the archive runner auto-installs a missing extractor binary: bad network, missing apt/brew dependency, checksum mismatch, or the installer hook exiting non-zero.","commonSituations":"Offline or proxied environments blocking binary downloads; missing system packages (e.g. chromium deps); unsupported OS/arch with no prebuilt binary; stale pip/curl versions; permission errors writing to the bin dir.","solutions":["Read the install log lines just above the error to see the real failure, then fix that root cause","Re-run `archivebox install` (the binary stays in queued state and can be retried) after network/dependency fixes","Install the dependency via your system package manager (apt/brew) so the installer detects an existing binary","Set a custom binary path env/config (e.g. CHROMIUM_BINARY) to point at an existing executable and skip install"],"exampleFix":"# before\narchivebox run   # fails: Binary chromium installation failed\n# after\nsudo apt-get install -y chromium  # or fix proxy, then\narchivebox install && archivebox run","handlingStrategy":"retry","validationCode":"import shutil\nif not (shutil.which('chromium') or shutil.which('google-chrome')):\n    # ensure network + system deps available before running install\n    subprocess.run(['archivebox', 'install'], check=True)","typeGuard":"def is_binary_installed(name: str) -> bool:\n    return shutil.which(name) is not None","tryCatchPattern":"try:\n    subprocess.run(['archivebox', 'install'], check=True)\nexcept Exception as e:\n    if f'Binary {name} installation failed' in str(e):\n        install_system_package(name)  # fall back to apt/brew, then retry","preventionTips":["Pre-install binaries with the OS package manager before archivebox install","Verify network/proxy access to binary download hosts in CI","Point binary-path env vars at existing executables","Monitor binary health stats after failures and retry with logs visible"],"tags":["installer","binary-dependency","state-machine","python"],"backgroundTag":"binary-install-failed","analyzedSha":"74564b28220090664f919479e82cbf454125fa34","analyzedAt":"2026-08-28T23:56:51.556Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}