{"record":{"id":"773506208fd7ceb4","repo":"lima-vm/lima","slug":"cache-did-not-contain-q","errorCode":null,"errorMessage":"cache did not contain %#q","messagePattern":"cache did not contain %#q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cacheutil/cacheutil.go","lineNumber":55,"sourceCode":"\terrs := make([]error, len(y.Containerd.Archives))\n\tfor i, f := range y.Containerd.Archives {\n\t\t// Skip downloading again if the file is already in the cache\n\t\tif created && f.Arch == *y.Arch && !downloader.IsLocal(f.Location) {\n\t\t\tpath, err := fileutils.CachedFile(f)\n\t\t\tif err == nil {\n\t\t\t\treturn path, nil\n\t\t\t}\n\t\t}\n\t\tpath, err := fileutils.DownloadFile(ctx, \"\", f, false, \"the nerdctl archive\", *y.Arch, nil)\n\t\tif err != nil {\n\t\t\terrs[i] = err\n\t\t\tcontinue\n\t\t}\n\t\tif path == \"\" {\n\t\t\tif downloader.IsLocal(f.Location) {\n\t\t\t\treturn f.Location, nil\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"cache did not contain %#q\", f.Location)\n\t\t}\n\t\treturn path, nil\n\t}\n\n\treturn \"\", fileutils.Errors(errs)\n}\n","sourceCodeStart":37,"sourceCodeEnd":62,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/cacheutil/cacheutil.go#L37-L62","documentation":"EnsureNerdctlArchiveCache downloads/validates the containerd (nerdctl) archive for the guest arch. DownloadFile returning an empty path with no error means the file was neither freshly downloaded nor found in the local cache; for a non-local (remote) Location that is an inconsistent state, so this error is thrown naming the URL that is missing from the cache.","triggerScenarios":"lima.yaml enables containerd (system or user) with a remote containerd.archives entry for the current arch; fileutils.DownloadFile returns path==\"\" (cache miss without download, e.g. cache index desync) and the location is not a local file, so the function cannot return any path.","commonSituations":"Corrupted or partially deleted ~/.lima/_cache downloads directory; URL whose cached file was removed between checks; misconfigured archive URL that redirects oddly; disk-full preventing the cache write while still returning an empty path on some paths.","solutions":["Re-run the command (e.g. `limactl start`); the next attempt re-downloads the archive","Clear the cache dir (~/.lima/_cache or ${LIMA_HOME}/_cache) and retry so the archive is fetched fresh","Verify the containerd.archives URL for your arch is reachable (curl -I the Location) and matches your GOOS/GOARCH","If using a local file, make sure Location points to an existing path — local paths are returned directly, so this error implies the remote path was taken"],"exampleFix":"# before: corrupt cache\nls ~/.lima/_cache\n# after: purge and retry\nrm -rf ~/.lima/_cache\nlimactl start default","handlingStrategy":"retry","validationCode":"// Go: verify the archive URL for the current arch is set and reachable\nfor _, f := range y.Containerd.Archives {\n    if f.Arch == *y.Arch {\n        resp, err := http.Head(f.Location)\n        if err != nil || resp.StatusCode >= 400 {\n            // fix the URL or clear ~/.lima/_cache before starting\n        }\n    }\n}\n","typeGuard":null,"tryCatchPattern":"path, err := cacheutil.EnsureNerdctlArchiveCache(ctx, y, created)\nif err != nil {\n    if strings.Contains(err.Error(), \"cache did not contain\") {\n        os.RemoveAll(filepath.Join(limainstance.LimaHome(), \"_cache\"))\n        path, err = cacheutil.EnsureNerdctlArchiveCache(ctx, y, false)\n    }\n    if err != nil { return err }\n}\n","preventionTips":["Keep a containerd.archives entry matching your machine arch (aarch64 vs x86_64)","Don't delete files under ${LIMA_HOME}/_cache while instances are being created","Use pinned, reachable archive URLs; test with curl -I before putting them in lima.yaml","Monitor free disk space — full disks corrupt cache downloads"],"tags":["cache","download","containerd","nerdctl"],"backgroundTag":"cache-miss","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}