{"record":{"id":"250b277a30bd83a7","repo":"coreybutler/nvm-windows","slug":"error-accessing-s-v","errorCode":null,"errorMessage":"error accessing %s: %v","messagePattern":"error accessing (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/upgrade/upgrade.go","lineNumber":966,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set file permissions: %v\", err)\n\t}\n\n\treturn nil\n}\n\n// copyDirContents copies all the contents (files and subdirectories) of a source directory to a destination directory.\nfunc copyDirContents(srcDir, dstDir string) error {\n\t// Ensure destination directory exists\n\terr := os.MkdirAll(dstDir, 0755)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create destination directory %s: %v\", dstDir, err)\n\t}\n\n\t// Walk through the source directory recursively\n\terr = filepath.Walk(srcDir, func(srcPath string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error accessing %s: %v\", srcPath, err)\n\t\t}\n\n\t\t// Construct the corresponding path in the destination directory\n\t\trelPath, err := filepath.Rel(srcDir, srcPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get relative path for %s: %v\", srcPath, err)\n\t\t}\n\n\t\tdstPath := filepath.Join(dstDir, relPath)\n\n\t\t// If it's a directory, ensure it's created in the destination\n\t\tif info.IsDir() {\n\t\t\treturn os.MkdirAll(dstPath, info.Mode())\n\t\t}\n\n\t\t// If it's a file, copy it\n\t\treturn copyFile(srcPath, dstPath)\n\t})","sourceCodeStart":948,"sourceCodeEnd":984,"githubUrl":"https://github.com/coreybutler/nvm-windows/blob/5b18223ca19ff50d707f35410dbc6bd440a9f74d/src/upgrade/upgrade.go#L948-L984","documentation":"copyDirContents walks the extracted assets tree with filepath.Walk, and this error is the walk callback's entry failure: Walk could not access a path under srcDir (read, lstat, or open failed). Within the upgrade this means the freshly extracted temp tree has an entry the process cannot read — AV interference, a broken zip entry, or the temp dir being pruned mid-walk.","triggerScenarios":"Antivirus locking or deleting extracted binaries while the walk reaches them; unzip produced entries with invalid names (zip-slip remnants, NUL bytes); concurrent temp cleanup removing files mid-walk; permissions on extracted files (written with ModePerm but ACL-restricted by policy).","commonSituations":"Real-time AV scanning extracted node.exe/nvm.exe; 'free up temp space' tools running during upgrade; corrupted download producing a partially valid zip.","solutions":["Exclude the nvm temp directories and NVM_HOME from antivirus scanning, then retry.","Stop temp-cleaning utilities during the upgrade window.","If it recurs, the downloaded zip may be corrupt — retry the whole upgrade to re-download and re-verify via checksum.","Manually inspect the nvm-upgrade-* temp dir for unreadable/oddly named entries to identify the interfering agent."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Report srcPath in the error (already included); retry the full upgrade once — walk-access failures from AV locks are usually transient. If persistent, inspect the temp tree for the named path to identify the interfering process.","preventionTips":["Exclude nvm temp + install dirs from real-time AV.","Pause temp cleaners during upgrades.","Treat repeated failures as a corrupt download: force re-download."],"tags":["filesystem","walk","antivirus","upgrade"],"backgroundTag":null,"analyzedSha":"5b18223ca19ff50d707f35410dbc6bd440a9f74d","analyzedAt":"2026-08-15T10:06:51.428Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}