{"record":{"id":"90de4a0b67f8e1a5","repo":"hasura/graphql-engine","slug":"error-in-converting-metadata-to-sdl-w","errorCode":null,"errorMessage":"error in converting metadata to sdl: %w","messagePattern":"error in converting metadata to sdl: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":120,"sourceCode":"}\n\ninput SampleInput {\n\tusername: String!\n\tpassword: String!\n}\n`\n\t} else {\n\t\tsdlToReq := types.SDLToRequest{\n\t\t\tDerive: types.DerivePayload{\n\t\t\t\tIntrospectionSchema: introSchema,\n\t\t\t\tOperation:           deriveFrom,\n\t\t\t\tActionName:          name,\n\t\t\t},\n\t\t}\n\n\t\tsdlToResp, err := a.cliExtensionConfig.ConvertMetadataToSDL(sdlToReq)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in converting metadata to sdl: %w\", err))\n\t\t}\n\n\t\tdefaultSDL = sdlToResp.SDL.Complete\n\t}\n\n\tgraphqlFileContent = defaultSDL + \"\\n\" + graphqlFileContent\n\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{","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L102-L138","documentation":"Thrown by Actions.Create when no intro schema is provided and the CLI must generate default SDL by calling the cli-extension server's ConvertMetadataToSDL endpoint; that call failed. The underlying error from the extension is wrapped in the message.","triggerScenarios":"Calling Create with introSchema == nil so the default Mutation scaffolding must be rendered via the cli-extension (a bundled Node binary); the extension process fails to start, its HTTP endpoint errors, or it's missing/incompatible with the host platform.","commonSituations":"The cli-extension binary isn't downloaded or is corrupted, an unsupported OS/arch, node runtime issues in sandboxed CI, or a version mismatch between CLI and extension where the convert endpoint changed.","solutions":["Run with a recent CLI version so the matching cli-extension is fetched (retry after `hasura update-cli` or reinstall)","Clear and re-download the extension cache, then retry","Pass a non-nil introSchema to skip the ConvertMetadataToSDL path entirely","Check the wrapped error for extension process/startup details"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Ensure a matching cli-extension is available before calling Create\nif _, err := os.Stat(cliExtensionPath()); err != nil {\n\t// reinstall CLI / download extension before proceeding\n}","typeGuard":null,"tryCatchPattern":"if err := actions.Create(name, derive, nil, false); err != nil {\n\tif strings.Contains(err.Error(), \"converting metadata to sdl\") {\n\t\t// retry once after ensuring extension present; or supply introSchema to bypass\n\t}\n\treturn err\n}","preventionTips":["Keep CLI and cli-extension versions in sync via official installs","Pass an introSchema when you don't need extension-generated defaults","Pin CLI versions in CI to avoid extension download mismatches"],"tags":["hasura","actions","cli-extension","sdl"],"backgroundTag":"cli-extension-call-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}