{"record":{"id":"98881fc5503b6d84","repo":"hashicorp/nomad","slug":"action-s-not-found-in-task-s","errorCode":null,"errorMessage":"action %s not found in task %s","messagePattern":"action (.+?) not found in task (.+?)","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"client/alloc_endpoint.go","lineNumber":313,"sourceCode":"\t\treturn new(int64(400)), taskNotPresentErr\n\t}\n\n\tif req.JobID != \"\" && req.JobID != alloc.JobID {\n\t\treturn new(int64(http.StatusBadRequest)),\n\t\t\tfmt.Errorf(\"job %s does not have allocation %s\", req.JobID, req.AllocID)\n\t}\n\n\t// If an action is present, go find the command and args\n\tif req.Action != \"\" {\n\t\ttask := alloc.LookupTask(req.Task)\n\t\tif task == nil {\n\t\t\treturn new(int64(http.StatusBadRequest)),\n\t\t\t\tfmt.Errorf(\"task %s not found in allocation %s\", req.Task, alloc.ID)\n\t\t}\n\t\tjobAction := task.GetAction(req.Action)\n\t\tif jobAction == nil {\n\t\t\treturn new(int64(http.StatusBadRequest)),\n\t\t\t\tfmt.Errorf(\"action %s not found in task %s\", req.Action, req.Task)\n\t\t}\n\n\t\t// append both Command and Args\n\t\treq.Cmd = append([]string{jobAction.Command}, jobAction.Args...)\n\t}\n\n\tif len(req.Cmd) == 0 {\n\t\treturn new(int64(400)), errors.New(\"command is not present\")\n\t}\n\n\tcapabilities, err := ar.GetTaskDriverCapabilities(req.Task)\n\tif err != nil {\n\t\tcode := new(int64(500))\n\t\tif nstructs.IsErrUnknownAllocation(err) {\n\t\t\tcode = new(int64(404))\n\t\t}\n\n\t\treturn code, err","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/alloc_endpoint.go#L295-L331","documentation":"Returned by the client exec endpoint after the task was resolved: task.GetAction could not find the requested action name among the task's defined actions, so there is no command to run.","triggerScenarios":"Thrown at client/alloc_endpoint.go:313 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List the actions defined on the task in the job spec and use an exact action name","Check action name spelling","Update the job spec if the action was renamed or removed"],"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"}