{"record":{"id":"50ab7c7b8f22d23d","repo":"hasura/graphql-engine","slug":"error-in-getting-input-from-editor-w","errorCode":null,"errorMessage":"error in getting input from editor: %w","messagePattern":"error in getting input from editor: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":134,"sourceCode":"\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{\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,","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L116-L152","documentation":"Thrown by Actions.Create when CaptureInputFromEditor fails — the CLI could not launch the user's preferred editor ($VISUAL/$EDITOR, or a fallback) to collect the GraphQL SDL for the new action. The underlying error is wrapped.","triggerScenarios":"Running action creation in an environment with no editor available: EDITOR/VISUAL unset and no default editor found, non-interactive shells (CI, docker exec without TTY), or the configured editor command exiting abnormally.","commonSituations":"CI pipelines or containers where no editor binary exists, EDITOR pointing to a nonexistent command, or ssh sessions without a TTY.","solutions":["Set EDITOR or VISUAL to an available editor, e.g. export EDITOR=vim","Install a minimal editor in the container (vim/nano) or run the command in an interactive shell","If non-interactive use is required, use the API/SDK path that supplies SDL directly instead of the editor flow"],"exampleFix":"# before (CI, no editor)\nhasura actions create foo  # -> error getting input from editor\n\n# after\nexport EDITOR=vi\nhasura actions create foo","handlingStrategy":"validation","validationCode":"if os.Getenv(\"EDITOR\") == \"\" && os.Getenv(\"VISUAL\") == \"\" {\n\tos.Setenv(\"EDITOR\", \"vi\") // ensure a fallback editor exists\n}","typeGuard":null,"tryCatchPattern":"if err := actions.Create(...); err != nil {\n\tif strings.Contains(err.Error(), \"error in getting input from editor\") {\n\t\t// set EDITOR/VISUAL or run in an interactive TTY, then retry\n\t}\n\treturn err\n}","preventionTips":["Always export EDITOR in scripts and CI containers","Install a minimal editor (vim/nano) in docker images used for Hasura work","Avoid editor-dependent commands in non-interactive pipelines"],"tags":["hasura","actions","editor","environment"],"backgroundTag":"editor-not-available","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}