GoogleContainerTools/skaffold · error

%q running container image %q timed out after : %v

Error message

%q running container image %q timed out after : %v

What it means

In the Docker verify runner (pkg/skaffold/verify/docker/verify.go:284), createAndRunContainer enforces a timeout on the verify container. If the timeout timer fires before the container reports status, the runner produces this error naming the test, image, and timeout duration, then stops and removes the container.

Source

Thrown at pkg/skaffold/verify/docker/verify.go:284

	var timeoutDuration *time.Duration = nil
	if tc.Config.Timeout != nil {
		timeoutDuration = util.Ptr(time.Second * time.Duration(*tc.Config.Timeout))
	}

	var containerErr error
	select {
	case err := <-errCh:
		if err != nil {
			containerErr = err
		}
	case status := <-statusCh:
		if status.StatusCode != 0 {
			containerErr = errors.New(fmt.Sprintf("%q running container image %q errored during run with status code: %d", opts.VerifyTestName, opts.ContainerConfig.Image, status.StatusCode))
		}
	case <-v.timeout(timeoutDuration):
		// verify test timed out
		containerErr = errors.New(fmt.Sprintf("%q running container image %q timed out after : %v", opts.VerifyTestName, opts.ContainerConfig.Image, *timeoutDuration))
		v.client.Stop(ctx, id, util.Ptr(time.Second*0))
		err := v.client.Remove(ctx, id)
		if err != nil {
			return errors.Wrap(containerErr, err.Error())
		}
	}

	if containerErr != nil {
		eventV2.VerifyFailed(tc.Name, containerErr)
		return errors.Wrap(containerErr, "verify test failed")
	}

	eventV2.VerifySucceeded(opts.VerifyTestName)
	return nil
}

func (v *Verifier) containerConfigFromImage(ctx context.Context, taggedImage string) (*container.Config, error) {
	ociConfig, _, err := v.client.ImageInspectWithRaw(ctx, taggedImage)

View on GitHub (pinned to a1189de023)

Solutions

  1. Increase the timeout value for the verify test in skaffold.yaml to cover the test's real runtime
  2. Debug why the container hangs: run the same image manually with `docker run` and inspect where it blocks
  3. Fix unreachable dependencies the test waits on (network, database, service DNS)
  4. Fix hangs/deadlocks in the test code itself so the container exits promptly

Example fix

// before
// skaffold.yaml verify tests: - timeout: 60
// after
// skaffold.yaml verify tests: - timeout: 600  # allow slow integration test to finish
Defensive patterns

Strategy: validation

Validate before calling

// Sanity-check that the timeout is generous enough for the test
const minVerifyTimeout = 300 * time.Second
if *timeoutDuration < minVerifyTimeout {
    log.Printf("verify timeout %v is low; consider raising it", *timeoutDuration)
}

Type guard

func isVerifyTimeout(err error) bool {
    return strings.Contains(err.Error(), "timed out after")
}

Try / catch

if err := skaffold.Verify(ctx, opts); err != nil {
    if isVerifyTimeout(err) {
        log.Println("verify container timed out; rerun with a larger timeout and capture logs")
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: A `skaffold verify` docker test whose container does not exit before timeoutDuration elapses; the select's `case <-v.timeout(timeoutDuration)` branch is hit and the container is force-stopped via v.client.Stop with 0s grace and removed.

Common situations: Test hangs waiting on a network dependency or DB that is unreachable; deadlock or infinite loop in the test; timeout in skaffold.yaml set too low for a legitimately slow integration test.

Understand the failure class

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/f53cc62141d490bc. Report an issue: GitHub.