{"record":{"id":"c5ae28a3a744a58f","repo":"hasura/graphql-engine","slug":"error-in-converting-sdl-to-metadata-w","errorCode":null,"errorMessage":"error in converting sdl to metadata: %w","messagePattern":"error in converting sdl to metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":145,"sourceCode":"\n\tdata, err := editor.CaptureInputFromEditor(\n\t\teditor.GetPreferredEditorFromEnvironment,\n\t\tgraphqlFileContent,\n\t\t\"graphql\",\n\t)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error in getting input from editor: %w\", err))\n\t}\n\n\tsdlFromReq := types.SDLFromRequest{\n\t\tSDL: types.SDLPayload{\n\t\t\tComplete: string(data),\n\t\t},\n\t}\n\n\tsdlFromResp, err := a.cliExtensionConfig.ConvertSDLToMetadata(sdlFromReq)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error in converting sdl to metadata: %w\", err))\n\t}\n\n\tcurrentActionNames := make([]string, 0)\n\tfor actionIndex, action := range sdlFromResp.Actions {\n\t\tif slices.Contains(currentActionNames, action.Name) {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"action %s already exists in %s\", action.Name, graphqlFileName),\n\t\t\t)\n\t\t}\n\n\t\tcurrentActionNames = append(currentActionNames, action.Name)\n\t\tfor oldActionIndex, oldActionObj := range oldAction.Actions {\n\t\t\tif action.Name == oldActionObj.Name {\n\t\t\t\tsdlFromResp.Actions[actionIndex].Permissions = oldAction.Actions[oldActionIndex].Permissions\n\t\t\t\tsdlFromResp.Actions[actionIndex].Comment = oldAction.Actions[oldActionIndex].Comment\n\t\t\t\tsdlFromResp.Actions[actionIndex].Definition.Timeout = oldAction.Actions[oldActionIndex].Definition.Timeout\n\t\t\t\tsdlFromResp.Actions[actionIndex].Definition.Kind = oldAction.Actions[oldActionIndex].Definition.Kind","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L127-L163","documentation":"Thrown by Actions.Create when the SDL collected from the editor must be converted to action metadata via the cli-extension server's ConvertSDLToMetadata endpoint and that call fails. The extension error is wrapped in the message.","triggerScenarios":"After the editor closes, Create posts the SDL to the cli-extension; failure occurs when the extension process is missing/crashed, its HTTP endpoint is unreachable, or it rejects the SDL payload (unsupported GraphQL syntax for action definitions).","commonSituations":"cli-extension binary not downloaded, corrupted, or incompatible with the host OS/arch; version skew between CLI and extension; or hand-written GraphQL in the editor that isn't valid action SDL (missing handler/output types).","solutions":["Check the wrapped error — extension endpoint errors usually name the cause (process vs parse)","Reinstall/upgrade the CLI so a matching cli-extension is fetched; clear the extension cache","Fix the SDL written in the editor: valid action types with handler and output type definitions","Verify the platform is supported for the bundled cli-extension binary"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Sanity-check the SDL before submission: must parse as GraphQL and define the action type\nif !graphqlValid(mySDL) || !strings.Contains(mySDL, \"handler:\") {\n\t// fix the SDL before invoking Create\n}","typeGuard":null,"tryCatchPattern":"if err := actions.Create(...); err != nil {\n\tif strings.Contains(err.Error(), \"converting sdl to metadata\") {\n\t\t// inspect wrapped cause: fix SDL syntax, or repair/reinstall cli-extension, then retry\n\t}\n\treturn err\n}","preventionTips":["Write valid action SDL (typed Mutation/Query fields, handler, output types) in the editor","Keep cli-extension and CLI versions matched","Retry once after transient extension startup failures before aborting"],"tags":["hasura","actions","cli-extension","sdl","metadata"],"backgroundTag":"cli-extension-call-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}