{"record":{"id":"7cf770d62e60428f","repo":"juanfont/headscale","slug":"timeout-waiting-for-container-s-to-restart-and-be","errorCode":null,"errorMessage":"timeout waiting for container %s to restart and become ready: %w","messagePattern":"timeout waiting for container (.+?) to restart and become ready: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integration/tsic/tsic.go","lineNumber":803,"sourceCode":"\t// Use Docker API to restart the container\n\terr := t.pool.Client.RestartContainer(t.container.Container.ID, 30)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"restarting container %s: %w\", t.hostname, err)\n\t}\n\n\t// Wait for the container to be back up and tailscaled to be ready\n\t// We use exponential backoff to poll until we can successfully execute a command\n\t_, err = backoff.Retry(context.Background(), func() (struct{}, error) {\n\t\t// Try to execute a simple command to verify the container is responsive\n\t\t_, _, err := t.Execute([]string{tailscaleBin, \"version\"}, dockertestutil.ExecuteCommandTimeout(5*time.Second))\n\t\tif err != nil {\n\t\t\treturn struct{}{}, fmt.Errorf(\"container not ready: %w\", err)\n\t\t}\n\n\t\treturn struct{}{}, nil\n\t}, backoff.WithBackOff(backoff.NewExponentialBackOff()), backoff.WithMaxElapsedTime(30*time.Second))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"timeout waiting for container %s to restart and become ready: %w\", t.hostname, err)\n\t}\n\n\treturn nil\n}\n\n// Up runs `tailscale up` with no arguments.\nfunc (t *TailscaleInContainer) Up() error {\n\tcommand := []string{\n\t\ttailscaleBin,\n\t\t\"up\",\n\t}\n\n\tif _, _, err := t.Execute(command, dockertestutil.ExecuteCommandTimeout(dockerExecuteTimeout)); err != nil { //nolint:noinlineerr\n\t\treturn fmt.Errorf(\n\t\t\t\"%s failed to bring tailscale client up (%s): %w\",\n\t\t\tt.hostname,\n\t\t\tstrings.Join(command, \" \"),\n\t\t\terr,","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/integration/tsic/tsic.go#L785-L821","documentation":"Error \"timeout waiting for container %s to restart and become ready: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at integration/tsic/tsic.go:803 when the library encounters an invalid state.","commonSituations":"Timed out waiting for the container to restart and become ready. Increase the timeout or investigate why tailscaled startup is slow.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (timeout waiting for container  to restart and become ready); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (timeout waiting for container  to restart and become ready); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}