{"record":{"id":"424db1dd4f563203","repo":"lima-vm/lima","slug":"field-provision-d-playbook-refers-to-an-inacce","errorCode":null,"errorMessage":"field `provision[%d].playbook` refers to an inaccessible path: %#q: %w","messagePattern":"field `provision\\[(.+?)\\]\\.playbook` refers to an inaccessible path: %#q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/limayaml/validate.go","lineNumber":267,"sourceCode":"\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `provision[%d].path` can only be set when mode is %#q, or %#q\", i, limatype.ProvisionModeData, limatype.ProvisionModeYQ))\n\t\t\t}\n\t\t\tif p.Permissions != nil {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `provision[%d].permissions` can only be set when mode is %#q, or %#q\", i, limatype.ProvisionModeData, limatype.ProvisionModeYQ))\n\t\t\t}\n\t\t\tif p.Format != nil {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `provision[%d].format` can only be set when mode is %#q\", i, limatype.ProvisionModeYQ))\n\t\t\t}\n\t\t}\n\t\tif p.Playbook != \"\" {\n\t\t\tif p.Mode != limatype.ProvisionModeAnsible {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `provision[%d].playbook can only be set when mode is %#q\", i, limatype.ProvisionModeAnsible))\n\t\t\t}\n\t\t\tif p.Script != nil && *p.Script != \"\" {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `provision[%d].script must be empty if playbook is set\", i))\n\t\t\t}\n\t\t\tplaybook := p.Playbook\n\t\t\tif _, err := os.Stat(playbook); err != nil {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `provision[%d].playbook` refers to an inaccessible path: %#q: %w\", i, playbook, err))\n\t\t\t}\n\t\t\tlogrus.Warnf(\"provision mode %#q is deprecated, use `ansible-playbook %#q` instead\", limatype.ProvisionModeAnsible, playbook)\n\t\t}\n\t\tif p.Script != nil {\n\t\t\tif strings.Contains(*p.Script, \"LIMA_CIDATA\") {\n\t\t\t\tlogrus.Warn(\"provisioning scripts should not reference the LIMA_CIDATA variables\")\n\t\t\t}\n\t\t}\n\t}\n\tneedsContainerdArchives := (y.Containerd.User != nil && *y.Containerd.User) || (y.Containerd.System != nil && *y.Containerd.System)\n\tif needsContainerdArchives {\n\t\tif len(y.Containerd.Archives) == 0 {\n\t\t\terrs = errors.Join(errs, errors.New(\"field `containerd.archives` must be provided\"))\n\t\t}\n\t\tfor i, f := range y.Containerd.Archives {\n\t\t\terr := validateFileObject(f, fmt.Sprintf(\"containerd.archives[%d]\", i))\n\t\t\tif err != nil {\n\t\t\t\terrs = errors.Join(errs, err)","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L249-L285","documentation":"When a provision entry has `playbook` set, Validate() stats the playbook path on the host to confirm it is readable. If os.Stat fails (missing file, typo, permission issue), this error is thrown wrapping the underlying os error. It only applies to entries where playbook is configured.","triggerScenarios":"Calling limactl validate/start/edit/restart/apply with a provision[i].playbook path that does not exist, is a broken symlink, or is not readable by the current user.","commonSituations":"Relative path resolved from the wrong working directory; playbook file not committed or deleted; renamed playbook without updating lima.yaml; using a path inside the VM that only exists on the host (or vice versa).","solutions":["Fix the playbook path in lima.yaml to point to an existing file, relative to the lima.yaml location or absolute","Run `ls` on the path as the same user running limactl to confirm access","Replace the playbook provision with a plain `mode: dependency`+script or an `ansible-playbook` shell provision if no local playbook file exists"],"exampleFix":"// before\nprovision:\n- mode: ansible\n  playbook: playbooks/syte.yaml\n// after\nprovision:\n- mode: ansible\n  playbook: playbooks/site.yaml","handlingStrategy":"validation","validationCode":"for i, p := range cfg.Provision {\n    if p.Playbook != \"\" {\n        if _, err := os.Stat(p.Playbook); err != nil {\n            return fmt.Errorf(\"provision[%d].playbook: %w\", i, err)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep playbooks next to lima.yaml and reference them relatively","Commit playbook files alongside the lima.yaml in the repo","Stat the path in CI before running limactl start"],"tags":["config-validation","provision","ansible","file-path"],"backgroundTag":"file-not-found","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}