{"record":{"id":"e5fe95d8e33bfcac","repo":"hashicorp/nomad","slug":"failed-to-parse-image-pull-timeout-duration-v","errorCode":null,"errorMessage":"failed to parse 'image_pull_timeout' duration: %v","messagePattern":"failed to parse 'image_pull_timeout' duration: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/docker/config.go","lineNumber":828,"sourceCode":"\t\t}\n\t\tif dur < pullActivityTimeoutMinimum {\n\t\t\treturn fmt.Errorf(\"pull_activity_timeout is less than minimum, %v\", pullActivityTimeoutMinimum)\n\t\t}\n\t\td.config.pullActivityTimeoutDuration = dur\n\t}\n\n\tif d.config.InfraImagePullTimeout != \"\" {\n\t\tdur, err := time.ParseDuration(d.config.InfraImagePullTimeout)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse 'infra_image_pull_timeout' duration: %v\", err)\n\t\t}\n\t\td.config.infraImagePullTimeoutDuration = dur\n\t}\n\n\tif d.config.ImagePullTimeout != \"\" {\n\t\t_, err := time.ParseDuration(d.config.ImagePullTimeout)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse 'image_pull_timeout' duration: %v\", err)\n\t\t}\n\t}\n\n\tif err := validateAllowedNamespace(d.config.AllowedModes); err != nil {\n\t\treturn err\n\t}\n\td.config.allowRuntimes = make(map[string]struct{}, len(d.config.AllowRuntimesList))\n\tfor _, r := range d.config.AllowRuntimesList {\n\t\td.config.allowRuntimes[r] = struct{}{}\n\t}\n\n\tif c.AgentConfig != nil {\n\t\td.clientConfig = c.AgentConfig.Driver\n\t}\n\n\tdockerClient, err := d.getDockerClient()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get docker client: %v\", err)","sourceCodeStart":810,"sourceCodeEnd":846,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/config.go#L810-L846","documentation":"The Docker driver validates the optional 'image_pull_timeout' plugin configuration by passing it to time.ParseDuration. If the string is not a valid Go duration literal (e.g. \"5m\", \"30s\"), driver setup fails immediately with this wrapped parse error. It is a plugin-configuration validation error, not a runtime pull failure.","triggerScenarios":"Setting 'image_pull_timeout' in the docker driver plugin configuration to a string that time.ParseDuration cannot parse, e.g. missing unit ('30'), misspelled unit ('5mins'), or empty garbage text.","commonSituations":"Operators write 'image_pull_timeout = \"300\"' forgetting Go durations require a unit, or copy Linux-style '5m30' without units, or a config management template injects an empty string with different formatting.","solutions":["Fix the duration string to a valid Go duration with a unit, e.g. \"5m\" or \"300s\".","Check for stray characters, spaces, or quoted-inside-quote issues in the Nomad agent config (HCL) at the image_pull_timeout key.","If no timeout override is wanted, remove the image_pull_timeout key entirely rather than setting it to an empty/invalid value.","Validate the config with 'nomad agent -config ... -verify-only' before restarting agents."],"exampleFix":"// before (Nomad agent HCL)\nplugin \"docker\" {\n  config {\n    image_pull_timeout = \"300\"\n  }\n}\n// after\nplugin \"docker\" {\n  config {\n    image_pull_timeout = \"5m\"\n  }\n}","handlingStrategy":"validation","validationCode":"// Go: validate before applying driver config\nif cfg.ImagePullTimeout != \"\" {\n    if _, err := time.ParseDuration(cfg.ImagePullTimeout); err != nil {\n        return fmt.Errorf(\"invalid image_pull_timeout %q: %w\", cfg.ImagePullTimeout, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"errcheck: handle the setup error and refuse to start the agent/driver with a clear message naming the offending key.","preventionTips":["Always include a unit suffix in Go durations: 5m, 300s, 1h.","Run 'nomad agent -verify-only' (config validation) in CI for agent configs.","Keep a documented example of image_pull_timeout in your config templates."],"tags":["config","docker","duration-parsing"],"backgroundTag":"invalid-duration-format","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}