oraios/serena · error · RuntimeError
Go is not installed. Please install Go from https://golang.o
Error message
Go is not installed. Please install Go from https://golang.org/doc/install and make sure it is added to your PATH.
What it means
RuntimeError raised during Gopls.__init__ (via _setup_runtime_dependency) when the Go toolchain itself cannot be found. _get_go_version() (which shells out to `go version`) returned nothing, so gopls management cannot proceed. This is a hard prerequisite check before attempting any gopls operations.
Source
Thrown at src/solidlsp/language_servers/gopls.py:91
@staticmethod
def _get_gopls_version() -> str | None:
"""Get the installed gopls version or None if not found."""
try:
result = subprocess_run(["gopls", "version"], capture_output=True, text=True, check=False)
if result.returncode == 0:
return result.stdout.strip()
except FileNotFoundError:
return None
return None
@staticmethod
def _setup_runtime_dependency() -> bool:
"""
Check if required Go runtime dependencies are available.
Raises RuntimeError with helpful message if dependencies are missing.
"""
go_version = Gopls._get_go_version()
if not go_version:
raise RuntimeError(
"Go is not installed. Please install Go from https://golang.org/doc/install and make sure it is added to your PATH."
)
gopls_version = Gopls._get_gopls_version()
if not gopls_version:
raise RuntimeError(
"Found a Go version but gopls is not installed.\n"
"Please install gopls as described in https://pkg.go.dev/golang.org/x/tools/gopls#section-readme\n\n"
"After installation, make sure it is added to your PATH (it might be installed in a different location than Go)."
)
return True
def __init__(self, config: LanguageServerConfig, repository_root_path: str, solidlsp_settings: SolidLSPSettings):
self._setup_runtime_dependency()
super().__init__(config, repository_root_path, ProcessLaunchInfo(cmd="gopls", cwd=repository_root_path), "go", solidlsp_settings)View on GitHub (pinned to 7fcbca7e62)
Solutions
- Install Go from https://golang.org/doc/install and verify with `go version`
- Ensure the `go` binary directory (e.g. /usr/local/go/bin) is on PATH for the process running the library
- If using a version manager (gvm, asdf), activate the Go version in the target environment
- Point ls_path/go binary configuration at the absolute go binary path
Example fix
// before which go # not found // after # Linux example sudo rm -rf /usr/local/go && curl -LO https://go.dev/dl/go1.22.0.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin go version
Defensive patterns
Strategy: validation
Validate before calling
import shutil, subprocess
def ensure_go_toolchain():
if shutil.which('go') is None:
raise FileNotFoundError('Go not installed or not on PATH')
subprocess.run(['go', 'version'], check=True, capture_output=True) Prevention
- Check `go version` in environment bootstrap before running the library
- Include Go in your base Docker/CI image
- Ensure /usr/local/go/bin (or equivalent) is on PATH for daemonized processes
- Document the Go prerequisite for your tooling
When it happens
Trigger: Constructing the Gopls language server when `go version` fails or the `go` binary is absent from PATH.
Common situations: Go not installed on the machine/CI image; go installed via a version manager not active for the running process; PATH stripped in systemd/cron/IDE-spawned subprocesses.
Related errors
- Found a Go version but gopls is not installed. Please instal
- Gleam is not installed or not in PATH. Please install the Gl
- haskell-language-server-wrapper is not installed or not in P
- Haxe Language Server not found and Node.js is not installed
- Could not find 'uvx' or 'uv' in PATH. Install uv (https://do
AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29).
Data as JSON: /api/errors/960f6912653aa129.
Report an issue: GitHub.