{"record":{"id":"2ac56faa6c693d0d","repo":"alibaba/open-code-review","slug":"read-file-q-w","errorCode":null,"errorMessage":"read file %q: %w","messagePattern":"read file %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/diff/workspace_file.go","lineNumber":60,"sourceCode":"\t}\n\tif info.Mode()&os.ModeSymlink != 0 {\n\t\ttarget, err := os.Readlink(fullPath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read symlink %q: %w\", relPath, err)\n\t\t}\n\t\treturn []byte(target), nil\n\t}\n\n\tresolvedPath, err := filepath.EvalSymlinks(fullPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"resolve file %q: %w\", relPath, err)\n\t}\n\tif !pathutil.WithinBase(repoRoot, resolvedPath) {\n\t\treturn nil, fmt.Errorf(\"file path %q is outside repository\", relPath)\n\t}\n\tcontent, err := os.ReadFile(resolvedPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read file %q: %w\", relPath, err)\n\t}\n\treturn content, nil\n}\n","sourceCodeStart":42,"sourceCodeEnd":64,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/internal/diff/workspace_file.go#L42-L64","documentation":"Final os.ReadFile on the resolved, containment-checked path failed — permission denied, file deleted in a race, or an I/O error. All safety checks passed; this is a plain read failure wrapped with the repo-relative path and OS error.","triggerScenarios":"Thrown at internal/diff/workspace_file.go:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error (ENOENT/EACCES/ EISDIR etc.) to see why the read failed","Verify the file exists and is readable by the current user","If the working tree changed mid-review, refresh the change list and retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f","analyzedAt":"2026-09-02T02:08:09.116Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}