{"record":{"id":"f6a776460b0a9835","repo":"lima-vm/lima","slug":"failed-to-validate-the-instance-yaml-after-filling-f6a776","errorCode":null,"errorMessage":"failed to validate the instance YAML after filling defaults: %w","messagePattern":"failed to validate the instance YAML after filling defaults: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/snapshot/snapshot.go","lineNumber":55,"sourceCode":"\t}\n\treturn limaDriver.ApplySnapshot(ctx, tag)\n}\n\nfunc List(ctx context.Context, inst *limatype.Instance) (string, error) {\n\tlimaDriver, err := createConfiguredDriver(ctx, inst)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to create driver instance: %w\", err)\n\t}\n\treturn limaDriver.ListSnapshots(ctx)\n}\n\nfunc createConfiguredDriver(ctx context.Context, inst *limatype.Instance) (*driver.ConfiguredDriver, error) {\n\tlimaDriver, err := driverutil.CreateConfiguredDriver(ctx, inst, 0)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create driver instance: %w\", err)\n\t}\n\tif err := limayaml.Validate(inst.Config, true); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to validate the instance YAML after filling defaults: %w\", err)\n\t}\n\treturn limaDriver, nil\n}\n","sourceCodeStart":37,"sourceCodeEnd":59,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/snapshot/snapshot.go#L37-L59","documentation":"After successfully building the driver, createConfiguredDriver re-validates the instance's fully-defaulted YAML with limayaml.Validate(inst.Config, true). If the configuration is invalid even after defaults are filled in (contradictory or out-of-range fields), the snapshot operation aborts with this message. It guards against running snapshot operations on configs that the driver layer would silently mishandle.","triggerScenarios":"Any snapshot operation (Del/Save/Load/List, i.e. limactl snapshot save/apply/delete/list) on an instance whose stored lima.yaml fails schema/range validation after defaults: e.g. invalid vmType value, conflicting cpu/memory settings, deprecated fields that no longer validate, or a hand-edited YAML with a bad enum value that the driver lookup tolerated but validation rejects.","commonSituations":"Manual edits to ~/.lima/<instance>/lima.yaml (typo'd enum, negative CPU count, invalid architecture); configs written by an older Lima version that no longer pass the stricter validator after upgrade; cloner/external tooling that mutated the instance YAML; merging templates with incompatible fields.","solutions":["Read the wrapped validation detail; it names the exact offending field — fix that field in ~/.lima/<instance>/lima.yaml","Run limactl validate (or limayaml.Load+Validate locally) on the instance YAML to see all validation errors at once","Restore the YAML to a known-good state: re-edit, or recreate the instance and re-apply your customizations","If it broke after a Lima upgrade, consult release notes for removed/renamed fields and migrate the config accordingly"],"exampleFix":"// before (instance lima.yaml)\ncpus: -2\n// after\n// lima.yaml\ncpus: 4","handlingStrategy":"validation","validationCode":"if err := limayaml.Validate(inst.Config, true); err != nil {\n\treturn fmt.Errorf(\"instance YAML invalid, fix before snapshot ops: %w\", err)\n}","typeGuard":"func validInstanceConfig(inst *limatype.Instance) bool {\n\treturn inst != nil && inst.Config != nil && limayaml.Validate(inst.Config, true) == nil\n}","tryCatchPattern":null,"preventionTips":["Run limayaml.Validate (or limactl validate) on instance YAML after any manual edit or tooling that rewrites it","Read the wrapped validation message — it names the exact invalid field and expected values","Migrate configs flagged deprecated when upgrading Lima instead of leaving old fields in place","Avoid merging template fragments blindly; re-validate the merged result before snapshot operations"],"tags":["validation","yaml","snapshot","config"],"backgroundTag":"schema-validation-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}