{"record":{"id":"6aece544300639b0","repo":"plandex-ai/plandex","slug":"failed-to-get-map-file-info-for-s-should-alread","errorCode":null,"errorMessage":"failed to get map file info for %s - should already be set","messagePattern":"failed to get map file info for (.+?) - should already be set","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":732,"sourceCode":"\t\t\t\t\t\tvar fileInfo os.FileInfo\n\n\t\t\t\t\t\tvar hasFileInfo bool\n\t\t\t\t\t\tmu.Lock()\n\t\t\t\t\t\tif _, ok := mapFileInfoByPath[path]; ok {\n\t\t\t\t\t\t\tfileInfo = mapFileInfoByPath[path]\n\t\t\t\t\t\t\thasFileInfo = true\n\t\t\t\t\t\t} else if _, ok := mapFileRemovedByPath[path]; ok {\n\t\t\t\t\t\t\tremoved = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmu.Unlock()\n\n\t\t\t\t\t\tif removed {\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\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","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L714-L750","documentation":"An internal-consistency error: after the existence-check phase, each map file must have cached os.FileInfo ('should already be set'). If the updates phase finds hasFileInfo false, the library raises this error rather than proceeding with a nil FileInfo. It signals a broken assumption between the two concurrent phases, not a disk problem.","triggerScenarios":"In the updates goroutine for a map file, hasFileInfo is false — i.e. the existence phase neither produced a FileInfo nor removed the file, so the fileInfo variable was never populated when the updates phase ran.","commonSituations":"Race where the file is deleted after the existence check but before the updates phase reads it, combined with a timing window that skips the removal path; a bug or interrupted earlier phase; unusual filesystems whose Stat succeeds once then fails on re-check.","solutions":["Simply re-run the context refresh — this is typically transient.","If reproducible, remove and re-add the map context to rebuild its file list.","Check for processes deleting/recreating files concurrently during refresh.","Report as a library bug if it reproduces on a stable filesystem with no concurrent writers."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := refreshMapCtx(ctx); err != nil {\n    if strings.Contains(err.Error(), \"should already be set\") {\n        // transient internal-state race: retry the refresh once\n    }\n}","preventionTips":["Re-run the refresh when this appears — it is typically transient","Avoid concurrent deletions of mapped files during refresh","Rebuild the map context if it recurs on stable storage","Report persistent occurrences as a library bug"],"tags":["repo-map","concurrency","internal-state"],"backgroundTag":"missing-file-info","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"}