{"record":{"id":"d242cafc0e258b61","repo":"hashicorp/nomad","slug":"job-gc-interval-should-be-greater-than-0s","errorCode":null,"errorMessage":"job_gc_interval should be greater than 0s","messagePattern":"job_gc_interval should be greater than 0s","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/agent.go","lineNumber":445,"sourceCode":"\tconf.SerfConfig.MemberlistConfig.AdvertiseAddr = serfAddr.IP.String()\n\tconf.SerfConfig.MemberlistConfig.AdvertisePort = serfAddr.Port\n\tconf.ClientRPCAdvertise = rpcAddr\n\tconf.ServerRPCAdvertise = serverAddr\n\n\t// Set up gc threshold and heartbeat grace period\n\tif gcThreshold := agentConfig.Server.NodeGCThreshold; gcThreshold != \"\" {\n\t\tdur, err := time.ParseDuration(gcThreshold)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconf.NodeGCThreshold = dur\n\t}\n\tif gcInterval := agentConfig.Server.JobGCInterval; gcInterval != \"\" {\n\t\tdur, err := time.ParseDuration(gcInterval)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse job_gc_interval: %v\", err)\n\t\t} else if dur <= time.Duration(0) {\n\t\t\treturn nil, fmt.Errorf(\"job_gc_interval should be greater than 0s\")\n\t\t}\n\t\tconf.JobGCInterval = dur\n\t}\n\tif gcThreshold := agentConfig.Server.JobGCThreshold; gcThreshold != \"\" {\n\t\tdur, err := time.ParseDuration(gcThreshold)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconf.JobGCThreshold = dur\n\t}\n\tif gcThreshold := agentConfig.Server.EvalGCThreshold; gcThreshold != \"\" {\n\t\tdur, err := time.ParseDuration(gcThreshold)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconf.EvalGCThreshold = dur\n\t}\n\tif gcThreshold := agentConfig.Server.BatchEvalGCThreshold; gcThreshold != \"\" {","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/agent.go#L427-L463","documentation":"Fires in convertServerConfig when server.job_gc_interval parses successfully but is zero or negative; a GC interval must be strictly positive or GC would spin or never run.","triggerScenarios":"Thrown at command/agent/agent.go:445 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set job_gc_interval to a positive duration","Remove the option to use the default"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}