{"record":{"id":"729acb1009f6b135","repo":"hasura/graphql-engine","slug":"error-in-reading-s-w","errorCode":null,"errorMessage":"error in reading %s: %w","messagePattern":"error in reading (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":383,"sourceCode":"\tsdlFromReq := types.SDLFromRequest{\n\t\tSDL: types.SDLPayload{\n\t\t\tComplete: graphqlFileContent,\n\t\t},\n\t}\n\n\tsdlFromResp, err := a.cliExtensionConfig.ConvertSDLToMetadata(sdlFromReq)\n\tif err != nil {\n\t\treturn nil, errors.E(\n\t\t\top,\n\t\t\terrors.KindBadInput,\n\t\t\ta.error(fmt.Errorf(\"error in converting sdl to metadata: %w\", err)),\n\t\t)\n\t}\n\n\t// Read actions.yaml\n\toldAction, err := a.GetActionsFileContent()\n\tif err != nil {\n\t\treturn nil, errors.E(op, a.error(fmt.Errorf(\"error in reading %s: %w\", a.Filename(), err)))\n\t}\n\n\tfor actionIndex, action := range oldAction.Actions {\n\t\tvar isFound bool\n\n\t\tfor newActionIndex, newActionObj := range sdlFromResp.Actions {\n\t\t\tif action.Name == newActionObj.Name {\n\t\t\t\tisFound = true\n\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","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L365-L401","documentation":"During Build, after converting SDL to metadata, the CLI failed reading the existing actions.yaml (GetActionsFileContent) which it needs to merge old handler definitions with the new SDL-derived actions. The wrapped error is typically a missing file or YAML parse failure.","triggerScenarios":"Running metadata export/build when metadata/actions/actions.yaml is missing, unreadable, or contains invalid YAML (tabs, bad indentation, truncated file from a conflicted merge).","commonSituations":"Git merge conflicts leaving conflict markers in actions.yaml; partially deleted or empty actions.yaml; tabs instead of spaces after hand editing; file not committed so CI clones lack it.","solutions":["Check the wrapped error: a YAML parse error names the line, a *PathError names a missing/permission problem","Fix or restore actions.yaml from git; resolve merge conflict markers and validate with yamllint or `yaml.Marshal` round-trip","If starting fresh, regenerate actions.yaml via `hasura actions create`","Ensure read permissions on the file for the running user"],"exampleFix":"# before (invalid: tab indentation + conflict marker)\nactions:\n\t- name: createUser\n<<<<<<< HEAD\n# after\nactions:\n  - name: createUser\n    definition:\n      handler: http://localhost:3000/api/createUser","handlingStrategy":"validation","validationCode":"data, err := os.ReadFile(filepath.Join(metadataDir, \"actions.yaml\"))\nif err != nil { return err }\nvar v any\nif err := yaml.Unmarshal(data, &v); err != nil {\n    return fmt.Errorf(\"actions.yaml is invalid YAML: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := cfg.Build(ctx); err != nil {\n    if strings.Contains(err.Error(), \"error in reading actions.yaml\") {\n        // inspect wrapped error: yaml.TypeError -> fix file; PathError -> restore missing file\n    }\n}","preventionTips":["yamllint actions.yaml in CI","Resolve merge conflicts fully before running metadata export","Commit actions.yaml together with actions.graphql; use spaces, never tabs"],"tags":["yaml","metadata","build","actions","parse-error"],"backgroundTag":"yaml-parse-error","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}