{"record":{"id":"0558858a94e32962","repo":"hashicorp/nomad","slug":"http-max-size-must-be-d-but-found-d","errorCode":null,"errorMessage":"http_max_size must be < %d but found %d","messagePattern":"http_max_size must be < (.+?) but found (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/config/artifact.go","lineNumber":181,"sourceCode":"\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\")\n\t}\n\tif v, err := time.ParseDuration(*a.GitTimeout); err != nil {\n\t\treturn fmt.Errorf(\"git_timeout not a valid duration: %w\", err)\n\t} else if v < 0 {\n\t\treturn fmt.Errorf(\"git_timeout must be > 0\")","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/config/artifact.go#L163-L199","documentation":"Returned by ArtifactConfig.Validate when http_max_size parses successfully as a byte size but exceeds math.MaxInt64 (9223372036854775807 bytes, ~9.2 EB). Nomad stores the size internally as a signed 64-bit integer, so a larger value would overflow; the config is rejected instead.","triggerScenarios":"Setting `http_max_size` to an astronomically large value such as \"10eb\", \"10000000tb\", or a huge bare byte count greater than 9223372036854775807 that still parses via humanize.ParseBytes.","commonSituations":"Using \"0\" or a sentinel to mean unlimited but picking a giant value instead; misreading the unit scale (eb vs mb); generated config from tooling multiplying values wrongly; attempting \"unlimited\" via a maximum literal.","solutions":["Lower http_max_size to a realistic value below 9223372036854775807 bytes, e.g. \"1tb\" or \"10gb\".","If you intended unlimited downloads, remove/omit the constraint rather than using a huge sentinel value.","Verify the unit: eb/exabytes vs mb/megabytes — an exabyte-scale value will always trip this."],"exampleFix":"// before\nartifact {\n  http_max_size = \"10eb\"\n}\n// after\nartifact {\n  http_max_size = \"10gb\"\n}","handlingStrategy":"validation","validationCode":"func fitsInt64(s string) bool {\n    v, err := humanize.ParseBytes(s)\n    return err == nil && v <= math.MaxInt64\n}","typeGuard":"func isSaneMaxSize(s string) bool {\n    v, err := humanize.ParseBytes(s)\n    return err == nil && v > 0 && v <= math.MaxInt64\n}","tryCatchPattern":null,"preventionTips":["Use realistic sizes (mb/gb/tb); avoid exabyte-scale values.","Do not use giant sentinel values for 'unlimited'.","Check computed sizes against math.MaxInt64 when generating config programmatically."],"tags":["config","validation","overflow","nomad"],"backgroundTag":"integer-overflow-limit","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"}