{"record":{"id":"3cd6121d69552514","repo":"apache/beam","slug":"unable-to-create-container-image-v-with-docker-for-env-v-err","errorCode":null,"errorMessage":"unable to create container image %v with docker for env %v, err: %w","messagePattern":"unable to create 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":232,"sourceCode":"\t\tfmt.Sprintf(\"--provision_endpoint=%v\", wk.Endpoint()),\n\t\tfmt.Sprintf(\"--logging_endpoint=%v\", wk.Endpoint()),\n\t}\n\tccr, err := cli.ContainerCreate(ctx, dcli.ContainerCreateOptions{\n\t\tConfig: &container.Config{\n\t\t\tImage: dp.GetContainerImage(),\n\t\t\tCmd:   cmd,\n\t\t\tEnv:   envs,\n\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() {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/environments.go#L214-L250","documentation":"dockerEnvironment creates the SDK harness container with the configured image, mounts, and endpoint. If the Docker API ContainerCreate call fails, the client is closed and the error is wrapped with the image name, worker environment, and underlying cause. Note the message says \"create container image\" but it is the container creation step.","triggerScenarios":"ContainerCreate returns an error: image not present locally and unpullable, invalid mount/config, name conflict, or the daemon rejected the container config.","commonSituations":"Typo'd or non-existent SDK container image tag, private registry requiring credentials, no network access to pull the image, or GOOGLE_APPLICATION_CREDENTIALS mount path issues.","solutions":["Pull the image manually (`docker pull <image>`) to see the real pull error","Verify the SDK container image tag matches a published apache/beam SDK image","Authenticate to the private registry (docker login) if using a custom image","Check mounts/credentials: ensure GOOGLE_APPLICATION_CREDENTIALS points to a readable file"],"exampleFix":"// before\npyenv = beam.CreateEnvironment(\"apache/beam_python3.99_sdk:latest\")\n// after\npyenv = beam.CreateEnvironment(\"apache/beam_python3.11_sdk:2.60.0\")","handlingStrategy":"validation","validationCode":"img := \"apache/beam_python3.11_sdk:2.60.0\"\nout, err := exec.Command(\"docker\", \"image\", \"inspect\", img).Output()\nif err != nil {\n  if err := exec.Command(\"docker\", \"pull\", img).Run(); err != nil {\n    return fmt.Errorf(\"image %s unavailable: %w\", img, err)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-pull SDK harness images before running jobs","Use exact published image tags, not invented versions"],"tags":["go","beam","prism-runner","docker","container"],"backgroundTag":"resource-not-found","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"}