{"record":{"id":"aeae29e538a96246","repo":"hashicorp/nomad","slug":"git-timeout-must-be-set","errorCode":null,"errorMessage":"git_timeout must be set","messagePattern":"git_timeout must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/config/artifact.go","lineNumber":194,"sourceCode":"\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\")\n\t}\n\tif v, err := time.ParseDuration(*a.HgTimeout); err != nil {\n\t\treturn fmt.Errorf(\"hg_timeout not a valid duration: %w\", err)\n\t} else if v < 0 {\n\t\treturn fmt.Errorf(\"hg_timeout must be > 0\")\n\t}\n\n\tif a.S3Timeout == nil {\n\t\treturn fmt.Errorf(\"s3_timeout must be set\")","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/config/artifact.go#L176-L212","documentation":"Returned by ArtifactConfig.Validate when the git_timeout field is nil/absent. Nomad requires git_timeout to be explicitly set so artifact downloads via git cannot hang indefinitely during clone/fetch operations.","triggerScenarios":"Omitting `git_timeout` from an artifact config block; building an ArtifactConfig struct in Go with GitTimeout left nil; loading a partial/legacy config file that predates the git_timeout field.","commonSituations":"Writing minimal agent configs with only the artifact source set; copying pre-1.x artifact examples; programmatic config generation skipping 'optional' pointer fields.","solutions":["Add an explicit git_timeout to the artifact block, e.g. `git_timeout = \"5m\"` (large repos may need more).","If building the struct in Go, initialize GitTimeout with a valid duration pointer before Validate.","Run `nomad validate` to surface any other missing required fields at once."],"exampleFix":"// before\nartifact {\n  http_max_size = \"1gb\"\n}\n// after\nartifact {\n  http_max_size = \"1gb\"\n  git_timeout   = \"5m\"\n}","handlingStrategy":"validation","validationCode":"func hasGitTimeout(c *ArtifactConfig) bool { return c != nil && c.GitTimeout != nil }","typeGuard":"func gitTimeoutSet(a ArtifactConfig) bool { return a.GitTimeout != nil }","tryCatchPattern":null,"preventionTips":["Keep a canonical artifact block template containing every required timeout.","Validate configs in CI with `nomad validate`.","When adding artifact sources, add matching timeouts in the same change."],"tags":["config","validation","nomad","git"],"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"}