{"record":{"id":"4c814df461ea58e2","repo":"hashicorp/nomad","slug":"missing-job-id-for-evaluation-4c814d","errorCode":null,"errorMessage":"missing job ID for evaluation","messagePattern":"missing job ID for evaluation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/periodic_endpoint.go","lineNumber":55,"sourceCode":"\tif authErr != nil {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"periodic\", \"force\"}, time.Now())\n\n\t// Check for write-job permissions\n\tif aclObj, err := p.srv.ResolveACL(args); err != nil {\n\t\treturn err\n\t} else if !aclObj.AllowNsOpAnyOf(args.RequestNamespace(),\n\t\tacl.NamespaceCapabilityDispatchJob,\n\t\tacl.NamespaceCapabilitySubmitJob,\n\t\tacl.NamespaceCapabilityForcePeriodicJob,\n\t) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\t// Validate the arguments\n\tif args.JobID == \"\" {\n\t\treturn fmt.Errorf(\"missing job ID for evaluation\")\n\t}\n\n\t// Lookup the job\n\tsnap, err := p.srv.fsm.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tws := memdb.NewWatchSet()\n\tjob, err := snap.JobByID(ws, args.RequestNamespace(), args.JobID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif job == nil {\n\t\treturn fmt.Errorf(\"job not found\")\n\t}\n\n\tif !job.IsPeriodic() {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/periodic_endpoint.go#L37-L73","documentation":"The Periodic.Force RPC failed argument validation: JobID in the periodic force request is empty, so there is no job to force-launch.","triggerScenarios":"Sending a PeriodicForceRequest with args.JobID == \"\" to the Force endpoint via RPC or the nomad job periodic force CLI/API with a blank job name.","commonSituations":"Empty variable interpolation in scripts/CI; unset environment variable used as job ID; CLI invoked with flags but no positional job ID.","solutions":["Set JobID on the PeriodicForceRequest","Verify the CLI/API invocation actually passed a job ID"],"exampleFix":"// before\nreq := &api.PeriodicForceRequest{JobID: os.Getenv(\"JOB_ID\")} // may be empty\n// after\njobID := os.Getenv(\"JOB_ID\")\nif jobID == \"\" { return errors.New(\"JOB_ID must be set\") }\nreq := &api.PeriodicForceRequest{JobID: jobID}","handlingStrategy":"validation","validationCode":"// Go\nif jobID == \"\" {\n    return errors.New(\"job ID is required for periodic force\")\n}","typeGuard":null,"tryCatchPattern":"// Go\n_, err := client.Jobs().PeriodicForce(jobID, nil)\nif err != nil && strings.Contains(err.Error(), \"missing job ID\") {\n    return fmt.Errorf(\"client bug: empty JobID sent: %w\", err)\n}","preventionTips":["Validate CLI args/flags before building the RPC","Fail fast on empty env variables used as job IDs","Add unit tests for empty-argument handling"],"tags":["nomad","validation","rpc","missing-argument"],"backgroundTag":"missing-required-argument","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"}