{"record":{"id":"49f54c44e9aa165a","repo":"lima-vm/lima","slug":"field-msize-has-an-invalid-value-w","errorCode":null,"errorMessage":"field `msize` has an invalid value: %w","messagePattern":"field `msize` has an invalid value: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/limayaml/validate.go","lineNumber":159,"sourceCode":"\t\t\t}\n\t\t} else if !st.IsDir() {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].location` refers to a non-directory path: %#q: %w\", i, f.Location, err))\n\t\t}\n\n\t\tswitch *f.MountPoint {\n\t\tcase \"/\", \"/bin\", \"/dev\", \"/etc\", \"/home\", \"/opt\", \"/sbin\", \"/tmp\", \"/usr\", \"/var\":\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].mountPoint` must not be a system path such as /etc or /usr\", i))\n\t\t// home directory defined in \"cidata.iso:/user-data\"\n\t\tcase *y.User.Home:\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].mountPoint` is the reserved internal home directory %#q\", i, *y.User.Home))\n\t\t}\n\t\t// There is no tilde-expansion for guest filenames\n\t\tif strings.HasPrefix(*f.MountPoint, \"~\") {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].mountPoint` must not start with `~`\", i))\n\t\t}\n\n\t\tif _, err := units.RAMInBytes(*f.NineP.Msize); err != nil {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `msize` has an invalid value: %w\", err))\n\t\t}\n\t}\n\n\tif *y.SSH.LocalPort != 0 {\n\t\tif err := validatePort(\"ssh.localPort\", *y.SSH.LocalPort); err != nil {\n\t\t\terrs = errors.Join(errs, err)\n\t\t}\n\t}\n\n\tif y.MountType != nil {\n\t\tswitch *y.MountType {\n\t\tcase limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS, limatype.WSLMount:\n\t\tdefault:\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mountType` must be %#q or %#q or %#q, or %#q, got %#q\", limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS, limatype.WSLMount, *y.MountType))\n\t\t}\n\n\t\tif slices.Contains(y.MountTypesUnsupported, *y.MountType) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mountType` must not be one of %v (`mountTypesUnsupported`), got %#q\", y.MountTypesUnsupported, *y.MountType))","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L141-L177","documentation":"For each mount, the 9p `msize` option must be a valid byte-size string parseable by units.RAMInBytes (e.g. \"128KiB\", \"1M\"). An unparseable value is joined into the validation errors wrapped with this message. The field name is reported as bare `msize` even though it lives at mounts[i].ninep.msize.","triggerScenarios":"A mounts entry sets ninep.msize to an invalid string (e.g. `msize: 128 KB` with a space, or a non-numeric token) when Validate runs.","commonSituations":"Tuning 9p performance and copying an msize with wrong formatting from docs/blogs; using `512k` vs `512KiB` inconsistently; leaving placeholder text like `msize: <size>` in a template.","solutions":["Set ninep.msize to a valid size string such as `128KiB` (common recommendation is 128KiB or 1MiB)","Remove the msize field entirely to use the default","Re-run `limactl template validate` to confirm"],"exampleFix":"// before\nmounts:\n  - location: ~/data\n    ninep:\n      msize: 128 KB\n// after\nmounts:\n  - location: ~/data\n    ninep:\n      msize: 128KiB","handlingStrategy":"validation","validationCode":"const sizeRe = /^\\d+(\\.\\d+)?(KiB|MiB|GiB|B|K|M|G)?$/i\nfunction validMsize(v) { return v === undefined || (typeof v === 'string' && sizeRe.test(v) && !/\\s/.test(v)) }","typeGuard":"function isByteSize(v) { return typeof v === 'string' && /^\\d+(KiB|MiB|GiB|KB|MB|GB|B|K|M|G)?$/i.test(v) }","tryCatchPattern":"try { await limactl(['template','validate', file]) } catch (e) { if (/field `msize` has an invalid value/.test(e.message)) { fixOrRemoveMsize(); } else throw e }","preventionTips":["Use standard forms like 128KiB or 1MiB with no spaces","Omit ninep.msize to accept the default when unsure","Validate shared templates once before distribution"],"tags":["lima","config-validation","ninep","size"],"backgroundTag":"invalid-size-string","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}