{"record":{"id":"31e4d0262fb61f54","repo":"hasura/graphql-engine","slug":"action-s-is-not-present-in-s","errorCode":null,"errorMessage":"action %s is not present in %s","messagePattern":"action (.+?) is not present in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":410,"sourceCode":"\t\t\t\tsdlFromResp.Actions[newActionIndex].Permissions = oldAction.Actions[actionIndex].Permissions\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Comment = oldAction.Actions[actionIndex].Comment\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.Timeout = oldAction.Actions[actionIndex].Definition.Timeout\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.Kind = oldAction.Actions[actionIndex].Definition.Kind\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.Handler = oldAction.Actions[actionIndex].Definition.Handler\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.ForwardClientHeaders = oldAction.Actions[actionIndex].Definition.ForwardClientHeaders\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.Headers = oldAction.Actions[actionIndex].Definition.Headers\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.RequestTransform = oldAction.Actions[actionIndex].Definition.RequestTransform\n\t\t\t\tsdlFromResp.Actions[newActionIndex].Definition.ResponseTransform = oldAction.Actions[actionIndex].Definition.ResponseTransform\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !isFound {\n\t\t\treturn nil, errors.E(\n\t\t\t\top,\n\t\t\t\terrors.KindBadInput,\n\t\t\t\ta.error(fmt.Errorf(\"action %s is not present in %s\", action.Name, graphqlFileName)),\n\t\t\t)\n\t\t}\n\t}\n\n\tfor customTypeIndex, customType := range oldAction.CustomTypes.Enums {\n\t\tvar isFound bool\n\n\t\tfor newTypeObjIndex, newTypeObj := range sdlFromResp.Types.Enums {\n\t\t\tif customType.Name == newTypeObj.Name {\n\t\t\t\tisFound = true\n\t\t\t\tsdlFromResp.Types.Enums[newTypeObjIndex].Description = oldAction.CustomTypes.Enums[customTypeIndex].Description\n\t\t\t\tsdlFromResp.Types.Enums[newTypeObjIndex].Relationships = oldAction.CustomTypes.Enums[customTypeIndex].Relationships\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !isFound {","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L392-L428","documentation":"Thrown by the actions metadata Build step when an action handler defined in the actions metadata cannot be found in the generated GraphQL SDL file (graphql.actions.graphql). The build cross-checks every action name in metadata against the SDL produced by the CLI extension; a missing entry means metadata and SDL are out of sync.","triggerScenarios":"Calling actions Build() when an action exists in actions.yaml/metadata but its corresponding definition was removed or renamed in the graphql.actions.graphql file, or when SDL-to-metadata conversion dropped it.","commonSituations":"Hand-editing the GraphQL SDL file and deleting/renaming a type or action that metadata still references; partial regeneration of the SDL file; merging metadata branches that updated actions.yaml but not the .graphql file.","solutions":["Restore or re-add the missing action definition to graphql.actions.graphql so it matches the metadata action name","Regenerate the SDL from metadata via ConvertMetadataToSDL / hasura actions codegen instead of editing by hand","Remove the stale action entry from actions metadata if it was intentionally deleted"],"exampleFix":"# before: actions.yaml has\nhandlers:\n  myAction: ...\n# but graphql.actions.graphql lost `type Mutation { myAction(...): ... }`\n\n# after: restore in graphql.actions.graphql\ntype Mutation {\n  myAction(arg: String!): String!\n}","handlingStrategy":"validation","validationCode":"// Before Build: confirm every action in metadata exists in the SDL file\nimport (\n  \"os\"\n  \"strings\"\n)\n\nfunc actionsPresentInSDL(metadataActions []string, sdlPath string) bool {\n  b, err := os.ReadFile(sdlPath)\n  if err != nil { return false }\n  sdl := string(b)\n  for _, a := range metadataActions {\n    if !strings.Contains(sdl, a+\"(\") { return false }\n  }\n  return true\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit graphql.actions.graphql; regenerate it from metadata","Keep actions.yaml and the .graphql file in the same commit"],"tags":["hasura","actions","graphql-sdl","metadata-mismatch"],"backgroundTag":"metadata-schema-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}