{"record":{"id":"aa0b91c9bc666240","repo":"apache/beam","slug":"unable-to-start-container-image-v-with-docker-for-env-v-err","errorCode":null,"errorMessage":"unable to start container image %v with docker for env %v, err: %w","messagePattern":"unable to start container image (.+?) with docker for env (.+?), err: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/environments.go","lineNumber":240,"sourceCode":"\t\t\tTty:   false,\n\t\t},\n\t\tHostConfig: &container.HostConfig{\n\t\t\tNetworkMode: \"host\",\n\t\t\tMounts:      mounts,\n\t\t\tAutoRemove:  true,\n\t\t},\n\t})\n\tif err != nil {\n\t\tcli.Close()\n\t\treturn fmt.Errorf(\"unable to create container image %v with docker for env %v, err: %w\", dp.GetContainerImage(), wk.Env, err)\n\t}\n\tcontainerID := ccr.ID\n\tlogger = logger.With(\"container\", containerID)\n\n\t_, err = cli.ContainerStart(ctx, containerID, dcli.ContainerStartOptions{})\n\tif err != nil {\n\t\tcli.Close()\n\t\treturn fmt.Errorf(\"unable to start container image %v with docker for env %v, err: %w\", dp.GetContainerImage(), wk.Env, err)\n\t}\n\n\tlogger.Debug(\"container started\")\n\tlogger.Debug(\"container start command\", \"cmd\", cmd)\n\n\t// Start goroutine to wait on container state.\n\tgo func() {\n\t\tdefer cli.Close()\n\t\tdefer wk.Stop()\n\t\tdefer func() {\n\t\t\tlogger.Debug(\"container stopped\")\n\t\t}()\n\n\t\tbgctx := context.Background()\n\n\t\t// Wait for either context cancellation or container to stop\n\t\ttype waitResult struct {\n\t\t\terr error","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/environments.go#L222-L258","documentation":"After creating the SDK harness container, dockerEnvironment starts it via ContainerStart. If the daemon fails to start the container, the error is wrapped with the image, worker environment, and cause, and the client is closed. This usually means the container was created but could not be run.","triggerScenarios":"ContainerStart fails: image entrypoint/runtime errors at exec time, port conflicts, insufficient resources, OCI runtime errors, or the container exits immediately.","commonSituations":"Incompatible image architecture (arm64 image on amd64 host), missing container runtime privileges, out-of-memory/disk conditions, or a corrupted image layer.","solutions":["Run `docker run <image>` manually to reproduce the container start failure","Check `docker logs`/daemon logs for the OCI runtime error","Verify image architecture matches the host (linux/amd64 vs linux/arm64)","Free disk/memory resources and retry the job"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if err := exec.Command(\"docker\", \"run\", \"--rm\", img, \"--help\").Run(); err != nil {\n  return fmt.Errorf(\"image %s fails to start on this host: %w\", img, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify image architecture matches the host platform","Ensure adequate disk/memory before starting jobs"],"tags":["go","beam","prism-runner","docker","container"],"backgroundTag":"invalid-state-transition","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}