{"record":{"id":"afa52c91597c3b92","repo":"oraios/serena","slug":"found-a-go-version-but-gopls-is-not-installed-ple","errorCode":null,"errorMessage":"Found a Go version but gopls is not installed.\nPlease install gopls as described in https://pkg.go.dev/golang.org/x/tools/gopls#section-readme\n\nAfter installation, make sure it is added to your PATH (it might be installed in a different location than Go).","messagePattern":"Found a Go version but gopls is not installed\\.\nPlease install gopls as described in https://pkg\\.go\\.dev/golang\\.org/x/tools/gopls#section-readme\n\nAfter installation, make sure it is added to your PATH \\(it might be installed in a different location than Go\\)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/gopls.py","lineNumber":97,"sourceCode":"                return result.stdout.strip()\n        except FileNotFoundError:\n            return None\n        return None\n\n    @staticmethod\n    def _setup_runtime_dependency() -> bool:\n        \"\"\"\n        Check if required Go runtime dependencies are available.\n        Raises RuntimeError with helpful message if dependencies are missing.\n        \"\"\"\n        go_version = Gopls._get_go_version()\n        if not go_version:\n            raise RuntimeError(\n                \"Go is not installed. Please install Go from https://golang.org/doc/install and make sure it is added to your PATH.\"\n            )\n\n        gopls_version = Gopls._get_gopls_version()\n        if not gopls_version:\n            raise RuntimeError(\n                \"Found a Go version but gopls is not installed.\\n\"\n                \"Please install gopls as described in https://pkg.go.dev/golang.org/x/tools/gopls#section-readme\\n\\n\"\n                \"After installation, make sure it is added to your PATH (it might be installed in a different location than Go).\"\n            )\n\n        return True\n\n    def __init__(self, config: LanguageServerConfig, repository_root_path: str, solidlsp_settings: SolidLSPSettings):\n        self._setup_runtime_dependency()\n\n        super().__init__(config, repository_root_path, ProcessLaunchInfo(cmd=\"gopls\", cwd=repository_root_path), \"go\", solidlsp_settings)\n        self.request_id = 0\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the Go Language Server.\n        \"\"\"","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/gopls.py#L79-L115","documentation":"RuntimeError raised in Gopls._setup_runtime_dependency when a Go toolchain was found but the gopls language server binary is missing. The library distinguishes this from error 232 so the user knows only the language-server component is absent. gopls is not auto-installed here.","triggerScenarios":"Constructing the Gopls server when _get_go_version() succeeds but _get_gopls_version() returns falsy — i.e. `gopls version` fails or gopls is not on PATH.","commonSituations":"Fresh Go install that includes the toolchain but not gopls; gopls installed into GOBIN/GOPATH/bin (~/go/bin) which is not on PATH; gopls removed or broken after a Go toolchain upgrade.","solutions":["Install gopls: `go install golang.org/x/tools/gopls@latest`","Add the install location to PATH — typically `export PATH=$PATH:$(go env GOPATH)/bin`","Verify with `which gopls && gopls version` in the same environment that runs the library","If the Go upgrade replaced gopls, reinstall it with the @latest version"],"exampleFix":"// before\ngopls version  # command not found\n// after\ngo install golang.org/x/tools/gopls@latest\nexport PATH=$PATH:$(go env GOPATH)/bin\ngopls version","handlingStrategy":"validation","validationCode":"import shutil, subprocess\ndef ensure_gopls_installed():\n    if shutil.which('go') is None:\n        raise FileNotFoundError('Go toolchain required first')\n    if shutil.which('gopls') is None:\n        raise FileNotFoundError('gopls missing; run: go install golang.org/x/tools/gopls@latest')\n    subprocess.run(['gopls', 'version'], check=True, capture_output=True)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always install gopls alongside Go in setup scripts","Add $(go env GOPATH)/bin to PATH in shell profiles and CI","Reinstall gopls after major Go upgrades","Smoke-test `gopls version` before language-server usage"],"tags":["go","gopls","path","missing-binary","language-server"],"backgroundTag":"missing-executable-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}