{"record":{"id":"988416dcf8bd14bd","repo":"lima-vm/lima","slug":"field-probe-d-file-url-must-be-empty-during-va","errorCode":null,"errorMessage":"field `probe[%d].file.url` must be empty during validation (script should already be embedded)","messagePattern":"field `probe\\[(.+?)\\]\\.file\\.url` must be empty during validation \\(script should already be embedded\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/limayaml/validate.go","lineNumber":292,"sourceCode":"\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)\n\t\t\t}\n\t\t}\n\t}\n\tfor i, p := range y.Probes {\n\t\tif p.File != nil {\n\t\t\tif p.File.URL != \"\" {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `probe[%d].file.url` must be empty during validation (script should already be embedded)\", i))\n\t\t\t}\n\t\t\tif p.File.Digest != nil {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `probe[%d].file.digest` support is not yet implemented\", i))\n\t\t\t}\n\t\t}\n\t\tif p.Script != nil && !strings.HasPrefix(*p.Script, \"#!\") {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `probe[%d].script` must start with a '#!' line\", i))\n\t\t}\n\t\tswitch p.Mode {\n\t\tcase limatype.ProbeModeReadiness:\n\t\tdefault:\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `probe[%d].mode` can only be %#q\", i, limatype.ProbeModeReadiness))\n\t\t}\n\t}\n\tfor i, rule := range y.PortForwards {\n\t\tfield := fmt.Sprintf(\"portForwards[%d]\", i)\n\t\tif *rule.GuestIPMustBeZero && !rule.GuestIP.Equal(net.IPv4zero) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `%s.guestIPMustBeZero` can only be true when field `%s.guestIP` is 0.0.0.0\", field, field))","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L274-L310","documentation":"By the time config validation runs, probe `file` entries must have their URL content already downloaded and embedded into `probe.script`; Validate() therefore rejects any probe whose file.url is still set. This is an internal invariant: LoadYAML/ensureFile resolution should have replaced file URLs with embedded scripts before validation.","triggerScenarios":"Calling limayaml.Validate directly on a config that skipped the URL-resolution step (or a config where a probe.file.url remained unresolved), e.g. custom tooling that unmarshals lima.yaml and calls Validate without the pre-processing limactl performs.","commonSituations":"Programmatic use of the limayaml package without calling the loader pipeline; writing a probe with a file.url by hand in lima.yaml instead of an inline script.","solutions":["Use an inline `script` starting with `#!` in the probe instead of `file.url`","If building configs programmatically, run the standard load/resolve pipeline before Validate so file URLs are embedded","Clear the `file.url` field and set the script content directly"],"exampleFix":"// before\nprobes:\n- file:\n    url: https://example.com/healthcheck.sh\n// after\nprobes:\n- script: |\n    #!/bin/sh\n    curl -f http://localhost/health","handlingStrategy":"validation","validationCode":"for i, p := range cfg.Probes {\n    if p.File != nil && p.File.URL != \"\" {\n        return fmt.Errorf(\"probe[%d]: embed script content; file.url must not survive to validation\", i)\n    }\n}","typeGuard":"func probeHasRawURL(p limatype.Probe) bool {\n    return p.File != nil && p.File.URL != \"\"\n}","tryCatchPattern":null,"preventionTips":["Use inline `script` probes in hand-written lima.yaml","When using the limayaml package, go through the standard load pipeline before Validate","Do not copy file+url patterns from dependency/file-download sections into probes"],"tags":["config-validation","probe","lima-yaml"],"backgroundTag":"schema-validation-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}