{"record":{"id":"5873142479407ca5","repo":"oraios/serena","slug":"kotlin-lsp-version-must-contain-only-dot-separated","errorCode":null,"errorMessage":"Kotlin LSP version must contain only dot-separated integers: {version!r}","messagePattern":"Kotlin LSP version must contain only dot-separated integers: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/kotlin_language_server.py","lineNumber":135,"sourceCode":"    class DependencyProvider(LanguageServerDependencyProviderSinglePath):\n        def __init__(self, custom_settings: SolidLSPSettings.CustomLSSettings, ls_resources_dir: str, project_cache_dir: str):\n            super().__init__(custom_settings, ls_resources_dir)\n            self._project_cache_dir = project_cache_dir\n\n        @classmethod\n        def _create_artifact(cls, version: str, platform_id: PlatformId) -> KotlinLSPArtifact:\n            \"\"\"Build download and launcher metadata for one Kotlin LSP release.\n\n            JetBrains has three publishing layouts: legacy ZIPs before 262.4739.0,\n            modern platform archives under ``/kotlin-lsp`` through 262.7569.0,\n            and modern archives under ``/language-server/kotlin-server`` from\n            262.8190.0 onward. Serena verifies the frozen initial and current default\n            releases; arbitrary user-selected versions are unverified by design.\n            \"\"\"\n            try:\n                version_parts = tuple(int(part) for part in version.split(\".\"))\n            except ValueError as exc:\n                raise ValueError(f\"Kotlin LSP version must contain only dot-separated integers: {version!r}\") from exc\n\n            verified = version in {INITIAL_KOTLIN_LSP_VERSION, DEFAULT_KOTLIN_LSP_VERSION}\n            if version_parts >= KOTLIN_SERVER_PACKAGING_MIN_VERSION:\n                artifact_config = KOTLIN_SERVER_ARTIFACT_BY_PLATFORM.get(platform_id.value)\n                if artifact_config is None:\n                    raise ValueError(f\"Unsupported platform for Kotlin LSP {version}: {platform_id.value}\")\n\n                asset_suffix, archive_type, launcher_parts = artifact_config\n                asset_name = f\"kotlin-server-{version}{asset_suffix}\"\n                cdn_path = \"language-server/kotlin-server\" if version_parts >= KOTLIN_SERVER_CDN_PATH_MIN_VERSION else \"kotlin-lsp\"\n                return KotlinLSPArtifact(\n                    dependency=DownloadedDependency(\n                        url=f\"https://download-cdn.jetbrains.com/{cdn_path}/{version}/{asset_name}\",\n                        archive_type=archive_type,\n                        allowed_hosts=KOTLIN_LSP_ALLOWED_HOSTS,\n                        verified=verified,\n                    ),\n                    launcher_parts=tuple(part.format(version=version) for part in launcher_parts),","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/kotlin_language_server.py#L117-L153","documentation":"Raised by `_create_artifact` when a user-supplied Kotlin LSP version string does not parse as dot-separated integers (e.g. '1.0-beta'). The version is split on '.' and each part is passed to `int()`; the resulting ValueError is re-raised with a clearer message before any download or hash lookup occurs. This is input validation, so it fails before any network I/O.","triggerScenarios":"Passing a non-numeric version (e.g. via KotlinLanguageServer dependency config, DEFAULT/INITIAL version override, or dep-hash update tooling) such as '1.0.0-beta', 'nightly', '', or '1..0' into `_create_artifact`; `int(part)` raises ValueError which is re-raised with this message.","commonSituations":"Copying a JetBrains release name that includes a suffix; typos like '262.819O.0' (letter O); passing an empty or environment-substituted variable; downstream tests (test_invalid_version_is_rejected_before_download) exercise this path deliberately.","solutions":["Use a valid dot-separated integer version, e.g. '223.8617.171' or a value >= KOTLIN_SERVER_PACKAGING_MIN_VERSION if you want the new packaging layout","Check JetBrains's Kotlin LSP releases page for exact published version numbers","Strip non-numeric suffixes from the version string before passing it","If reading the version from config/env, print/validate it first"],"exampleFix":"// before\nKotlinLanguageServer(version=\"1.0.0-alpha\")\n// after\nKotlinLanguageServer(version=\"241.18034.62\")  # exact dot-separated integers only\n","handlingStrategy":"validation","validationCode":"import re\ndef validate_kotlin_lsp_version(v: str) -> None:\n    if not re.fullmatch(r\"\\d+(\\.\\d+)*\", v):\n        raise ValueError(f\"Kotlin LSP version must be dot-separated integers: {v!r}\")\nvalidate_kotlin_lsp_version(user_version)  # call before constructing the server/config","typeGuard":"def is_valid_kotlin_lsp_version(v: object) -> bool:\n    return isinstance(v, str) and bool(re.fullmatch(r\"\\d+(\\.\\d+)*\", v))","tryCatchPattern":"try:\n    artifact_or_server = KotlinLanguageServer(version=user_version)\nexcept ValueError as e:\n    if \"dot-separated integers\" in str(e):\n        raise ValueError(f\"Bad Kotlin LSP version {user_version!r}: use e.g. '241.18034.62'\") from e\n    raise","preventionTips":["Validate version strings against ^\\d+(\\.\\d+)*$ before passing to Serena","Only use exact versions published on JetBrains's Kotlin LSP releases page","Don't pass release names with suffixes (beta/nightly/rc) as the version","Log the raw config value when reading versions from env/config files"],"tags":["validation","version","kotlin","input"],"backgroundTag":"invalid-version-format","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}