{"record":{"id":"fe071e6b2a4f0fcd","repo":"iOfficeAI/OfficeCLI","slug":"officecli-install-failed-exit-r-returncode-ru-fe071e","errorCode":null,"errorMessage":"officecli install failed (exit {r.returncode}). Run manually:\n    curl -fsSL https://d.officecli.ai/install.sh | bash","messagePattern":"officecli install failed \\(exit (.+?)\\)\\. Run manually:\n    curl -fsSL https://d\\.officecli\\.ai/install\\.sh \\| bash","errorType":"exception","errorClass":"OfficeCliError","httpStatus":null,"severity":"error","filePath":"sdk/python/officecli.py","lineNumber":609,"sourceCode":"        # Windows PowerShell (powershell.exe) ships with the OS; -ExecutionPolicy\n        # Bypass lets the remote script run without changing machine policy. Fetch\n        # the script mirror-first, github fallback, then run it.\n        ps = (f\"$s = try {{ irm '{_INSTALL_PS1_MIRROR}' }} \"\n              f\"catch {{ irm '{_INSTALL_PS1_GITHUB}' }}; $s | iex\")\n        r = subprocess.run([\"powershell\", \"-NoProfile\", \"-ExecutionPolicy\", \"Bypass\", \"-Command\", ps])\n        if r.returncode != 0:\n            raise OfficeCliError(r.returncode,\n                f\"officecli install failed (exit {r.returncode}). Run manually:\\n\"\n                f\"    irm {_INSTALL_PS1_MIRROR} | iex\")\n        return None\n    print(f\"Installing officecli via {_INSTALL_SH_MIRROR} (github fallback) ...\", file=sys.stderr)\n    # (curl mirror || curl github) | bash — the subshell emits whichever fetch\n    # succeeds; the group keeps the pipe bound to the whole fallback. Output is\n    # NOT captured, so progress and checksum lines stream to the user.\n    sh = f\"(curl -fsSL {_INSTALL_SH_MIRROR} 2>/dev/null || curl -fsSL {_INSTALL_SH_GITHUB}) | bash\"\n    r = subprocess.run([\"bash\", \"-c\", sh])\n    if r.returncode != 0:\n        raise OfficeCliError(r.returncode,\n            f\"officecli install failed (exit {r.returncode}). Run manually:\\n\"\n            f\"    curl -fsSL {_INSTALL_SH_MIRROR} | bash\")\n    return None\n\n\n# Advertised surface = the command shell + its error. pipe_paths stays importable\n# (officecli.pipe_paths) as a debug helper but isn't part of the command API.\n__all__ = [\"open\", \"create\", \"install\", \"Document\", \"OfficeCliError\"]\n\n\nif __name__ == \"__main__\":\n    # `python -m officecli install` — bootstrap the CLI binary.\n    if len(sys.argv) >= 2 and sys.argv[1] == \"install\":\n        install()\n    else:\n        print(\"usage: python -m officecli install\", file=sys.stderr)\n        sys.exit(2)\n","sourceCodeStart":591,"sourceCodeEnd":627,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/sdk/python/officecli.py#L591-L627","documentation":"Raised by officecli.install() on Unix when the bash installer ((curl mirror || curl github) | bash) exits with a non-zero return code. The SDK streams installer output to the user and, on failure, reports the exit code and the manual curl | bash command to run.","triggerScenarios":"Running officecli.install() on Linux/macOS where the fetch or bash install fails: curl not installed or blocked, mirror and GitHub both unreachable, checksum mismatch, or permission errors writing the binary.","commonSituations":"No network egress to d.officecli.ai or raw.githubusercontent.com; curl missing in a minimal container; ~/.local/bin not writable; corporate proxy blocking curl.","solutions":["Run the manual command: curl -fsSL https://d.officecli.ai/install.sh | bash to see full output.","Verify network/proxy access to d.officecli.ai and the GitHub raw mirror, and that curl is installed.","Ensure the install target (~/.local/bin) exists and is writable."],"exampleFix":"# before — installer failed non-interactively\nofficecli.install()\n# after — run manually in a shell to see errors\n# $ curl -fsSL https://d.officecli.ai/install.sh | bash","handlingStrategy":"fallback","validationCode":"null","typeGuard":"null","tryCatchPattern":"import subprocess, officecli\n\ntry:\n    officecli.install()\nexcept officecli.OfficeCliError as e:\n    # fall back to running the manual curl command with full output\n    subprocess.run(['bash', '-c', 'curl -fsSL https://d.officecli.ai/install.sh | bash'])","preventionTips":["On install failure, run curl -fsSL https://d.officecli.ai/install.sh | bash manually to see full output.","Ensure curl is installed and network/proxy reaches d.officecli.ai and GitHub raw.","Make sure ~/.local/bin exists and is writable."],"tags":["python-sdk","install","unix","curl","network"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}