{"record":{"id":"5a2a18ac049b9aae","repo":"hashicorp/nomad","slug":"http-read-timeout-must-be-set","errorCode":null,"errorMessage":"http_read_timeout must be set","messagePattern":"http_read_timeout must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/config/artifact.go","lineNumber":167,"sourceCode":"\tcase !pointer.Eq(a.DisableArtifactInspection, o.DisableArtifactInspection):\n\t\treturn false\n\tcase !pointer.Eq(a.DisableFilesystemIsolation, o.DisableFilesystemIsolation):\n\t\treturn false\n\tcase !helper.SliceSetEq(a.FilesystemIsolationExtraPaths, o.FilesystemIsolationExtraPaths):\n\t\treturn false\n\tcase !pointer.Eq(a.SetEnvironmentVariables, o.SetEnvironmentVariables):\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (a *ArtifactConfig) Validate() error {\n\tif a == nil {\n\t\treturn fmt.Errorf(\"artifact must not be nil\")\n\t}\n\n\tif a.HTTPReadTimeout == nil {\n\t\treturn fmt.Errorf(\"http_read_timeout must be set\")\n\t}\n\tif v, err := time.ParseDuration(*a.HTTPReadTimeout); err != nil {\n\t\treturn fmt.Errorf(\"http_read_timeout not a valid duration: %w\", err)\n\t} else if v < 0 {\n\t\treturn fmt.Errorf(\"http_read_timeout must be > 0\")\n\t}\n\n\tif a.HTTPMaxSize == nil {\n\t\treturn fmt.Errorf(\"http_max_size must be set\")\n\t}\n\tif v, err := humanize.ParseBytes(*a.HTTPMaxSize); err != nil {\n\t\treturn fmt.Errorf(\"http_max_size not a valid size: %w\", err)\n\t} else if v > math.MaxInt64 {\n\t\treturn fmt.Errorf(\"http_max_size must be < %d but found %d\", int64(math.MaxInt64), v)\n\t}\n\n\tif a.GCSTimeout == nil {\n\t\treturn fmt.Errorf(\"gcs_timeout must be set\")","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/config/artifact.go#L149-L185","documentation":"ArtifactConfig.Validate requires the http_read_timeout option to be present; it is stored as a *string so a missing key is distinguishable from an empty one. If HTTPReadTimeout is nil the artifact download configuration is incomplete and validation fails immediately with this error. Nomad needs this timeout to bound artifact fetch HTTP reads.","triggerScenarios":"Running nomad agent (client mode) with an artifact { http_read_timeout = ... } block omitted from the client config, causing the pointer to remain nil during Validate.","commonSituations":"Minimal agent configs written before the option existed; config files copied from old setups after upgrading Nomad that introduced artifact HTTP tuning options; provisioning tools that strip unknown keys.","solutions":["Add http_read_timeout to the client artifact config block, e.g. artifact { http_read_timeout = \"30s\" }.","If building config programmatically, set Artifact.HTTPReadTimeout to a duration string before Validate.","Start from Nomad's default agent config template which includes artifact defaults.","Check for provisioning tooling stripping the key from the generated config."],"exampleFix":"// before (HCL)\nclient {\n  artifact {}\n}\n// after\nclient {\n  artifact {\n    http_read_timeout = \"30s\"\n  }\n}","handlingStrategy":"validation","validationCode":"if cfg.Artifact.HTTPReadTimeout == nil {\n    cfg.Artifact.HTTPReadTimeout = ptr.Of(\"30s\")\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Artifact.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"http_read_timeout must be set\") {\n        // add the missing artifact option to the client config\n    }\n    return err\n}","preventionTips":["Keep the full artifact block (http_read_timeout, http_max_size, etc.) in every client config.","Use the current Nomad example config as the base template.","Run agent config validation in CI before deployment.","Diff configs after Nomad upgrades for newly required options."],"tags":["nomad","config","validation","missing-field"],"backgroundTag":"missing-config-key","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"}