{"record":{"id":"7b4da05d60cb62d5","repo":"glanceapp/glance","slug":"orderedmap-decoding-value-v","errorCode":null,"errorMessage":"orderedMap: decoding value: %v","messagePattern":"orderedMap: decoding value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/config.go","lineNumber":629,"sourceCode":"\tom.keys = make([]K, len(node.Content)/2)\n\tom.data = make(map[K]V, len(node.Content)/2)\n\n\tfor i := 0; i < len(node.Content); i += 2 {\n\t\tkeyNode := node.Content[i]\n\t\tvalueNode := node.Content[i+1]\n\n\t\tvar key K\n\t\tif err := keyNode.Decode(&key); err != nil {\n\t\t\treturn fmt.Errorf(\"orderedMap: decoding key: %v\", err)\n\t\t}\n\n\t\tif _, ok := om.data[key]; ok {\n\t\t\treturn fmt.Errorf(\"orderedMap: duplicate key %v\", key)\n\t\t}\n\n\t\tvar value V\n\t\tif err := valueNode.Decode(&value); err != nil {\n\t\t\treturn fmt.Errorf(\"orderedMap: decoding value: %v\", err)\n\t\t}\n\n\t\t(*om).keys[i/2] = key\n\t\t(*om).data[key] = value\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":611,"sourceCodeEnd":638,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/config.go#L611-L638","documentation":"The orderedYAMLMap unmarshaler failed while decoding a mapping value into the generic value type V. The value node did not match the expected structure for that entry — e.g. a scalar where a mapping was expected, a bad number, or a nested field with a wrong type. The underlying go-yaml error is chained via %v.","triggerScenarios":"A theme preset value that is a plain string instead of a properties mapping; a numeric field receiving a non-numeric scalar; any orderedYAMLMap value whose YAML node kind or scalar type is incompatible with the Go struct.","commonSituations":"Writing `presets: dark` instead of a nested mapping; typos in nested fields; version upgrades that changed the value schema of a config key; using quotes/strings where floats are expected.","solutions":["Read the chained go-yaml error for the exact field and line, then correct the value's type or structure","Compare the value block against the glance config documentation for that key","If the schema changed after an upgrade, migrate the config to the new format"],"exampleFix":"# before\ntheme:\n  presets:\n    my-theme: dark\n# after\ntheme:\n  presets:\n    my-theme:\n      color-scheme: dark\n","handlingStrategy":"validation","validationCode":"// Optional: strict-decode a copy of config to surface value type errors with line info\nvar probe struct{ Theme struct{ Presets yaml.Node `yaml:\"presets\"` } `yaml:\"theme\"` }\nif err := yaml.Unmarshal(cfg, &probe); err != nil { return err }\n// then inspect each preset value node Kind == yaml.MappingNode\n","typeGuard":null,"tryCatchPattern":"Catch and rethrow with the glance config path prepended; the chained go-yaml error already contains line/column for the bad value.","preventionTips":["Match value structure to docs (presets are mappings, not scalars)","Pin the glance version and keep configs in sync with that version's reference","Validate numeric fields are plain numbers, not quoted strings with units"],"tags":["yaml","config","type-mismatch"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}