{"record":{"id":"16a1d55f5c4a07f6","repo":"hasura/graphql-engine","slug":"convert-to-yaml-w","errorCode":null,"errorMessage":"convert to yaml: %w","messagePattern":"convert to yaml: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/plugins.go","lineNumber":476,"sourceCode":"}\n\nfunc (c *Config) LoadManifest(path string) (Plugin, error) {\n\tvar op errors.Op = \"plugins.Config.LoadManifest\"\n\n\tplugin, err := c.ReadPluginFromFile(path)\n\tif err != nil {\n\t\treturn plugin, errors.E(op, err)\n\t}\n\n\treturn plugin, nil\n}\n\nfunc (c *Config) StoreManifest(plugin Plugin, dest string) error {\n\tvar op errors.Op = \"plugins.Config.StoreManifest\"\n\n\tyamlBytes, err := yaml.Marshal(plugin)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"convert to yaml: %w\", err))\n\t}\n\n\terr = os.WriteFile(dest, yamlBytes, 0o644)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"write plugin receipt %q: %w\", dest, err))\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":458,"sourceCodeEnd":486,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/plugins.go#L458-L486","documentation":"StoreManifest serializes a Plugin struct to YAML before writing the plugin receipt file; this error means yaml.Marshal failed. With a plain data struct this is rare, and usually indicates a field type the YAML encoder cannot handle (e.g. custom types with broken MarshalYAML, channels, funcs, or cyclic references).","triggerScenarios":"Calling Config.Install or Config.Upgrade with a Plugin whose fields include a type implementing yaml.Marshaler that itself returns an error, or a cyclic data structure.","commonSituations":"Custom plugin structs with map[interface{}]interface{} keys that are not marshalable; a fork or version change that added non-serializable fields to Plugin; NaN/Inf values in unsupported key positions.","solutions":["Inspect the Plugin struct for custom MarshalYAML methods or non-serializable field types (func, chan, complex) and fix them","Check for cyclic references between Plugin and nested structs","Unit-test yaml.Marshal on the exact Plugin value being stored to reproduce the encoder error"],"exampleFix":"// before\ntype Plugin struct {\n\tHooks chan Hook // yaml cannot marshal channels\n}\n\n// after\ntype Plugin struct {\n\tHooks []Hook\n}","handlingStrategy":"validation","validationCode":"if _, err := yaml.Marshal(plugin); err != nil { return fmt.Errorf(\"plugin not serializable: %w\", err) }","typeGuard":null,"tryCatchPattern":"if err := cfg.StoreManifest(plugin, dest); err != nil {\n\tif strings.Contains(err.Error(), \"convert to yaml\") {\n\t\t// fix Plugin struct fields; do not retry\n\t}\n}","preventionTips":["Keep Plugin as a plain serializable struct; avoid func/chan/cyclic fields","Unit-test yaml.Marshal round-trip for any new Plugin fields"],"tags":["plugins","yaml","serialization"],"backgroundTag":"yaml-marshal-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}