{"record":{"id":"333fed7f4f2e7e60","repo":"hashicorp/nomad","slug":"http-max-size-must-be-set","errorCode":null,"errorMessage":"http_max_size must be set","messagePattern":"http_max_size must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/config/artifact.go","lineNumber":176,"sourceCode":"\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\")\n\t}\n\tif v, err := time.ParseDuration(*a.GCSTimeout); err != nil {\n\t\treturn fmt.Errorf(\"gcs_timeout not a valid duration: %w\", err)\n\t} else if v < 0 {\n\t\treturn fmt.Errorf(\"gcs_timeout must be > 0\")\n\t}\n\n\tif a.GitTimeout == nil {\n\t\treturn fmt.Errorf(\"git_timeout must be set\")","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/config/artifact.go#L158-L194","documentation":"ArtifactConfig.Validate requires the http_max_size option to be set; like http_read_timeout it is a *string, so absence of the key yields a nil pointer and this error. http_max_size bounds the maximum size of downloaded artifacts, and Nomad considers the artifact config incomplete without it.","triggerScenarios":"Starting a Nomad client whose artifact config block omits http_max_size, so ArtifactConfig.HTTPMaxSize remains nil during agent startup validation.","commonSituations":"Old agent configs predating the http_max_size option; config templates from provisioning tools that predate the option; manually trimmed configs that kept http_read_timeout but dropped http_max_size.","solutions":["Add http_max_size to the artifact block, e.g. artifact { http_max_size = \"1g\" }.","Regenerate the client config from the current Nomad default template which includes artifact defaults.","If constructing ArtifactConfig in Go, set HTTPMaxSize to a valid byte-size string before Validate.","Diff the failing config against a known-good one from the same Nomad version."],"exampleFix":"// before (HCL)\nartifact {\n  http_read_timeout = \"30s\"\n}\n// after\nartifact {\n  http_read_timeout = \"30s\"\n  http_max_size     = \"1g\"\n}","handlingStrategy":"validation","validationCode":"if cfg.Artifact.HTTPMaxSize == nil {\n    cfg.Artifact.HTTPMaxSize = ptr.Of(\"1g\")\n}\nif _, err := humanize.ParseBytes(*cfg.Artifact.HTTPMaxSize); err != nil {\n    return fmt.Errorf(\"http_max_size invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Artifact.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"http_max_size must be set\") {\n        // add http_max_size to the artifact block\n    }\n    return err\n}","preventionTips":["Always include http_max_size alongside http_read_timeout in artifact blocks.","Use humanize.ParseBytes locally to sanity-check size strings.","Refresh config templates when upgrading Nomad versions.","Keep sizes within int64 range and under the documented maximum."],"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"}