{"record":{"id":"f53cc62141d490bc","repo":"GoogleContainerTools/skaffold","slug":"q-running-container-image-q-timed-out-after-v","errorCode":null,"errorMessage":"%q running container image %q timed out after : %v","messagePattern":"%q running container image %q timed out after : (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/verify/docker/verify.go","lineNumber":284,"sourceCode":"\n\tvar timeoutDuration *time.Duration = nil\n\tif tc.Config.Timeout != nil {\n\t\ttimeoutDuration = util.Ptr(time.Second * time.Duration(*tc.Config.Timeout))\n\t}\n\n\tvar containerErr error\n\tselect {\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tcontainerErr = err\n\t\t}\n\tcase status := <-statusCh:\n\t\tif status.StatusCode != 0 {\n\t\t\tcontainerErr = errors.New(fmt.Sprintf(\"%q running container image %q errored during run with status code: %d\", opts.VerifyTestName, opts.ContainerConfig.Image, status.StatusCode))\n\t\t}\n\tcase <-v.timeout(timeoutDuration):\n\t\t// verify test timed out\n\t\tcontainerErr = errors.New(fmt.Sprintf(\"%q running container image %q timed out after : %v\", opts.VerifyTestName, opts.ContainerConfig.Image, *timeoutDuration))\n\t\tv.client.Stop(ctx, id, util.Ptr(time.Second*0))\n\t\terr := v.client.Remove(ctx, id)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(containerErr, err.Error())\n\t\t}\n\t}\n\n\tif containerErr != nil {\n\t\teventV2.VerifyFailed(tc.Name, containerErr)\n\t\treturn errors.Wrap(containerErr, \"verify test failed\")\n\t}\n\n\teventV2.VerifySucceeded(opts.VerifyTestName)\n\treturn nil\n}\n\nfunc (v *Verifier) containerConfigFromImage(ctx context.Context, taggedImage string) (*container.Config, error) {\n\tociConfig, _, err := v.client.ImageInspectWithRaw(ctx, taggedImage)","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/verify/docker/verify.go#L266-L302","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Increase the timeout value for the verify test in skaffold.yaml to cover the test's real runtime","Debug why the container hangs: run the same image manually with `docker run` and inspect where it blocks","Fix unreachable dependencies the test waits on (network, database, service DNS)","Fix hangs/deadlocks in the test code itself so the container exits promptly"],"exampleFix":"// before\n// skaffold.yaml verify tests: - timeout: 60\n// after\n// skaffold.yaml verify tests: - timeout: 600  # allow slow integration test to finish","handlingStrategy":"validation","validationCode":"// Sanity-check that the timeout is generous enough for the test\nconst minVerifyTimeout = 300 * time.Second\nif *timeoutDuration < minVerifyTimeout {\n    log.Printf(\"verify timeout %v is low; consider raising it\", *timeoutDuration)\n}","typeGuard":"func isVerifyTimeout(err error) bool {\n    return strings.Contains(err.Error(), \"timed out after\")\n}","tryCatchPattern":"if err := skaffold.Verify(ctx, opts); err != nil {\n    if isVerifyTimeout(err) {\n        log.Println(\"verify container timed out; rerun with a larger timeout and capture logs\")\n    } else {\n        return err\n    }\n}","preventionTips":["Set timeouts well above the measured worst-case test runtime","Monitor test duration in CI and bump timeout before it drifts over the limit","Ensure the container always terminates (no indefinite waits on network/DB)","Run the image standalone to confirm it exits on its own"],"tags":["docker","verify","timeout","container"],"backgroundTag":"operation-timed-out","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}