{"record":{"id":"85a816ceca07fa57","repo":"lima-vm/lima","slug":"configuration-is-nil-85a816","errorCode":null,"errorMessage":"configuration is nil","messagePattern":"configuration is nil","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/vz_driver_darwin.go","lineNumber":262,"sourceCode":"\t\t\tcontent, err := bootLinuxFS.ReadFile(entryPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tscripts[entryPath] = content\n\t\t}\n\t}\n\n\treturn scripts, nil\n}\n\nfunc (l *LimaVzDriver) Validate(_ context.Context) error {\n\treturn validateConfig(l.Instance.Config)\n}\n\nfunc validateConfig(cfg *limatype.LimaYAML) error {\n\tif cfg == nil {\n\t\treturn errors.New(\"configuration is nil\")\n\t}\n\tmacOSProductVersion, err := osutil.ProductVersion()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif macOSProductVersion.LessThan(*semver.New(\"13.0.0\")) {\n\t\treturn errors.New(\"VZ driver requires macOS 13 or higher to run\")\n\t}\n\tif runtime.GOARCH == \"amd64\" && macOSProductVersion.LessThan(*semver.New(\"15.5.0\")) {\n\t\tlogrus.Warnf(\"vmType %s: On Intel Mac, macOS 15.5 or later is required to run Linux 6.12 or later. \"+\n\t\t\t\"Update macOS, or change vmType to `qemu` if the VM does not start up. (https://github.com/lima-vm/lima/issues/3334)\",\n\t\t\t*cfg.VMType)\n\t}\n\tif cfg.MountType != nil && *cfg.MountType == limatype.NINEP {\n\t\treturn fmt.Errorf(\"field `mountType` must be %#q or %#q for VZ driver , got %#q\", limatype.REVSSHFS, limatype.VIRTIOFS, *cfg.MountType)\n\t}\n\tif cfg.TPM != nil && *cfg.TPM {\n\t\treturn errors.New(\"field `tpm` is not supported on VZ driver\")","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/vz_driver_darwin.go#L244-L280","documentation":"validateConfig requires a non-nil LimaYAML config before validating driver requirements. The VZ driver was asked to validate a nil configuration, meaning the instance config was never loaded or filled.","triggerScenarios":"LimaVzDriver.Validate() is called (via Validate or fillConfig) with l.Instance.Config == nil, i.e. the instance YAML was not loaded before driver validation.","commonSituations":"Programming/internal error: instance created without loading its config; corrupted instance metadata in LIMA_HOME; calling the driver API directly without a loaded config.","solutions":["Ensure the instance config is loaded before creating the driver (load the limayaml first)","Recreate the instance if its metadata in ~/.lima is corrupted: `limactl delete <name> --force`","If calling the API programmatically, pass a valid *limatype.LimaYAML","Report to lima-vm/lima if hit through normal `limactl start` usage — it indicates an internal bug"],"exampleFix":"// before\ndriver.Validate(ctx) // cfg is nil\n// after\ncfg, err := limayaml.Load(yamlPath)\nif err != nil { return err }\ninstance.Config = cfg\ndriver.Validate(ctx)","handlingStrategy":"type-guard","validationCode":"if cfg == nil {\n    return errors.New(\"instance config must be loaded before driver validation\")\n}","typeGuard":"func hasConfig(inst *limatype.Instance) bool {\n    return inst != nil && inst.Config != nil\n}","tryCatchPattern":"if err := validate(); err != nil && err.Error() == \"configuration is nil\" {\n    // load the instance config, attach it, and call validate again\n}","preventionTips":["Always load limayaml before instantiating the driver","If scripting the API, never call driver methods on partially built instances","Treat this error as an internal bug if seen via normal limactl usage and report it"],"tags":["config-validation","vz","internal"],"backgroundTag":"nil-config","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}