{"record":{"id":"50ef4800a3b18da4","repo":"plandex-ai/plandex","slug":"failed-to-read-the-file-s-v","errorCode":null,"errorMessage":"failed to read the file %s: %v","messagePattern":"failed to read the file (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_load.go","lineNumber":514,"sourceCode":"\n\t\t\t\t\t\t\tcurrentMapInputBatch[path] = res.mapContent\n\t\t\t\t\t\t\tmapSize += res.size\n\t\t\t\t\t\t\tmapInputShas[path] = res.shaVal\n\t\t\t\t\t\t\tmapInputTokens[path] = res.tokens\n\t\t\t\t\t\t\tmapInputSizes[path] = res.size\n\n\t\t\t\t\t\t\tif len(res.mapFilesTruncatedTooLarge) > 0 {\n\t\t\t\t\t\t\t\tmapFilesTruncatedTooLarge = append(mapFilesTruncatedTooLarge, res.mapFilesTruncatedTooLarge...)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif len(res.mapFilesSkippedAfterSizeLimit) > 0 {\n\t\t\t\t\t\t\t\tmapFilesSkippedAfterSizeLimit = append(mapFilesSkippedAfterSizeLimit, res.mapFilesSkippedAfterSizeLimit...)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if isImage {\n\t\t\t\t\t\t\tfileContent, err := os.ReadFile(path)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\terrCh <- fmt.Errorf(\"failed to read the file %s: %v\", path, err)\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontextMu.Lock()\n\t\t\t\t\t\t\tdefer contextMu.Unlock()\n\n\t\t\t\t\t\t\tloadContextReq = append(loadContextReq, &shared.LoadContextParams{\n\t\t\t\t\t\t\t\tContextType: shared.ContextImageType,\n\t\t\t\t\t\t\t\tName:        path,\n\t\t\t\t\t\t\t\tBody:        base64.StdEncoding.EncodeToString(fileContent),\n\t\t\t\t\t\t\t\tFilePath:    path,\n\t\t\t\t\t\t\t\tImageDetail: params.ImageDetail,\n\t\t\t\t\t\t\t\tAutoLoaded:  params.AutoLoaded,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfileContent, err := os.ReadFile(path)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\terrCh <- fmt.Errorf(\"failed to read the file %s: %v\", path, err)","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_load.go#L496-L532","documentation":"Fires when os.ReadFile (or equivalent) fails to read a file's content during a non-map context load. The file passed earlier size/existence checks but became unreadable — permissions, deletion race, or special file type.","triggerScenarios":"Thrown at app/cli/lib/context_load.go:514 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error (permissions vs not-found vs I/O)","Confirm the file still exists and is a regular file","Skip the unreadable file and continue loading the rest"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}