{"record":{"id":"2e563c8d2d51a8d4","repo":"getsops/sops","slug":"yaml-negative-indentation-not-accepted","errorCode":null,"errorMessage":"YAML Negative indentation not accepted","messagePattern":"YAML Negative indentation not accepted","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"stores/yaml/store.go","lineNumber":356,"sourceCode":"\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error unmarshaling input YAML: %s\", err)\n\t\t}\n\n\t\tbranch, err := store.yamlDocumentNodeToTreeBranch(data)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error unmarshaling input YAML: %s\", err)\n\t\t}\n\t\tbranches = append(branches, branch)\n\t}\n\treturn branches, nil\n}\n\nfunc (store *Store) getIndentation() (int, error) {\n\tif store.config.Indent > 0 {\n\t\treturn store.config.Indent, nil\n\t} else if store.config.Indent < 0 {\n\t\treturn 0, errors.New(\"YAML Negative indentation not accepted\")\n\t}\n\treturn IndentDefault, nil\n}\n\n// EmitEncryptedFile returns the encrypted bytes of the yaml file corresponding to a\n// sops.Tree runtime object\nfunc (store *Store) EmitEncryptedFile(in sops.Tree) ([]byte, error) {\n\tbranches, err := stores.SerializeMetadata(in, stores.MetadataOpts{\n\t\tFlatten: stores.MetadataFlattenNone,\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 bytes of the yaml file corresponding to a\n// sops.TreeBranches runtime object","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/stores/yaml/store.go#L338-L374","documentation":"Error \"YAML Negative indentation not accepted\" thrown in getsops/sops.","triggerScenarios":"Thrown at stores/yaml/store.go:356 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"}