{"record":{"id":"76a015dc86c59705","repo":"oraios/serena","slug":"al-language-server-executable-not-found-at-execu","errorCode":null,"errorMessage":"AL Language Server executable not found at: {executable_path}","messagePattern":"AL Language Server executable not found at: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/al_language_server.py","lineNumber":215,"sourceCode":"        # Find existing extension or download if needed\n        extension_path = cls._find_al_extension(solidlsp_settings)\n        if extension_path is None:\n            log.info(\"AL extension not found on disk, attempting to download...\")\n            extension_path = cls._download_and_install_al_extension(solidlsp_settings)\n\n        if extension_path is None:\n            raise RuntimeError(\n                \"Failed to locate or download AL Language Server. Please either:\\n\"\n                \"1. Set AL_EXTENSION_PATH environment variable to the AL extension directory\\n\"\n                \"2. Install the AL extension in VS Code (ms-dynamics-smb.al)\\n\"\n                \"3. Ensure internet connection for automatic download\"\n            )\n\n        # Build executable path based on platform\n        executable_path = cls._get_executable_path(extension_path, system)\n\n        if not os.path.exists(executable_path):\n            raise RuntimeError(f\"AL Language Server executable not found at: {executable_path}\")\n\n        # Prepare and return the executable command\n        return cls._prepare_executable(executable_path, system)\n\n    @classmethod\n    def _find_al_extension(cls, solidlsp_settings: SolidLSPSettings) -> str | None:\n        \"\"\"\n        Find AL extension in various locations.\n\n        Search order:\n        1. Environment variable (AL_EXTENSION_PATH)\n        2. Default download location (~/.serena/ls_resources/al-extension)\n        3. VS Code installed extensions\n\n        Returns:\n            Path to AL extension directory or None if not found\n\n        \"\"\"","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/al_language_server.py#L197-L233","documentation":"After locating the AL extension directory, _setup_runtime_dependencies builds the expected path to Microsoft.Dynamics.Nav.EditorServices.Host for the current platform. RuntimeError is raised when that binary does not exist inside the extension — meaning the extension folder was found but is incomplete, of an unexpected version/layout, or the wrong platform variant.","triggerScenarios":"AL extension directory resolved successfully but _get_executable_path result fails os.path.exists — e.g. a partial/failed extension install, an extension update that changed bin/ layout, or AL_EXTENSION_PATH pointing at the wrong directory.","commonSituations":"Manually downloaded/copyied extension folders missing the bin/<platform> subdirectory; Linux servers given a Windows-only extension snapshot; interrupted extension installation.","solutions":["Reinstall the AL extension (or re-download it) to get a complete bin/ directory, then retry.","Verify the expected binary exists: <extension>/bin/{win32|linux|darwin}/Microsoft.Dynamics.Nav.EditorServices.Host(.exe).","Point AL_EXTENSION_PATH at a complete, platform-matching extension directory."],"exampleFix":"// before\nexport AL_EXTENSION_PATH=\"/opt/al-src\"   # source checkout, no bin/\n// after\nexport AL_EXTENSION_PATH=\"$HOME/.vscode/extensions/ms-dynamics-smb.al-1.x.x\"","handlingStrategy":"validation","validationCode":"import os, sys\ndef al_binary_present(extension_path: str) -> bool:\n    system = {'Windows': 'win32', 'Linux': 'linux', 'Darwin': 'darwin'}[sys.platform if sys.platform != 'win32' else 'Windows']\n    name = 'Microsoft.Dynamics.Nav.EditorServices.Host' + ('.exe' if system == 'win32' else '')\n    return os.path.isfile(os.path.join(extension_path, 'bin', system, name))","typeGuard":"def is_complete_extension(extension_path: str) -> bool:\n    return os.path.isdir(os.path.join(extension_path, 'bin', 'linux')) or \\\n           os.path.isdir(os.path.join(extension_path, 'bin', 'darwin')) or \\\n           os.path.isdir(os.path.join(extension_path, 'bin', 'win32'))","tryCatchPattern":"try:\n    server = ALLanguageServer(...)\nexcept RuntimeError as e:\n    if 'executable not found at' in str(e):\n        reinstall_al_extension()  # code --install-extension after uninstall\n        server = ALLanguageServer(...)\n    else:\n        raise","preventionTips":["After installing or updating the AL extension, verify the bin/<platform> directory contains the host binary.","Never point AL_EXTENSION_PATH at source checkouts or partially copied folders.","Match the extension platform to the host OS (don't reuse Windows extension snapshots on Linux)."],"tags":["language-server","file-not-found","vscode-extension","installation"],"backgroundTag":"language-server-binary-missing","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}