{"record":{"id":"f118ce4dc0ec7edb","repo":"CoplayDev/unity-mcp","slug":"no-unity-editor-binary-found-searched-n-search","errorCode":null,"errorMessage":"No Unity editor binary found. Searched:\\n  {searched}","messagePattern":"No Unity editor binary found\\. Searched:\\\\n  (.+?)","errorType":"exception","errorClass":"EditorNotFound","httpStatus":null,"severity":"critical","filePath":"tools/local_harness.py","lineNumber":406,"sourceCode":"            entries = _listdir(root)\n        except OSError:\n            continue\n        for name in entries:\n            pv = parse_version(name)\n            if (pv[0], pv[1]) != (target[0], target[1]):\n                continue\n            binary = str(Path(root) / name / relpath)\n            searched.append(binary)\n            if not (_exists(binary) and _is_exec(binary)):\n                continue\n            key = (pv[2], pv[3])\n            if best is None or key > best[0]:\n                best = (key, binary, name)\n\n    if best is not None:\n        return EditorSpec(binary=best[1], version=best[2])\n\n    raise EditorNotFound(searched=searched)\n\n\n# ===========================================================================\n# Pure helpers: status-file discovery\n# ===========================================================================\ndef newest_status_file(status_dir: str | Path,\n                       glob_fn: Callable[[str], list[str]] | None = None,\n                       mtime_fn: Callable[[str], float] | None = None) -> str | None:\n    \"\"\"Return the path to the newest unity-mcp-status-*.json under status_dir, or None.\"\"\"\n    pattern = str(Path(status_dir) / \"unity-mcp-status-*.json\")\n    g = glob_fn or glob.glob\n    files = list(g(pattern))\n    if not files:\n        return None\n    m = mtime_fn or (lambda p: os.path.getmtime(p))\n    try:\n        return max(files, key=m)\n    except OSError:","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/tools/local_harness.py#L388-L424","documentation":"Raised by discover_editor in tools/local_harness.py after probing every candidate editor path (explicit --editor, Hub installs, secondary install path, and same-major.minor nearest-patch fallback) and finding none both existing and executable. The exception carries the full list of absolute paths searched so the harness can print remediation guidance (exit code 5).","triggerScenarios":"discover_editor iterates candidate_editor_paths and the nearest-patch Hub directories; none pass the _exists and _is_exec checks. EditorNotFound(searched=[...]) is raised at local_harness.py:406.","commonSituations":"Unity Hub not installed or installed elsewhere; the requested version's editor binary lacks execute permission (e.g., on a fresh Linux untar); the Hub install is an editor-data folder without the Unity executable; wrong platform relpath.","solutions":["Install the requested Unity version via Unity Hub and ensure it is fully downloaded (not just the module manifest).","Pass --editor /path/to/Unity to point the harness at a non-Hub install explicitly.","chmod +x the editor binary if it exists but is not executable; verify the Hub install path matches hub_roots for your platform."],"exampleFix":"# before\npython tools/local_harness.py  # searched many paths, none executable\n# after\nchmod +x /Applications/Unity/Hub/Editor/2022.3.0f1/Unity.app/Contents/MacOS/Unity\npython tools/local_harness.py --editor /Applications/Unity/Hub/Editor/2022.3.0f1/Unity.app/Contents/MacOS/Unity","handlingStrategy":"validation","validationCode":"spec = discover_editor(version, explicit_editor=args.editor)\n# guard before calling:\nif not args.editor and not hub_has_version(version):\n    raise SystemExit('install Unity {version} via Hub or pass --editor')","typeGuard":"def editor_executable(path: str) -> bool:\n    return os.path.exists(path) and os.access(path, os.X_OK)","tryCatchPattern":"from tools.local_harness import EditorNotFound\ntry:\n    spec = discover_editor(version)\nexcept EditorNotFound as e:\n    print('Searched:\\n  ' + '\\n  '.join(e.searched)); sys.exit(5)","preventionTips":["Install the exact Unity version via Hub","Pass --editor for non-Hub installs","chmod +x the binary on Linux after untar"],"tags":["tooling","unity-editor","filesystem","harness"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}