{"record":{"id":"edfeaca0354f9a8e","repo":"getsops/sops","slug":"error-encoding-value-s-s","errorCode":null,"errorMessage":"Error encoding value %s: %s","messagePattern":"Error encoding value (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"stores/json/store.go","lineNumber":260,"sourceCode":"\t\tempty = false\n\t}\n\tout += \"]\"\n\treturn []byte(out), nil\n}\n\nfunc (store Store) encodeTree(tree sops.TreeBranch) ([]byte, error) {\n\tout := \"{\"\n\tempty := true\n\tfor _, item := range tree {\n\t\tif _, ok := item.Key.(sops.Comment); ok {\n\t\t\tcontinue\n\t\t}\n\t\tif !empty {\n\t\t\tout += \",\"\n\t\t}\n\t\tv, err := store.encodeValue(item.Value)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error encoding value %s: %s\", v, err)\n\t\t}\n\t\tk, err := json.Marshal(item.Key.(string))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error encoding key %s: %s\", k, err)\n\t\t}\n\t\tout += string(k) + `: ` + string(v)\n\t\tempty = false\n\t}\n\treturn []byte(out + \"}\"), nil\n}\n\nfunc (store Store) jsonFromTreeBranch(branch sops.TreeBranch) ([]byte, error) {\n\tout, err := store.encodeTree(branch)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn store.reindentJSON(out)\n}","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/stores/json/store.go#L242-L278","documentation":"Error \"Error encoding value %s: %s\" thrown in getsops/sops.","triggerScenarios":"Thrown at stores/json/store.go:260 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"}