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

A docker action task (skaffold actions) ran its container and the container exited with a non-zero status code. The task formats this into an error naming the action task, the container image, and the exit code. It surfaces the container's failure rather than Skaffold's own.

Source

Thrown at pkg/skaffold/actions/docker/task.go:112

		return err
	}

	statusCh, errCh, id, err := t.client.Run(ctx, out, *opts)
	if err != nil {
		return errors.Wrap(err, "creating container in local docker")
	}

	t.execEnv.TrackContainerFromBuild(graph.Artifact{
		ImageName: t.cfg.Name,
		Tag:       t.cfg.Name,
	}, id, cn)

	var containerErr error
	select {
	case containerErr = <-errCh:
	case status := <-statusCh:
		if status.StatusCode != 0 {
			containerErr = errors.New(fmt.Sprintf("%q running container image %q errored during run with status code: %d", t.name, opts.ContainerConfig.Image, status.StatusCode))
		}
	case <-ctx.Done():
		containerErr = ctx.Err()
		if err := t.client.Stop(context.TODO(), id, util.Ptr(time.Second*0)); err != nil {
			containerErr = err
		}
	}

	return containerErr
}

func (t Task) Cleanup(ctx context.Context, out io.Writer) error {
	id, found := t.execEnv.GetContainerID(t.cfg.Name)
	if !found {
		return nil
	}

	t.client.Stop(ctx, id, nil)

View on GitHub (pinned to a1189de023)

Solutions

  1. Read the container logs (skaffold streams them) to find the actual failure inside the container
  2. Fix the script/entrypoint in the container image to exit 0 on success
  3. Reproduce locally: `docker run <image>` with the same args to debug the exit code
  4. Check the reported status code — non-zero codes often encode the specific failure mode

Example fix

// before (Dockerfile/entrypoint)
cmd
// after
cmd || exit 0  # only if the non-zero exit is expected/benign; otherwise fix cmd
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: run the same image locally and check the exit code
docker run --rm <image> <args> || echo "container will fail with code $?"

Try / catch

err := task.Exec(ctx, out)
if err != nil {
  var exitErr interface{ ExitCode() int }
  if errors.As(err, &statusErr) || strings.Contains(err.Error(), "errored during run with status code") {
    log.Errorf("action container failed; inspect streamed logs above for the root cause")
  }
  return err
}

Prevention

When it happens

Trigger: execAndLog -> Exec starting a container via the docker client; the container's statusCh reports StatusCode != 0 (the process inside exited with that code). Not triggered by image pull errors or context cancellation (those produce different errors).

Common situations: Custom test/verify action scripts failing with exit 1; containers whose entrypoint crashes; images built from failing test suites run as actions.

Related errors


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