lima-vm/lima · error

unsupported plist type: %s

Error message

unsupported plist type: %s

What it means

The plist Value parser only understands the standard element names: array, dict, string, data, date, true, false, real, integer. Any other start element encountered where a plist value is expected causes Value.UnmarshalXML (pkg/plist/plist.go:149) to return "unsupported plist type: %s" with the unknown local name.

Source

Thrown at pkg/plist/plist.go:149

		if err != nil {
			return fmt.Errorf("invalid real value: %w", err)
		}
		v.Real = &f
		return nil
	case "integer":
		var txt string
		if err := dec.DecodeElement(&txt, &start); err != nil {
			return err
		}
		i, err := strconv.ParseInt(strings.TrimSpace(txt), 10, 64)
		if err != nil {
			return fmt.Errorf("invalid integer value: %w", err)
		}
		v.Integer = &i
		return nil

	default:
		return fmt.Errorf("unsupported plist type: %s", start.Name.Local)
	}
}

func (a *Array) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error {
	var vals []Value
	for {
		tok, err := dec.Token()
		if err != nil {
			if errors.Is(err, io.EOF) {
				*a = vals
				return nil
			}
			return err
		}
		switch t := tok.(type) {
		case xml.StartElement:
			var v Value
			if err := dec.DecodeElement(&v, &t); err != nil {

View on GitHub (pinned to dd909d0973)

Solutions

  1. Rename the element to a supported plist type (string, integer, real, boolean as <true/>/<false/>, date, data, array, dict)
  2. Check the %s in the error for the offending tag name and fix that location in the document
  3. Ensure the document has the proper <plist version="1.0"> root wrapping a single value element
  4. Validate the plist against the Apple property-list XML DTD before feeding it to the parser

Example fix

// before (fails)
<str>hello</str>
// after
<string>hello</string>
Defensive patterns

Strategy: validation

Validate before calling

var allowed = map[string]bool{
	"array": true, "dict": true, "string": true, "data": true,
	"date": true, "true": true, "false": true, "real": true, "integer": true,
}
func validatePlistTags(dec *xml.Decoder) error {
	for {
		tok, err := dec.Token()
		if err == io.EOF { return nil }
		if err != nil { return err }
		if se, ok := tok.(xml.StartElement); ok && !allowed[se.Name.Local] {
			return fmt.Errorf("unsupported plist type: %s", se.Name.Local)
		}
	}
}

Try / catch

var v plist.Value
if err := xml.Unmarshal(data, &v); err != nil {
	if strings.HasPrefix(err.Error(), "unsupported plist type: ") {
		tag := strings.TrimPrefix(err.Error(), "unsupported plist type: ")
		// log/fix the offending element name
	}
	return err
}

Prevention

When it happens

Trigger: Decoding a plist that contains a non-standard element where a value must appear, e.g. a top-level <plist> child that is misspelled (<str>, <bool>), nested unknown tags, or a <key> appearing directly inside a <dict>'s value position handled incorrectly.

Common situations: Hand-written plists using invented element names; XML from other config formats (e.g. Android/Apple property-list variants) fed to this parser; documents where the root <plist> wrapper is missing so a stray element is decoded as a value.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/72a2a5fd1f853129. Report an issue: GitHub.