{"record":{"id":"8c75ae32dc62e3dc","repo":"CoplayDev/unity-mcp","slug":"icon-not-found-icon-path","errorCode":null,"errorMessage":"Icon not found: {icon_path}","messagePattern":"Icon not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"tools/generate_mcpb.py","lineNumber":57,"sourceCode":"\n\ndef generate_mcpb(\n    version: str,\n    output_path: Path,\n    icon_path: Path,\n) -> Path:\n    \"\"\"Generate MCPB bundle file.\n\n    Args:\n        version: Semantic version string (e.g., \"9.0.8\")\n        output_path: Output path for the .mcpb file\n        icon_path: Path to the icon file\n\n    Returns:\n        Path to the generated .mcpb file\n    \"\"\"\n    if not icon_path.exists():\n        raise FileNotFoundError(f\"Icon not found: {icon_path}\")\n\n    with tempfile.TemporaryDirectory() as tmpdir:\n        build_dir = Path(tmpdir) / \"mcpb-build\"\n        build_dir.mkdir()\n\n        # Copy icon\n        icon_filename = icon_path.name\n        shutil.copy2(icon_path, build_dir / icon_filename)\n\n        # Create manifest with version\n        manifest = create_manifest(version, icon_filename)\n        manifest_path = build_dir / \"manifest.json\"\n        manifest_path.write_text(\n            json.dumps(manifest, indent=2, ensure_ascii=False) + \"\\n\",\n            encoding=\"utf-8\",\n        )\n\n        # Copy LICENSE and README if they exist","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/tools/generate_mcpb.py#L39-L75","documentation":"Raised by generate_mcpb when the supplied icon_path does not exist on disk. The MCPB bundle embeds the icon, so a missing icon file aborts before the temporary build directory is populated.","triggerScenarios":"generate_mcpb(version, output_path, icon_path) called and icon_path.exists() is false. Default icon is REPO_ROOT/docs/images/coplay-logo.png; a custom --icon path was wrong.","commonSituations":"Default icon deleted in a rebrand branch; a custom --icon argument points to a relative path from the wrong CWD; icon was moved during docs reorganization.","solutions":["Use the default icon by ensuring docs/images/coplay-logo.png exists, or omit --icon if the CLI defaults to it.","Pass an absolute --icon path to a file you have verified exists.","Restore the icon from git if it was removed: git checkout HEAD -- docs/images/coplay-logo.png."],"exampleFix":"# before\npython tools/generate_mcpb.py 9.0.8 --icon ./logo.png  # wrong CWD\n# after\npython tools/generate_mcpb.py 9.0.8 --icon /abs/path/to/logo.png","handlingStrategy":"validation","validationCode":"icon = pathlib.Path(args.icon or DEFAULT_ICON)\nif not icon.exists():\n    raise SystemExit(f'icon missing: {icon}')","typeGuard":"def icon_present(p: pathlib.Path) -> bool:\n    return p.exists()","tryCatchPattern":"try:\n    generate_mcpb(version, output_path, icon_path)\nexcept FileNotFoundError as e:\n    print(e); sys.exit(1)","preventionTips":["Pass an absolute --icon path","Keep docs/images/coplay-logo.png tracked","Verify the icon exists before running the release script"],"tags":["tooling","release","filesystem","mcpb"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}