{"record":{"id":"0486b4db3afb24b1","repo":"plandex-ai/plandex","slug":"failed-to-get-map-file-details-for-s-v-0486b4","errorCode":null,"errorMessage":"failed to get map file details for %s: %v","messagePattern":"failed to get map file details for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":747,"sourceCode":"\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif !hasFileInfo {\n\t\t\t\t\t\t\tinnerUpdatesErrCh <- fmt.Errorf(\"failed to get map file info for %s - should already be set\", path)\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsize := fileInfo.Size()\n\t\t\t\t\t\tvar totalMapSize int64\n\t\t\t\t\t\tmu.Lock()\n\t\t\t\t\t\tprevTokens := ctx.MapTokens[path]\n\t\t\t\t\t\tprevSize := ctx.MapSizes[path]\n\t\t\t\t\t\tprevSha := ctx.MapShas[path]\n\t\t\t\t\t\ttotalMapSize = state.totalMapSize\n\t\t\t\t\t\tmu.Unlock()\n\n\t\t\t\t\t\tres, err := getMapFileDetails(path, size, totalMapSize)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tinnerUpdatesErrCh <- fmt.Errorf(\"failed to get map file details for %s: %v\", path, err)\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif res.shaVal == prevSha {\n\t\t\t\t\t\t\t// no change\n\t\t\t\t\t\t\tinnerUpdatesErrCh <- nil\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmu.Lock()\n\n\t\t\t\t\t\ttotalMapPaths++\n\n\t\t\t\t\t\tif totalMapPaths > shared.MaxContextMapPaths {\n\t\t\t\t\t\t\tif _, ok := mapFilesSkippedAfterSizeLimitSet[path]; !ok {\n\t\t\t\t\t\t\t\tmapFilesSkippedAfterSizeLimitSet[path] = true\n\t\t\t\t\t\t\t\tmapFilesSkippedAfterSizeLimit = append(mapFilesSkippedAfterSizeLimit, path)\n\t\t\t\t\t\t\t}","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L729-L765","documentation":"Raised when getMapFileDetails fails while recomputing a map file's SHA and token count. This helper reads/encodes the file content to decide whether the map entry is unchanged, and any read/encode/tokenize failure is wrapped with the file path.","triggerScenarios":"getMapFileDetails(path, size, totalMapSize) returns err during the map updates phase — typically because the file could not be read (permissions, deleted since stat, I/O error) or its content could not be hashed/tokenized.","commonSituations":"File deleted between the stat phase and details phase (TOCTOU race); read permission revoked; file locked by another process; disk I/O error on a failing drive.","solutions":["Check the wrapped %v cause; restore read permissions or recreate the missing file.","Re-run the refresh after concurrent modifications settle.","Rebuild the map context if the file set is stale relative to disk.","Check disk health (dmesg/smart) if EIO appears in the wrapped error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := os.ReadFile(path); err != nil {\n    return fmt.Errorf(\"map file %s unreadable before refresh: %w\", path, err)\n}","typeGuard":null,"tryCatchPattern":"if err := refreshMapCtx(ctx); err != nil {\n    if strings.Contains(err.Error(), \"failed to get map file details\") {\n        // wrapped cause names the real read/encode failure\n    }\n}","preventionTips":["Ensure mapped files remain readable throughout the refresh","Pause processes that delete/replace repo files mid-scan","Check disk health if I/O errors appear","Keep repo on local storage to avoid TOCTOU gaps"],"tags":["repo-map","filesystem","hashing"],"backgroundTag":"map-file-details-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}