pulumi/pulumi · error

could not start language host RPC server: %w

Error message

could not start language host RPC server: %w

What it means

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.

Source

Thrown at sdk/pcl/cmd/pulumi-language-pcl/main.go:163

	if p.engineAddress != "" {
		err := rpcutil.Healthcheck(ctx, p.engineAddress, 5*time.Minute, cancel)
		if err != nil {
			return fmt.Errorf("could not start health check host RPC server: %w", err)
		}
	}

	handle, err := rpcutil.ServeWithOptions(rpcutil.ServeOptions{
		Cancel: cancelChannel,
		Init: func(srv *grpc.Server) error {
			host := newLanguageHost(p.engineAddress, cwd, p.tracing)
			pulumirpc.RegisterLanguageRuntimeServer(srv, host)
			return nil
		},
		Options: rpcutil.OpenTracingServerInterceptorOptions(nil),
	})
	if err != nil {
		return fmt.Errorf("could not start language host RPC server: %w", err)
	}

	fmt.Fprintf(cmd.Stdout, "%d\n", handle.Port)

	if err := <-handle.Done; err != nil {
		return fmt.Errorf("language host RPC stopped serving: %w", err)
	}

	return nil
}

// pclLanguageHost implements the LanguageRuntimeServer interface.
type pclLanguageHost struct {
	pulumirpc.UnsafeLanguageRuntimeServer

	cwd           string
	engineAddress string
	tracing       string

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Check that the process can bind a TCP listener (permissions, no socket restrictions)
  2. Free up ports / check ephemeral port availability with `ss -s` or `netstat`
  3. Inspect the wrapped %w cause in the full error output for the underlying listener error
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check that a listener can be bound on an ephemeral port
ln, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
  log.Fatalf("no available ports: %v", err)
}
ln.Close()

Try / catch

handle, err := rpcutil.ServeWithOptions(...)
if err != nil {
  return fmt.Errorf("could not start language host RPC server: %w", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: Running in a restricted container that forbids binding sockets, ephemeral port exhaustion under heavy load, or a crash during server initialization.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/f0175a516a36bbeb. Report an issue: GitHub.