[GH-ISSUE #832] [Bug] Linux: Ghidra provider unusable — GHIDRA_INSTALL_DIR not detected and Arch-family host flagged unsupported #357

Closed
opened 2026-10-15 18:24:14 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Selene0623 on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/832

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Setup, packaging, or upgrade

Observed behavior

Summary

On a CachyOS (Arch-family) host, the MCP server starts and open_binary works, but every analysis call fails with provider_unavailable. The provider diagnostics report that the Ghidra engine is missing, and the host itself is classified as unsupported even though it is a normal 64-bit Linux desktop.

doctor --json (trimmed):

{
  "healthy": false,
  "node": { "status": "ok", "version": "26.10.0" },
  "host": { "platform": "cachyos", "kernel": "...", "classification": "unsupported_host" },
  "providers": {
    "ghidra": {
      "status": "missing_analysis_engine",
      "message": "GHIDRA_INSTALL_DIR is not set",
      "expected": "extracted Ghidra 12.1.4 release directory"
    },
    "hopper": { "status": "missing" },
    "ida-registration": { "status": "not_configured" }
  },
  "registration": { "opencode": { "status": "config_drift", "path": "~/.config/opencode/opencode.jsonc" } }
}

At the MCP layer, open_binary succeeds (the target is recognised: format: pe, kind: executable, arch: x86, sha256 returned correctly), so the failure only appears once an engine is actually needed:

{"error": {"code": "provider_unavailable", "provider": "composite:ghidra+hopper+ida+native-macos+rea-artifact-graph+rea-dotnet-static"}}

Reproduction

  1. Install REA on Arch / CachyOS (npx -y rea-agents@latest mcp, Node 22+), Ghidra installed at the distro path /opt/ghidra (12.1.2) — no GHIDRA_INSTALL_DIR exported.
  2. npx -y rea-agents@latest doctor --client opencode --json.
  3. Call open_binary on any native PE/ELF: succeeds.
  4. Call any analysis tool (binary_overview, list_procedures, decompile_function): fails with provider_unavailable.

Expected behavior

Three things would make this diagnosable and usable outside the supported distro list:

  1. Accept any extracted 12.1.x Ghidra via an explicit GHIDRA_INSTALL_DIR. The diagnostics ask specifically for "Ghidra 12.1.4", which reads as a hard pin. Distro packages lag (Arch/CachyOS are still on 12.1.2), so a user who has a perfectly good 12.1.2 tree has no way to tell whether it would be accepted.
  2. Classify Arch-family hosts as Linux. cachyos is being reported as unsupported_host; if only macOS/Ubuntu/Fedora/Arch are recognised by name, every derivative (CachyOS, EndeavourOS, Garuda, Manjaro) will fail classification even though the toolchain is identical.
  3. Return the missing-engine reason instead of a bare provider_unavailable. Analysis calls should surface "Ghidra engine not configured: set GHIDRA_INSTALL_DIR (see rea doctor)" rather than a generic composite-provider error, so the first call tells the user what to do.

Impact and scope

Blocks the entire binary-analysis workflow (static investigation, function enumeration, decompilation) on Arch-family Linux hosts, i.e. the primary reason to install REA. The user cannot self-diagnose the two independent causes (version pin + host classification) from the MCP error alone.

REA version

4.1.0

Runtime and platform

NODE 22 (also reproduced on NODE 26.10.0); CachyOS, 64-bit x86_64, kernel 7.2.8-1-cachyos; client: OpenCode V2

Target and artifact context

Native 32-bit x86 PE executable (a 2008 debug build), ~33 MB, plus a 134 MB PDB with MSF v7 / VC7.1 debug info.

Interface

MCP

Earliest failure stage

Setup/registration (engine discovery), before analysis

Relevant output or evidence

open_binary -> {"format":"pe","kind":"executable","arch":"x86","sha256":"e727848cdfe83d7e..."}
analysis    -> {"error":{"code":"provider_unavailable", ...composite...}}
doctor      -> healthy:false; ghidra missing_analysis_engine (GHIDRA_INSTALL_DIR unset); host cachyos = unsupported_host

Typed outcome or recovery expected

A typed error naming the missing capability and the exact env var to set / command to run (rea setup, doctor), rather than a generic provider failure.

Analysis or suspected cause

Two independent causes: (a) no Ghidra engine path is discovered from /opt/ghidra and the docs pin a specific 12.1.4 layout; (b) the host classifier does not recognise Arch-family distributions. A third, related but separately filed: the OpenCode V2 registration format (see #816).

Additional context

GHIDRA_INSTALL_DIR is not set in the environment and the distro package (ghidra from CachyOS repos, 12.1.2) is not auto-detected. I am happy to test a candidate fix against Ghidra 12.1.4 once it is installed locally.

Originally created by @Selene0623 on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/832 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Setup, packaging, or upgrade ### Observed behavior ## Summary On a CachyOS (Arch-family) host, the MCP server starts and `open_binary` works, but every analysis call fails with `provider_unavailable`. The provider diagnostics report that the Ghidra engine is missing, and the host itself is classified as unsupported even though it is a normal 64-bit Linux desktop. `doctor --json` (trimmed): ```json { "healthy": false, "node": { "status": "ok", "version": "26.10.0" }, "host": { "platform": "cachyos", "kernel": "...", "classification": "unsupported_host" }, "providers": { "ghidra": { "status": "missing_analysis_engine", "message": "GHIDRA_INSTALL_DIR is not set", "expected": "extracted Ghidra 12.1.4 release directory" }, "hopper": { "status": "missing" }, "ida-registration": { "status": "not_configured" } }, "registration": { "opencode": { "status": "config_drift", "path": "~/.config/opencode/opencode.jsonc" } } } ``` At the MCP layer, `open_binary` succeeds (the target is recognised: `format: pe`, `kind: executable`, `arch: x86`, sha256 returned correctly), so the failure only appears once an engine is actually needed: ```json {"error": {"code": "provider_unavailable", "provider": "composite:ghidra+hopper+ida+native-macos+rea-artifact-graph+rea-dotnet-static"}} ``` ### Reproduction 1. Install REA on Arch / CachyOS (`npx -y rea-agents@latest mcp`, Node 22+), Ghidra installed at the distro path `/opt/ghidra` (12.1.2) — no `GHIDRA_INSTALL_DIR` exported. 2. `npx -y rea-agents@latest doctor --client opencode --json`. 3. Call `open_binary` on any native PE/ELF: succeeds. 4. Call any analysis tool (`binary_overview`, `list_procedures`, `decompile_function`): fails with `provider_unavailable`. ### Expected behavior Three things would make this diagnosable and usable outside the supported distro list: 1. **Accept any extracted 12.1.x Ghidra via an explicit `GHIDRA_INSTALL_DIR`.** The diagnostics ask specifically for "Ghidra 12.1.4", which reads as a hard pin. Distro packages lag (Arch/CachyOS are still on 12.1.2), so a user who has a perfectly good 12.1.2 tree has no way to tell whether it would be accepted. 2. **Classify Arch-family hosts as Linux.** `cachyos` is being reported as `unsupported_host`; if only macOS/Ubuntu/Fedora/Arch are recognised by name, every derivative (CachyOS, EndeavourOS, Garuda, Manjaro) will fail classification even though the toolchain is identical. 3. **Return the missing-engine reason instead of a bare `provider_unavailable`.** Analysis calls should surface "Ghidra engine not configured: set `GHIDRA_INSTALL_DIR` (see `rea doctor`)" rather than a generic composite-provider error, so the first call tells the user what to do. ### Impact and scope Blocks the entire binary-analysis workflow (static investigation, function enumeration, decompilation) on Arch-family Linux hosts, i.e. the primary reason to install REA. The user cannot self-diagnose the two independent causes (version pin + host classification) from the MCP error alone. ### REA version 4.1.0 ### Runtime and platform NODE 22 (also reproduced on NODE 26.10.0); CachyOS, 64-bit x86_64, kernel 7.2.8-1-cachyos; client: OpenCode V2 ### Target and artifact context Native 32-bit x86 PE executable (a 2008 debug build), ~33 MB, plus a 134 MB PDB with MSF v7 / VC7.1 debug info. ### Interface MCP ### Earliest failure stage Setup/registration (engine discovery), before analysis ### Relevant output or evidence ```text open_binary -> {"format":"pe","kind":"executable","arch":"x86","sha256":"e727848cdfe83d7e..."} analysis -> {"error":{"code":"provider_unavailable", ...composite...}} doctor -> healthy:false; ghidra missing_analysis_engine (GHIDRA_INSTALL_DIR unset); host cachyos = unsupported_host ``` ### Typed outcome or recovery expected A typed error naming the missing capability and the exact env var to set / command to run (`rea setup`, doctor), rather than a generic provider failure. ### Analysis or suspected cause Two independent causes: (a) no Ghidra engine path is discovered from `/opt/ghidra` and the docs pin a specific 12.1.4 layout; (b) the host classifier does not recognise Arch-family distributions. A third, related but separately filed: the OpenCode V2 registration format (see #816). ### Additional context `GHIDRA_INSTALL_DIR` is not set in the environment and the distro package (`ghidra` from CachyOS repos, 12.1.2) is not auto-detected. I am happy to test a candidate fix against Ghidra 12.1.4 once it is installed locally.
bsakaguchi 2026-10-15 18:24:14 +00:00
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 7, 2026):

Resolved on main, after 4.1.0. The three requests are covered as follows:

  1. Any 12.1.x Ghidra: #840 accepts every 12.1.x release and the JDK range that installation declares. 12.1.4 remains the verified build, and other 12.1.x builds (such as 12.1.2) run with a recorded compatibility limitation. Diagnostics now ask for Ghidra 12.1.x.
  2. Arch-family hosts: Ghidra's host check uses the OS and CPU (linux x64), not the distribution name, so CachyOS qualifies. Hopper's Linux installer added ID=cachyos in #963. Other Arch derivatives such as EndeavourOS and Manjaro are not yet on Hopper's verified installer list; Ghidra does not depend on that list.
  3. Missing-engine reason: provider_unavailable now carries per-provider details.rejections. With no engine configured on current main, it includes
    {"provider_id":"ghidra","code":"not_configured","reason":"Set GHIDRA_INSTALL_DIR to an extracted Ghidra 12.1.x release directory."}
    plus each failed check. rea doctor --provider ghidra --json gives a report scoped to Ghidra, so unrelated optional engines no longer make it report healthy: false.

Ghidra is bring-your-own, so REA does not search distro paths. Set GHIDRA_INSTALL_DIR=/opt/ghidra (and JAVA_HOME if java/javac are not on PATH), then rerun rea setup. This ships in the next release (release PR #771). The OpenCode V2 registration drift is tracked in #816, which is fixed in the same release.

<!-- gh-comment-id:6041909088 --> @kaoru0822-kitauji commented on GitHub (Oct 7, 2026): Resolved on `main`, after 4.1.0. The three requests are covered as follows: 1. **Any 12.1.x Ghidra:** #840 accepts every 12.1.x release and the JDK range that installation declares. 12.1.4 remains the verified build, and other 12.1.x builds (such as 12.1.2) run with a recorded compatibility limitation. Diagnostics now ask for `Ghidra 12.1.x`. 2. **Arch-family hosts:** Ghidra's host check uses the OS and CPU (`linux` x64), not the distribution name, so CachyOS qualifies. Hopper's Linux installer added `ID=cachyos` in #963. Other Arch derivatives such as EndeavourOS and Manjaro are not yet on Hopper's verified installer list; Ghidra does not depend on that list. 3. **Missing-engine reason:** `provider_unavailable` now carries per-provider `details.rejections`. With no engine configured on current `main`, it includes `{"provider_id":"ghidra","code":"not_configured","reason":"Set GHIDRA_INSTALL_DIR to an extracted Ghidra 12.1.x release directory."}` plus each failed check. `rea doctor --provider ghidra --json` gives a report scoped to Ghidra, so unrelated optional engines no longer make it report `healthy: false`. Ghidra is bring-your-own, so REA does not search distro paths. Set `GHIDRA_INSTALL_DIR=/opt/ghidra` (and `JAVA_HOME` if `java`/`javac` are not on `PATH`), then rerun `rea setup`. This ships in the next release (release PR #771). The OpenCode V2 registration drift is tracked in #816, which is fixed in the same release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#357
No description provided.