{"record":{"id":"f375642a51349408","repo":"getsops/sops","slug":"error-marshaling-metadata-s","errorCode":null,"errorMessage":"Error marshaling metadata: %s","messagePattern":"Error marshaling metadata: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"stores/dotenv/store.go","lineNumber":82,"sourceCode":"\t\t\tbranch = append(branch, sops.TreeItem{\n\t\t\t\tKey:   string(line[:pos]),\n\t\t\t\tValue: strings.Replace(string(line[pos+1:]), \"\\\\n\", \"\\n\", -1),\n\t\t\t})\n\t\t}\n\t}\n\n\tbranches = append(branches, branch)\n\treturn branches, nil\n}\n\n// EmitEncryptedFile returns the encrypted file's bytes corresponding to a sops\n// runtime object\nfunc (store *Store) EmitEncryptedFile(in sops.Tree) ([]byte, error) {\n\tbranches, err := stores.SerializeMetadata(in, stores.MetadataOpts{\n\t\tFlatten: stores.MetadataFlattenFull,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error marshaling metadata: %s\", err)\n\t}\n\treturn store.EmitPlainFile(branches)\n}\n\n// EmitPlainFile returns the plaintext file's bytes corresponding to a sops\n// runtime object\nfunc (store *Store) EmitPlainFile(in sops.TreeBranches) ([]byte, error) {\n\tbuffer := bytes.Buffer{}\n\tfor _, item := range in[0] {\n\t\tif stores.IsComplexValue(item.Value) {\n\t\t\treturn nil, fmt.Errorf(\"cannot use complex value in dotenv file; offending key %s\", item.Key)\n\t\t}\n\t\tvar line string\n\t\tif comment, ok := item.Key.(sops.Comment); ok {\n\t\t\tline = fmt.Sprintf(\"#%s\\n\", comment.Value)\n\t\t} else {\n\t\t\tvalue, ok := item.Value.(string)\n\t\t\tif !ok {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/stores/dotenv/store.go#L64-L100","documentation":"Error \"Error marshaling metadata: %s\" thrown in getsops/sops.","triggerScenarios":"Thrown at stores/dotenv/store.go:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}