juanfont/headscale · error

container not ready: %w

Error message

container not ready: %w

What it means

Error "container not ready: %w" thrown in juanfont/headscale.

Source

Thrown at integration/tsic/tsic.go:797

// "tailscale up" with any auth keys stored in environment variables.
func (t *TailscaleInContainer) Restart() error {
	if t.container == nil {
		return errContainerNotInitialized
	}

	// Use Docker API to restart the container
	err := t.pool.Client.RestartContainer(t.container.Container.ID, 30)
	if err != nil {
		return fmt.Errorf("restarting container %s: %w", t.hostname, err)
	}

	// Wait for the container to be back up and tailscaled to be ready
	// We use exponential backoff to poll until we can successfully execute a command
	_, err = backoff.Retry(context.Background(), func() (struct{}, error) {
		// Try to execute a simple command to verify the container is responsive
		_, _, err := t.Execute([]string{tailscaleBin, "version"}, dockertestutil.ExecuteCommandTimeout(5*time.Second))
		if err != nil {
			return struct{}{}, fmt.Errorf("container not ready: %w", err)
		}

		return struct{}{}, nil
	}, backoff.WithBackOff(backoff.NewExponentialBackOff()), backoff.WithMaxElapsedTime(30*time.Second))
	if err != nil {
		return fmt.Errorf("timeout waiting for container %s to restart and become ready: %w", t.hostname, err)
	}

	return nil
}

// Up runs `tailscale up` with no arguments.
func (t *TailscaleInContainer) Up() error {
	command := []string{
		tailscaleBin,
		"up",
	}

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (container not ready); retry the operation after fixing the input, configuration, or environment.

Example fix

Inspect the wrapped error for the underlying cause and correct the failing condition (container not ready); retry the operation after fixing the input, configuration, or environment.

When it happens

Trigger: Thrown at integration/tsic/tsic.go:797 when the library encounters an invalid state.

Common situations: The container did not become ready in time after start. Inspect container logs for a crash loop or slow startup.


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