{"record":{"id":"0b566b8f799884c9","repo":"hashicorp/nomad","slug":"hg-timeout-must-be-set","errorCode":null,"errorMessage":"hg_timeout must be set","messagePattern":"hg_timeout must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/config/artifact.go","lineNumber":203,"sourceCode":"\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\")\n\t}\n\tif v, err := time.ParseDuration(*a.S3Timeout); err != nil {\n\t\treturn fmt.Errorf(\"s3_timeout not a valid duration: %w\", err)\n\t} else if v < 0 {\n\t\treturn fmt.Errorf(\"s3_timeout must be > 0\")\n\t}\n\n\tif a.DecompressionFileCountLimit == nil {\n\t\treturn fmt.Errorf(\"decompression_file_count_limit must not be nil\")","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/config/artifact.go#L185-L221","documentation":"Artifact config validation found hg_timeout unset (nil) in the artifact stanza; the field is mandatory when the artifact configuration is validated.","triggerScenarios":"Omitting `hg_timeout` from an artifact config block; constructing an ArtifactConfig struct in Go with HgTimeout nil; using config files written before hg_timeout existed.","commonSituations":"Configs that only set git/http timeouts while including hg sources; legacy agent config carried forward across upgrades; programmatic config builders leaving optional pointer fields unset.","solutions":["Set hg_timeout to a valid duration such as \"10s\" in the client's artifact config"],"exampleFix":"// before\nartifact {\n  git_timeout = \"5m\"\n}\n// after\nartifact {\n  git_timeout = \"5m\"\n  hg_timeout  = \"5m\"\n}","handlingStrategy":"validation","validationCode":"func hasHgTimeout(c *ArtifactConfig) bool { return c != nil && c.HgTimeout != nil }","typeGuard":"func hgTimeoutSet(a ArtifactConfig) bool { return a.HgTimeout != nil }","tryCatchPattern":null,"preventionTips":["Include hg_timeout in your standard artifact block template.","Validate configs in CI so newly required fields fail before deploy.","Diff config against the Nomad version's schema after upgrades."],"tags":["config","validation","nomad","mercurial"],"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"}