{"record":{"id":"6a545c35ed24be9f","repo":"mikefarah/yq","slug":"failed-to-read-ini-content-w","errorCode":null,"errorMessage":"failed to read INI content: %w","messagePattern":"failed to read INI content: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/decoder_ini.go","lineNumber":41,"sourceCode":"}\n\nfunc (dec *iniDecoder) Init(reader io.Reader) error {\n\t// Store the reader for use in Decode\n\tdec.reader = reader\n\tdec.finished = false\n\treturn nil\n}\n\nfunc (dec *iniDecoder) Decode() (*CandidateNode, error) {\n\t// If processing is already finished, return io.EOF\n\tif dec.finished {\n\t\treturn nil, io.EOF\n\t}\n\n\t// Read all content from the stored reader\n\tcontent, err := io.ReadAll(dec.reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read INI content: %w\", err)\n\t}\n\n\t// Parse the INI content\n\tloadOpts := ini.LoadOptions{\n\t\tPreserveSurroundedQuote: dec.prefs.PreserveSurroundedQuote,\n\t}\n\tcfg, err := ini.LoadSources(loadOpts, content)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse INI content: %w\", err)\n\t}\n\n\t// Create a root CandidateNode as a MappingNode (since INI is key-value based)\n\troot := &CandidateNode{\n\t\tKind:  MappingNode,\n\t\tTag:   \"!!map\",\n\t\tValue: \"\",\n\t}\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/decoder_ini.go#L23-L59","documentation":"io.ReadAll failed while the INI decoder was draining its input reader inside Decode (Init only stores the reader). This wraps the underlying I/O error — the content was never parsed, so the problem is with the stream (closed reader, broken pipe, encoding issue), not with INI syntax.","triggerScenarios":"Thrown at pkg/yqlib/decoder_ini.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the real I/O cause (file truncated, reader closed early)","Verify the input file exists and is readable before piping","If reading from stdin, make sure the upstream process did not fail mid-stream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}