{"record":{"id":"fff0a7ffcbe58eb9","repo":"lima-vm/lima","slug":"unknown-provision-mode-q","errorCode":null,"errorMessage":"unknown provision mode %#q","messagePattern":"unknown provision mode %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cidata/cidata.go","lineNumber":580,"sourceCode":"\t\t// Boot commands are not treated as script files in cidata.iso.\n\t\t// Instead of that, they are stored in TemplateArgs.BootCmds then embedded in bootCmd field in user-data.\n\t\t// For Windows VM, there is no boot step where we can run commands.\n\t\tcase limatype.ProvisionModeBoot:\n\t\t\tcontinue\n\t\tcase limatype.ProvisionModeData:\n\t\t\tlayout = append(layout, iso9660util.Entry{\n\t\t\t\tPath:   fmt.Sprintf(\"provision.%s/%08d\", f.Mode, i),\n\t\t\t\tReader: strings.NewReader(*f.Content),\n\t\t\t})\n\t\tcase limatype.ProvisionModeYQ:\n\t\t\tlayout = append(layout, iso9660util.Entry{\n\t\t\t\tPath:   fmt.Sprintf(\"provision.%s/%08d\", f.Mode, i),\n\t\t\t\tReader: strings.NewReader(*f.Expression),\n\t\t\t})\n\t\tcase limatype.ProvisionModeAnsible:\n\t\t\tcontinue\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown provision mode %#q\", f.Mode)\n\t\t}\n\t}\n\n\treturn layout, nil\n}\n\nfunc GenerateWindowsISO(ctx context.Context, instDir, name string, instConfig *limatype.LimaYAML, udpDNSLocalPort, tcpDNSLocalPort, vsockPort int, virtioPort string, noCloudInit, rosettaEnabled, rosettaBinFmt bool) (string, error) {\n\targs, err := templateArgs(ctx, true, instDir, name, instConfig, udpDNSLocalPort, tcpDNSLocalPort, vsockPort, virtioPort, noCloudInit, rosettaEnabled, rosettaBinFmt)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := ValidateTemplateArgs(args); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// The generated password is used only for an initial setup.\n\t// After that, the password is overwritten.","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/cidata/cidata.go#L562-L598","documentation":"appendProvisionEntries (pkg/cidata/cidata.go:580) walks the instance's provision entries and only knows certain modes (script, task/YQ, ansible-skip, etc.). If a Provision.Mode value is not one of the recognized limatype.ProvisionMode constants, it returns this error instead of silently ignoring the entry.","triggerScenarios":"A lima.yaml `provision` entry has a `mode:` string that is not a valid provision mode constant (misspelled e.g. `mode: scripts`, `mode: ansible-playbook`, or hand-written YAML with an arbitrary mode).","commonSituations":"Typo in provision mode, editing YAML by hand without schema validation, or a config written for a newer/older Lima version using a mode this build does not know.","solutions":["Check the `mode:` field of every provision entry in lima.yaml","Use a valid mode: \"system\", \"user\", \"boot\", or remove the mode field to use the default","Validate the config with `limactl validate <file>` before starting"],"exampleFix":"# before\nprovision:\n  - mode: scripts\n    path: setup.sh\n# after\nprovision:\n  - mode: system\n    path: setup.sh","handlingStrategy":"validation","validationCode":"validModes := map[string]bool{\"\": true, \"system\": true, \"user\": true, \"boot\": true}\nfor _, p := range cfg.Provision {\n    if !validModes[p.Mode] {\n        return fmt.Errorf(\"unsupported provision mode %q\", p.Mode)\n    }\n}","typeGuard":null,"tryCatchPattern":"err := limactl.Start(ctx, instName)\nif err != nil && strings.Contains(err.Error(), \"unknown provision mode\") {\n    log.Fatalf(\"fix provision.mode in lima.yaml: %v\", err)\n}","preventionTips":["Only use documented provision modes: system, user, boot (or omit mode for default)","Run `limactl validate <lima.yaml>` after editing provision sections","Check the lima.yaml JSON schema (validated by editors with schema support) before saving"],"tags":["provision","config-validation","cidata"],"backgroundTag":"invalid-enum-value","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}