gravitational/teleport · error

the real rdpclient.Client implementation was not included in

Error message

the real rdpclient.Client implementation was not included in this build

What it means

This is the stub (client_nop.go) build of rdpclient.New, compiled when the real RDP client (Windows/cgo or architecture-specific implementation) is excluded by build tags. It always returns this error — no connection can be made in this build.

Source

Thrown at lib/srv/desktop/rdp/rdpclient/client_nop.go:45

import (
	"context"
	"errors"
	"log/slog"
	"time"

	"github.com/gravitational/teleport/lib/srv/desktop/tdp"
	"github.com/gravitational/teleport/lib/srv/desktop/tdp/protocol/tdpb"
)

// Client is the dummy RDP client.
type Client struct {
}

// New creates and connects a new Client based on opts.
//
//nolint:staticcheck // SA4023. False positive, depends on build tags.
func New(_ tdp.MessageReadWriteCloser, _ *tdpb.ClientHello, cfg Config) (*Client, error) {
	return nil, errors.New("the real rdpclient.Client implementation was not included in this build")
}

// Run starts the RDP client, using the provided user certificate and private key.
// It blocks until the client disconnects, then ensures the cleanup is run.
func (c *Client) Run(ctx context.Context, certDER, keyDER []byte) error {
	return errors.New("the real rdpclient.Client implementation was not included in this build")
}

func (c *Client) GetClientUsername() string {
	return ""
}

// GetClientLastActive returns the time of the last recorded activity.
func (c *Client) GetClientLastActive() time.Time {
	return time.Now().UTC()
}

// UpdateClientActivity updates the client activity timestamp.

View on GitHub (pinned to 1283425b60)

Solutions

  1. Rebuild the binary with the build tags/include the real rdpclient implementation (CGO-enabled build)
  2. Verify desktop access is supported for the target platform of the artifact
  3. If intentionally stubbed, guard desktop RDP features behind capability checks instead of calling New

Example fix

// before
go build ./...            # stub included, New always errors
// after
go build -tags desktop_access_rdp ./...   # or CGO_ENABLED=1 with proper tags
Defensive patterns

Strategy: fallback

Try / catch

c, err := rdpclient.New(conn, hello, cfg)
if err != nil && strings.Contains(err.Error(), "not included in this build") {
    return trace.NotImplemented("RDP desktop access unavailable in this build")
}

Prevention

When it happens

Trigger: Calling rdpclient.New in a binary built without the RDP client build tag (e.g. non-Windows/non-cgo build or a build excluding the tagged client implementation file).

Common situations: Running Teleport desktop access on a build compiled without RDP support; developers testing on Linux without the cgo-enabled build; CI artifacts stripped of the real client.

Related errors


AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02). Data as JSON: /api/errors/0f4fd80df8e1e8a7. Report an issue: GitHub.