{"record":{"id":"ff66ce46fb3d1b14","repo":"hashicorp/nomad","slug":"gcs-timeout-must-be-set","errorCode":null,"errorMessage":"gcs_timeout must be set","messagePattern":"gcs_timeout must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/config/artifact.go","lineNumber":185,"sourceCode":"\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\")\n\t}\n\n\tif a.HgTimeout == nil {\n\t\treturn fmt.Errorf(\"hg_timeout must be set\")","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/config/artifact.go#L167-L203","documentation":"Returned by ArtifactConfig.Validate when the gcs_timeout field is nil/absent. Nomad requires this timeout to be explicitly configured for artifact downloads from Google Cloud Storage so that a fetch cannot hang forever; a missing value means the artifact block is incomplete.","triggerScenarios":"Omitting `gcs_timeout` entirely from an artifact config block while other fields (like http_max_size) are set; constructing an ArtifactConfig struct in Go with GCSTimeout left as a nil *time.Duration and calling Validate; decoding partial config from an HCL/JSON file missing the key.","commonSituations":"Hand-writing an agent config and only setting the timeouts you thought mattered; copying an artifact example predating the gcs_timeout field; programmatically building config where optional pointer fields default to nil.","solutions":["Add an explicit gcs_timeout to the artifact block, e.g. `gcs_timeout = \"5m\"`.","If building the struct in Go, set GCSTimeout to a pointer to a valid duration before calling Validate.","Re-run `nomad validate` on the config file to catch remaining missing fields."],"exampleFix":"// before\nartifact {\n  http_max_size = \"1gb\"\n}\n// after\nartifact {\n  http_max_size = \"1gb\"\n  gcs_timeout   = \"5m\"\n}","handlingStrategy":"validation","validationCode":"func hasGCSTimeout(c *ArtifactConfig) bool { return c != nil && c.GCSTimeout != nil }","typeGuard":"func gcsTimeoutSet(a ArtifactConfig) bool { return a.GCSTimeout != nil }","tryCatchPattern":null,"preventionTips":["Template artifact blocks with all timeout fields present (http/gcs/git/hg/s3).","Run `nomad validate` in CI to catch missing required keys.","When upgrading Nomad, diff config against the new schema for newly required fields."],"tags":["config","validation","nomad","gcs"],"backgroundTag":"missing-required-config-field","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"}