{"record":{"id":"f0175a516a36bbeb","repo":"pulumi/pulumi","slug":"could-not-start-language-host-rpc-server-w-f0175a","errorCode":null,"errorMessage":"could not start language host RPC server: %w","messagePattern":"could not start language host RPC server: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/pcl/cmd/pulumi-language-pcl/main.go","lineNumber":163,"sourceCode":"\n\tif p.engineAddress != \"\" {\n\t\terr := rpcutil.Healthcheck(ctx, p.engineAddress, 5*time.Minute, cancel)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not start health check host RPC server: %w\", err)\n\t\t}\n\t}\n\n\thandle, err := rpcutil.ServeWithOptions(rpcutil.ServeOptions{\n\t\tCancel: cancelChannel,\n\t\tInit: func(srv *grpc.Server) error {\n\t\t\thost := newLanguageHost(p.engineAddress, cwd, p.tracing)\n\t\t\tpulumirpc.RegisterLanguageRuntimeServer(srv, host)\n\t\t\treturn nil\n\t\t},\n\t\tOptions: rpcutil.OpenTracingServerInterceptorOptions(nil),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not start language host RPC server: %w\", err)\n\t}\n\n\tfmt.Fprintf(cmd.Stdout, \"%d\\n\", handle.Port)\n\n\tif err := <-handle.Done; err != nil {\n\t\treturn fmt.Errorf(\"language host RPC stopped serving: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// pclLanguageHost implements the LanguageRuntimeServer interface.\ntype pclLanguageHost struct {\n\tpulumirpc.UnsafeLanguageRuntimeServer\n\n\tcwd           string\n\tengineAddress string\n\ttracing       string","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/pcl/cmd/pulumi-language-pcl/main.go#L145-L181","documentation":"The PCL language host wraps failures from rpcutil.ServeWithOptions — which boots its gRPC server (listener creation, registration, initial serve) — with this message. If the server cannot be started (e.g. port binding fails), the plugin exits with this error.","triggerScenarios":"Starting `pulumi-language-pcl` when no port can be bound (listener creation error) or ServeWithOptions' Init/serve phase returns an error, such as port exhaustion or permission problems.","commonSituations":"Running in a restricted container that forbids binding sockets, ephemeral port exhaustion under heavy load, or a crash during server initialization.","solutions":["Check that the process can bind a TCP listener (permissions, no socket restrictions)","Free up ports / check ephemeral port availability with `ss -s` or `netstat`","Inspect the wrapped %w cause in the full error output for the underlying listener error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check that a listener can be bound on an ephemeral port\nln, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\nif err != nil {\n  log.Fatalf(\"no available ports: %v\", err)\n}\nln.Close()","typeGuard":null,"tryCatchPattern":"handle, err := rpcutil.ServeWithOptions(...)\nif err != nil {\n  return fmt.Errorf(\"could not start language host RPC server: %w\", err)\n}","preventionTips":["Run plugins in environments that permit binding local TCP sockets","Monitor ephemeral port exhaustion on busy hosts","Always inspect the wrapped cause rather than just the outer message"],"tags":["grpc","rpc-server","port-binding","pcl"],"backgroundTag":"rpc-server-start-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}