{"record":{"id":"46ebae4877d497cc","repo":"hasura/graphql-engine","slug":"error-in-getting-codegen-for-action-s-w","errorCode":null,"errorMessage":"error in getting codegen for action %s: %w","messagePattern":"error in getting codegen for action (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":283,"sourceCode":"\t}\n\n\tdata := types.ActionsCodegenRequest{\n\t\tActionName: name,\n\t\tSDL: types.SDLPayload{\n\t\t\tComplete: graphqlFileContent,\n\t\t},\n\t\tCodegenConfig: a.ActionConfig.Codegen,\n\t\tDerive:        derivePld,\n\t}\n\tif a.ActionConfig.Codegen.URI == \"\" {\n\t\tdata.CodegenConfig.URI = a.getActionsCodegenURI(data.CodegenConfig.Framework)\n\t}\n\n\tresp, err := a.cliExtensionConfig.GetActionsCodegen(data)\n\tif err != nil {\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"error in getting codegen for action %s: %w\", data.ActionName, err),\n\t\t)\n\t}\n\n\tfor _, file := range resp.Files {\n\t\terr = os.WriteFile(\n\t\t\tfilepath.Join(a.ActionConfig.Codegen.OutputDir, file.Name),\n\t\t\t[]byte(file.Content),\n\t\t\t0o644,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in writing codegen file: %w\", err))\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (a *ActionConfig) Validate() error {","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L265-L301","documentation":"Codegen called the actions codegen extension (GetActionsCodegen) and the extension itself returned an error — the CLI is only surfacing it with the action name. Root causes live in the extension: unsupported language/plugin, malformed SDL payload, or a crashed/missing plugin binary.","triggerScenarios":"Running `hasura actions codegen <action>` with a derive payload whose language/framework the installed codegen extension does not support, or when the extension process fails on the submitted SDL.","commonSituations":"Using --derive-from typescript or a specific framework with an outdated actions codegen extension; upgrading the CLI without upgrading extensions; SDL containing custom scalars the codegen plugin can't handle.","solutions":["Read the wrapped error from the extension — it names the actual failure (unsupported framework, SDL parse error)","Upgrade the hasura CLI and its bundled actions codegen extension to the latest version and retry","Simplify the action signature (remove custom scalars/nested inputs) and retry codegen","Try a different --derive-from option supported by your extension version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := cfg.Codegen(name, derivePld); err != nil {\n    if strings.Contains(err.Error(), \"error in getting codegen for action\") {\n        // wrapped error is from the extension: surface it, upgrade extension, retry once\n        log.Printf(\"codegen extension failed: %v\", err)\n    }\n}","preventionTips":["Keep the actions codegen extension updated with the CLI","Use --derive-from options documented for your CLI version","Keep action SDL free of exotic custom scalars when codegenning"],"tags":["codegen","extension","actions","cli"],"backgroundTag":"plugin-invocation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}