GoogleContainerTools/skaffold · error

%q running container image %q errored during run with status

Error message

%q running container image %q errored during run with status code: %d

What it means

In the Docker verify runner (pkg/skaffold/verify/docker/verify.go:280), createAndRunContainer runs a verify test inside a Docker container and waits on a status channel. When the container exits with a non-zero status code, the runner wraps the failure into this error naming the verify test and container image. It is the Docker-verify equivalent of a failing test process exit code.

Source

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

	v.TrackContainerFromBuild(graph.Artifact{
		ImageName: opts.VerifyTestName,
		Tag:       opts.VerifyTestName,
	}, tracker.Container{Name: containerName, ID: id})

	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

View on GitHub (pinned to a1189de023)

Solutions

  1. Read the container logs (docker logs or rerun with verbose output) to see the actual failure printed by the test inside the container
  2. Fix the failing test or application code that produced the non-zero exit code
  3. Verify the image referenced by the verify test config is the freshly built, correct image
  4. Check the container's env/args/mounts in the skaffold.yaml verify config so the test has everything it needs

Example fix

// before: container image is stale/broken
// skaffold.yaml verify: image: my-app-test:old
// after
// skaffold.yaml verify: image: my-app-test:latest  # rebuilt image with fixed tests
Defensive patterns

Strategy: validation

Validate before calling

// Before running `skaffold verify`, confirm the image exists locally
if !docker.ImageExists(opts.ContainerConfig.Image) {
    return fmt.Errorf("verify image %q not built/present", opts.ContainerConfig.Image)
}

Type guard

func isContainerExitErr(err error) (int, bool) {
    m := regexp.MustCompile(`status code: (\d+)`).FindStringSubmatch(err.Error())
    if m == nil {
        return 0, false
    }
    code, _ := strconv.Atoi(m[1])
    return code, true
}

Try / catch

if err := skaffold.Verify(ctx, opts); err != nil {
    if code, ok := isContainerExitErr(err); ok {
        log.Printf("verify test failed with exit code %d; see container logs", code)
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: A `skaffold verify` run using the docker verifier where the container started from opts.ContainerConfig.Image finishes with status.StatusCode != 0; errCh delivered no error, so the failure came from the container's own exit code.

Common situations: The containerized test binary exits non-zero (failing tests, assertion errors); wrong image tag pulling a broken build; missing env vars/files inside the container causing the entrypoint to crash; entrypoint script using `exit 1` on validation failure.

Related errors


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