{"record":{"id":"9cd65b505242429d","repo":"lima-vm/lima","slug":"w-archvariant-mismatch-expected-q-got-q","errorCode":null,"errorMessage":"%w: archVariant mismatch (expected %q, got %q)","messagePattern":"%w: archVariant mismatch \\(expected %q, got %q\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/instance/start.go","lineNumber":127,"sourceCode":"\t\t\tif img.Arch == *inst.Config.Arch {\n\t\t\t\ttargetVariant = img.Variant\n\t\t\t\ttargetArchVariant = img.ArchVariant\n\t\t\t\ttargetVariantSet = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif len(inst.Config.Images) == 0 {\n\t\t\treturn nil, errors.New(\"no images are configured (did you set --image-variant or --arch-variant to a value not present in the template?)\")\n\t\t}\n\t\terrs := make([]error, len(inst.Config.Images))\n\t\tfor i, f := range inst.Config.Images {\n\t\t\tif targetVariantSet && f.Variant != targetVariant {\n\t\t\t\terrs[i] = fmt.Errorf(\"%w: variant mismatch (expected %q, got %q)\", fileutils.ErrSkipped, targetVariant, f.Variant)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif targetVariantSet && f.ArchVariant != targetArchVariant {\n\t\t\t\terrs[i] = fmt.Errorf(\"%w: archVariant mismatch (expected %q, got %q)\", fileutils.ErrSkipped, targetArchVariant, f.ArchVariant)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif _, err := fileutils.DownloadFile(ctx, imagePath, f.File, true, \"the image\", *inst.Config.Arch, supportedImageFormats); err != nil {\n\t\t\t\terrs[i] = err\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif f.Kernel != nil {\n\t\t\t\t// ensure decompress kernel because vz expects it to be decompressed\n\t\t\t\tif _, err := fileutils.DownloadFile(ctx, kernel, f.Kernel.File, true, \"the kernel\", *inst.Config.Arch, nil); err != nil {\n\t\t\t\t\terrs[i] = err\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif f.Kernel.Cmdline != \"\" {\n\t\t\t\t\tif err := os.WriteFile(kernelCmdline, []byte(f.Kernel.Cmdline), 0o644); err != nil {\n\t\t\t\t\t\terrs[i] = err\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/instance/start.go#L109-L145","documentation":"Analogous to the variant mismatch, but for --arch-variant: each image whose ArchVariant field differs from the requested targetArchVariant is skipped with a fileutils.ErrSkipped \"archVariant mismatch\" error and collected in errs.","triggerScenarios":"`limactl create/start --arch-variant=<v>` (e.g. v8 vs v9 for arm64) where the template's images declare a different ArchVariant, or the field is unset while you request one.","commonSituations":"Requesting arm64 v9 images on templates that only publish v8 (or vice versa) on Apple Silicon / ARM servers; CI scripts pinning an arch-variant removed in a newer template.","solutions":["Check the template's images[].archVariant values and pass one that exists.","Drop --arch-variant to accept the default image for your arch.","Use an updated or alternative template that publishes the requested arch variant.","Verify your host arch actually needs the variant you requested."],"exampleFix":"// before\nlimactl create template://ubuntu-24.04 --arch-variant=9\n// after\nlimactl create template://ubuntu-24.04 --arch-variant=8  # or omit the flag","handlingStrategy":"validation","validationCode":"// confirm an image with the requested archVariant exists\nvar found bool\nfor _, img := range tmpl.Images {\n  if string(img.ArchVariant) == requestedArchVariant { found = true }\n}\nif !found { return fmt.Errorf(\"--arch-variant %q not offered by template\", requestedArchVariant) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the template's images[].archVariant values (e.g. v8/v9 for arm64)","Only set --arch-variant when you specifically need a CPU-level variant","Update templates/images when hardware changes (e.g. new ARM servers)","Fall back to omitting the flag on mismatch"],"tags":["images","arch-variant","arm64"],"backgroundTag":"no-matching-image-variant","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}