{"record":{"id":"065489b2f6a0f313","repo":"hasura/graphql-engine","slug":"error-in-marshaling-common-w","errorCode":null,"errorMessage":"error in marshaling common: %w","messagePattern":"error in marshaling common: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/metadataobject/actions/actions.go","lineNumber":607,"sourceCode":"\n\tvar sdlToReq types.SDLToRequest\n\n\tsdlToReq.Types = common.CustomTypes\n\tsdlToReq.Actions = common.Actions\n\n\tsdlToResp, err := a.cliExtensionConfig.ConvertMetadataToSDL(sdlToReq)\n\tif err != nil {\n\t\treturn nil, errors.E(\n\t\t\top,\n\t\t\ta.error(fmt.Errorf(\"error in converting metadata to sdl: %w\", err)),\n\t\t)\n\t}\n\n\tcommon.SetExportDefault()\n\n\tcommonByt := new(bytes.Buffer)\n\tif err = metadataobject.GetEncoder(commonByt).Encode(common); err != nil {\n\t\treturn nil, errors.E(op, a.error(fmt.Errorf(\"error in marshaling common: %w\", err)))\n\t}\n\n\treturn map[string][]byte{\n\t\tfilepath.ToSlash(filepath.Join(a.MetadataDir, a.Filename())): commonByt.Bytes(),\n\t\tfilepath.ToSlash(filepath.Join(a.MetadataDir, graphqlFileName)): []byte(\n\t\t\tsdlToResp.SDL.Complete,\n\t\t),\n\t}, nil\n}\n\nfunc (a *ActionConfig) Key() string {\n\treturn metadataobject.ActionsKey\n}\n\nfunc (a *ActionConfig) Filename() string {\n\treturn \"actions.yaml\"\n}\n","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/metadataobject/actions/actions.go#L589-L625","documentation":"Export fails when the final types.Common struct (with export defaults applied) cannot be re-encoded to YAML. This is the last serialization step writing the actions metadata file.","triggerScenarios":"Calling Export() when SetExportDefault() or prior conversion produced a Common struct the YAML encoder rejects, e.g. unsupported value types introduced by conversion output.","commonSituations":"Conversion output with unexpected field types after a CLI extension version change; corrupt metadata state.","solutions":["Pin/align the cli-ext plugin version with your CLI version","Reproduce with minimal metadata to find the offending field and fix it upstream in metadata","File an issue with the metadata that triggers the marshal failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := obj.Export(ctx); err != nil {\n  if strings.Contains(err.Error(), \"error in marshaling common\") {\n    // pin/upgrade cli-ext and retry from clean metadata\n  }\n}","preventionTips":["Use clean server-exported metadata as input","Match plugin and CLI versions"],"tags":["hasura","actions","yaml","serialization"],"backgroundTag":"yaml-marshaling-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}