{"record":{"id":"21fd6ac5d8495ba0","repo":"oraios/serena","slug":"kotlin-language-server-script-not-found-at-kotlin","errorCode":null,"errorMessage":"Kotlin Language Server script not found at {kotlin_script}","messagePattern":"Kotlin Language Server script not found at (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/kotlin_language_server.py","lineNumber":214,"sourceCode":"            )\n            static_dir = os.path.join(self._ls_resources_dir, ls_dirname)\n            os.makedirs(static_dir, exist_ok=True)\n\n            # Setup Kotlin Language Server\n            kotlin_script = os.path.join(static_dir, *artifact.launcher_parts)\n\n            if not os.path.exists(kotlin_script):\n                log.info(\"Downloading Kotlin Language Server...\")\n                artifact.dependency.download_to(static_dir)\n\n                if os.path.exists(kotlin_script) and not platform_id.is_windows():\n                    os.chmod(\n                        kotlin_script,\n                        stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH,\n                    )\n\n            if not os.path.exists(kotlin_script):\n                raise FileNotFoundError(f\"Kotlin Language Server script not found at {kotlin_script}\")\n\n            log.info(f\"Using Kotlin Language Server script at {kotlin_script}\")\n            return kotlin_script\n\n        def _create_launch_command(self, core_path: str) -> list[str]:\n            command = [core_path, \"--stdio\"]\n            # A custom ls_path is independent of Serena's managed version. Select\n            # arguments from the actual launcher so existing kotlin-lsp.sh/.cmd\n            # configurations do not inherit IntelliJ-server-only options.\n            platform_id = PlatformUtils.get_platform_id()\n            intellij_launcher_name = \"intellij-server.exe\" if platform_id.is_windows() else \"intellij-server\"\n            if os.path.basename(core_path).lower() == intellij_launcher_name:\n                command.extend([\"--system-path\", os.path.join(self._project_cache_dir, \"kotlin-lsp-system\")])\n            return command\n\n        def create_launch_command_env(self) -> dict[str, str]:\n            \"\"\"Provides JVM options for the Kotlin Language Server process.\"\"\"\n            env: dict[str, str] = {}","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/kotlin_language_server.py#L196-L232","documentation":"Raised by the Kotlin language server installer when the expected kotlin-language-server launch script is still absent from the LS resources directory after dependency installation/unpacking. The library downloads and unpacks the Kotlin language server, chmod's the script executable, and throws FileNotFoundError if the script still does not exist at the expected path. It indicates the installation produced a different layout or failed silently.","triggerScenarios":"Calling SolidLSP with the Kotlin language server when the downloaded archive does not contain languageServer.sh/kotlin-language-server.sh at the expected location, the download extracted into a nested directory, a proxy/CDN returned an HTML error page saved as the archive, or a previous partial install left the directory in a bad state.","commonSituations":"Offline or restricted CI environments where the download fails silently, upstream Kotlin language server release renamed/reshaped its assets, corrupted cached install in the multilspy resources directory, running on an OS whose shell scripts are not executable after extraction.","solutions":["Delete the cached language server directory under the multilspy ls_resources_dir so it is re-downloaded fresh","Verify network access to the Kotlin language server release URL and retry installation","Inspect the extracted directory layout; if the script lives in a subdirectory, symlink or copy it to the expected kotlin_script path","Manually install kotlin-language-server and adjust custom settings / path so the script exists at the expected location"],"exampleFix":"// before (stale/corrupt cache)\n~/.multilspy/resources/kotlin/  # partial extraction, no languageServer.sh\n// after\nrm -rf ~/.multilspy/resources/kotlin && rerun so the installer re-downloads","handlingStrategy":"validation","validationCode":"import os\nscript = os.path.expanduser(\"~/.multilspy/resources/kotlin/languageServer.sh\")\nassert os.path.isfile(script) and os.access(script, os.X_OK), f\"Kotlin LS script missing at {script} — clear cache and reinstall\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clear the multilspy ls_resources cache for kotlin after upgrading the library","Ensure outbound network to GitHub releases is allowed in CI","Run a preflight check that the script exists and is executable before starting a session","Keep OS user permissions so chmod/extract succeed in the resources dir"],"tags":["kotlin","installation","missing-file","language-server"],"backgroundTag":"language-server-binary-missing","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}