{"record":{"id":"229e0cb6d5ad52a0","repo":"mikefarah/yq","slug":"failed-to-parse-ini-content-w","errorCode":null,"errorMessage":"failed to parse INI content: %w","messagePattern":"failed to parse INI content: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/decoder_ini.go","lineNumber":50,"sourceCode":"func (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\n\t// Process each section in the INI file\n\tfor _, section := range cfg.Sections() {\n\t\tsectionName := section.Name()\n\n\t\tif sectionName == ini.DefaultSection {\n\t\t\t// For the default section, add key-value pairs directly to the root node\n\t\t\tfor _, key := range section.Keys() {\n\t\t\t\tkeyName := key.Name()\n\t\t\t\tkeyValue := key.String()","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/decoder_ini.go#L32-L68","documentation":"gopkg.in/ini's LoadSources rejected the input bytes as unparseable INI. The decoder forwards the library's error with %w, so the wrapped text names the actual syntax fault (e.g. missing section header delimiter, unbalanced quotes given the PreserveSurroundedQuote option, or key/value lines without a '=' delimiter).","triggerScenarios":"Thrown at pkg/yqlib/decoder_ini.go:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the INI syntax reported in the wrapped error (delimiters, quoting, section headers)","Check that key/value pairs use '=' or ':' separators","Confirm the file is INI and not a similar format like TOML or .env","Review ini.LoadOptions (e.g. PreserveSurroundedQuote) if quotes are intentional"],"exampleFix":null,"handlingStrategy":"validation","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"}