{"record":{"id":"17af46913de191dd","repo":"lima-vm/lima","slug":"field-arch-must-be-one-of-v-got-q","errorCode":null,"errorMessage":"field `arch` must be one of %v; got %#q","messagePattern":"field `arch` must be one of (.+?); got %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/limayaml/validate.go","lineNumber":64,"sourceCode":"\t\tif !versionutil.GreaterEqual(version.Version, *y.MinimumLimaVersion) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"template requires Lima version %#q; this is only %#q\", *y.MinimumLimaVersion, version.Version))\n\t\t}\n\t}\n\n\tswitch *y.OS {\n\tcase limatype.LINUX, limatype.DARWIN, limatype.FREEBSD:\n\tcase limatype.WINDOWS:\n\t\tif *y.VMType != limatype.QEMU {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"currently Windows guest is only supported on %#q; got %#q\", limatype.QEMU, *y.VMType))\n\t\t}\n\t\tif !slices.Contains([]limatype.Arch{limatype.X8664, limatype.AARCH64}, *y.Arch) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"currently Windows guest is only supported on [%#q, %#q]; got %#q\", limatype.X8664, limatype.AARCH64, *y.Arch))\n\t\t}\n\tdefault:\n\t\terrs = errors.Join(errs, fmt.Errorf(\"field `os` must be one of %#q; got %#q\", limatype.OSTypes, *y.OS))\n\t}\n\tif !slices.Contains(limatype.ArchTypes, *y.Arch) {\n\t\terrs = errors.Join(errs, fmt.Errorf(\"field `arch` must be one of %v; got %#q\", limatype.ArchTypes, *y.Arch))\n\t}\n\n\tif y.User.Shell != nil {\n\t\tshell := *y.User.Shell\n\t\tif *y.OS == limatype.WINDOWS {\n\t\t\tif !IsSupportedWindowsShell(shell) {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `user.shell` must be one of %v for Windows guest, got %#q\", SupportedWindowsShells, shell))\n\t\t\t}\n\t\t} else if !path.IsAbs(shell) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `user.shell` must be an absolute path, got %#q\", shell))\n\t\t}\n\t}\n\n\tif len(y.Images) == 0 {\n\t\terrs = errors.Join(errs, errors.New(\"field `images` must be set\"))\n\t}\n\tfor i, f := range y.Images {\n\t\terr := validateFileObject(f.File, fmt.Sprintf(\"images[%d]\", i))","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L46-L82","documentation":"The `arch` field must be one of the architectures Lima supports (x86_64, aarch64, riscv64, armv7l, etc. per limatype.ArchTypes). An invalid or misspelled architecture string fails validation in Validate().","triggerScenarios":"`arch` set to a value not in limatype.ArchTypes, e.g. `arch: x86`, `arch: amd64`, `arch: ARM64`, or empty string when defaults were not applied.","commonSituations":"Typos (x86 vs x86_64, amd64 vs x86_64); copying arch names from Docker rather than Lima; hand-merged template edits.","solutions":["Set `arch` to a supported value such as x86_64 or aarch64","Remove the `arch` line to let Lima default it to the host architecture","Run `limactl template validate` on the file before creating the instance"],"exampleFix":"// before\narch: amd64\n// after\narch: x86_64","handlingStrategy":"validation","validationCode":"func validArch(arch string) bool {\n\treturn slices.Contains(limatype.ArchTypes, limatype.Arch(arch))\n}","typeGuard":"func isSupportedArch(a limatype.Arch) bool {\n\treturn slices.Contains(limatype.ArchTypes, a)\n}","tryCatchPattern":"if err := limayaml.Validate(y, false); err != nil {\n\tif strings.Contains(err.Error(), \"field `arch` must be one of\") {\n\t\treturn fmt.Errorf(\"fix the arch field: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Use x86_64 (not amd64/x86) and aarch64 (not ARM64)","Omit arch to default to the host architecture","Lint templates with limactl template validate before committing"],"tags":["lima","arch-field","config-validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}