getsops/sops · error

Duplicate value

Error message

Duplicate value

What it means

Error "Duplicate value" thrown in getsops/sops.

Source

Thrown at stores/flatten.go:105

			next, ok = root.subkeys[t.key]
			if !ok {
				next = &node{}
				root.subkeys[t.key] = next
			}
		case listToken:
			if root.indices == nil {
				root.indices = make(map[int]*node)
			}
			next, ok = root.indices[t.position]
			if !ok {
				next = &node{}
				root.indices[t.position] = next
			}
		}
		root = next
	}
	if root.value != nil {
		return fmt.Errorf("Duplicate value")
	}
	root.value = value
	return nil
}

func b2i(value bool) int {
	if value {
		return 1
	}
	return 0
}

func convert(root *node) (interface{}, error) {
	hasValue := root.value != nil
	hasSubkey := len(root.subkeys) > 0
	hasIndex := len(root.indices) > 0
	if b2i(hasValue)+b2i(hasSubkey)+b2i(hasIndex) > 1 {
		return nil, fmt.Errorf("Type mismatch")

View on GitHub (pinned to 13442bb981)

When it happens

Trigger: Thrown at stores/flatten.go:105 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getsops/sops@13442bb981 (2026-09-01). Data as JSON: /api/errors/e1714810e5ca1e3f. Report an issue: GitHub.