{"record":{"id":"29860367d324a9db","repo":"janhq/jan","slug":"jan-app-not-found-at-jan-app-path","errorCode":null,"errorMessage":"Jan app not found at {jan_app_path}","messagePattern":"Jan app not found at (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"autoqa/utils.py","lineNumber":240,"sourceCode":"    \"\"\"\n    Start Jan application in maximized window (cross-platform)\n    \"\"\"\n    # Set default path based on platform\n    if jan_app_path is None:\n        if IS_WINDOWS:\n            jan_app_path = os.path.expanduser(r\"~\\AppData\\Local\\Programs\\jan\\Jan.exe\")\n        elif IS_LINUX:\n            jan_app_path = \"/usr/bin/Jan\"  # or \"/usr/bin/Jan\" for regular\n        elif IS_MACOS:\n            jan_app_path = \"/Applications/Jan.app/Contents/MacOS/Jan\"  # Default macOS path\n        else:\n            raise NotImplementedError(f\"Platform {platform.system()} not supported\")\n    \n    logger.info(f\"Starting Jan application from: {jan_app_path}\")\n    \n    if not os.path.exists(jan_app_path):\n        logger.error(f\"Jan executable not found at: {jan_app_path}\")\n        raise FileNotFoundError(f\"Jan app not found at {jan_app_path}\")\n    \n    try:\n        # Start the Jan application\n        if IS_WINDOWS:\n            subprocess.Popen([jan_app_path], shell=True)\n        elif IS_LINUX:\n            # On Linux, start with DISPLAY environment variable\n            env = os.environ.copy()\n            subprocess.Popen([jan_app_path], env=env)\n        elif IS_MACOS:\n            # On macOS, use 'open' command to launch .app bundle properly\n            if jan_app_path.endswith('.app/Contents/MacOS/Jan'):\n                # Use the .app bundle path instead\n                app_bundle = jan_app_path.replace('/Contents/MacOS/Jan', '')\n                subprocess.Popen(['open', app_bundle])\n            elif jan_app_path.endswith('.app'):\n                # Direct .app bundle\n                subprocess.Popen(['open', jan_app_path])","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/autoqa/utils.py#L222-L258","documentation":"Raised when the resolved Jan executable path does not exist on the filesystem. The function checks os.path.exists(jan_app_path) and, if false, logs an error and raises FileNotFoundError. This fires regardless of platform — the path may be a default guess or a user-supplied value.","triggerScenarios":"Jan is not installed; Jan is installed in a non-default location; the default path for the platform doesn't match where the user installed Jan; jan_app_path points to a wrong or stale location.","commonSituations":"Fresh CI environment without Jan pre-installed; user installed Jan via Snap/Flatpak/AppImage whose binary lives elsewhere; portable Windows install where Jan.exe is not under AppData\\Local\\Programs.","solutions":["Install Jan at the default platform location (e.g. /usr/bin/Jan on Linux, AppData\\Local\\Programs\\jan\\Jan.exe on Windows).","Pass jan_app_path explicitly to point to the actual Jan binary.","Verify the path with `ls -la <path>` or `test -f <path>` before calling start_jan_app()."],"exampleFix":"# before\nstart_jan_app()\n# after\nstart_jan_app(jan_app_path=\"/snap/bin/jan\")","handlingStrategy":"validation","validationCode":"import os\n\ndef jan_path_is_valid(jan_app_path: str) -> bool:\n    return os.path.isfile(jan_app_path)\n\n# Before calling:\nif not jan_path_is_valid(resolved_path):\n    print(f\"Jan not found at {resolved_path}; install it or pass the correct path\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In CI, assert Jan is installed as a pre-step before running autoqa.","Use a configurable environment variable for jan_app_path so CI images can point to non-default installs."],"tags":["file-not-found","autoqa","installation","path"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}