juanfont/headscale · error

test failed

Error message

test failed

What it means

Terminal error from WaitForTailscaleUp when the requested user does not exist in s.users (errNoUserAvailable). The wait loop over user.Clients cannot run because the user lookup failed.

Source

Thrown at cmd/hi/docker.go:29

	"os"
	"os/exec"
	"path/filepath"
	"strings"
	"time"

	"github.com/cenkalti/backoff/v5"
	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/api/types/image"
	"github.com/docker/docker/api/types/mount"
	"github.com/docker/docker/client"
	"github.com/docker/docker/pkg/stdcopy"
	"github.com/juanfont/headscale/integration/dockertestutil"
)

const defaultDirPerm = 0o755

var (
	ErrTestFailed              = errors.New("test failed")
	ErrUnexpectedContainerWait = errors.New("unexpected end of container wait")
	ErrNoDockerContext         = errors.New("no docker context found")
	ErrMemoryLimitViolations   = errors.New("container(s) exceeded memory limits")
)

// runTestContainer executes integration tests in a Docker container.
//
//nolint:gocyclo // complex test orchestration function
func runTestContainer(ctx context.Context, config *RunConfig) error {
	cli, err := createDockerClient(ctx)
	if err != nil {
		return fmt.Errorf("creating Docker client: %w", err)
	}
	defer cli.Close()

	runID := dockertestutil.GenerateRunID()
	containerName := "headscale-test-suite-" + runID
	logsDir := filepath.Join(config.LogsDir, runID)

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Create the user (and its nodes) before waiting: CreateUser then CreateTailscaleInUser then WaitForTailscaleUp.
  2. Match the user string exactly with prior calls.
  3. Fix earlier setup errors that prevented user creation.
Defensive patterns

Strategy: validation

Validate before calling

if _, ok := scenario.Users()[userStr]; !ok {
    return fmt.Errorf("user %q missing; create it before WaitForTailscaleUp", userStr)
}

Prevention

When it happens

Trigger: Calling WaitForTailscaleUp(userStr, ...) with a user string never created via Scenario.CreateUser, or with a mismatched name/format.

Common situations: Typo'd or reformatted user names, scenario setup partially failed, or calling the wait before creating nodes in that user.

Related errors


AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15). Data as JSON: /api/errors/dc0846b4ab4a82dc. Report an issue: GitHub.