Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm 8.9.0 broken for windows dev drivers (ReFS) #7186

Closed
2 of 4 tasks
atsjo opened this issue Oct 10, 2023 · 21 comments · Fixed by #7190 or pnpm/reflink#2
Closed
2 of 4 tasks

pnpm 8.9.0 broken for windows dev drivers (ReFS) #7186

atsjo opened this issue Oct 10, 2023 · 21 comments · Fixed by #7190 or pnpm/reflink#2

Comments

@atsjo
Copy link

atsjo commented Oct 10, 2023

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.9.0

Which area(s) of pnpm are affected? (leave empty if unsure)

Store

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

running pnpm i: (sometimes fails with below message)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Downloading registry.npmjs.org/firebase/10.4.0: 6,06 MB/6,06 MB, done
Downloading registry.npmjs.org/@firebase/firestore/4.2.0: 6,52 MB/6,52 MB, done
Downloading registry.npmjs.org/googleapis/126.0.1: 10,28 MB/10,28 MB, done
Downloading registry.npmjs.org/typescript/5.1.6: 7,15 MB/7,15 MB, done
Progress: resolved 1655, reused 0, downloaded 1573, added 1655, done
 ERR_PNPM_BAD_PACKAGE_JSON  D:\repos\teve-no\task4s\node_modules\.pnpm\webpack@5.88.2_esbuild@0.19.4\node_modules\webpack\package.json: Unexpected token '', ""... is not valid JSON while parsing '' in node_modules\.pnpm\webpack@5.88.2_esbuild@0.19.4\node_modules\webpack\package.json

if I get past error above, I can run pnpm store status: (it reports multiple changed packages)

PS D:\repos\teve-no\task4s> pnpm store status
 ERR_PNPM_MODIFIED_DEPENDENCY  Packages in the store have been mutated

These packages are modified:
registry.npmjs.org/@babel/helper-define-polyfill-provider/0.4.2(@babel/core@7.22.9)
registry.npmjs.org/@babel/helper-module-transforms/7.23.0(@babel/core@7.22.5)
registry.npmjs.org/@babel/helper-module-transforms/7.23.0(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.22.15(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-syntax-class-properties/7.12.13(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-syntax-import-assertions/7.22.5(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-class-static-block/7.22.11(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-classes/7.22.15(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-computed-properties/7.22.5(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-transform-modules-commonjs/7.23.0(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-transform-modules-commonjs/7.23.0(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-modules-systemjs/7.23.0(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-new-target/7.22.5(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/7.22.11(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-transform-numeric-separator/7.22.11(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-regenerator/7.22.10(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-reserved-words/7.22.5(@babel/core@7.23.0)
registry.npmjs.org/@babel/plugin-transform-typeof-symbol/7.22.5(@babel/core@7.23.0)
registry.npmjs.org/css-tree/2.2.1
registry.npmjs.org/css-tree/2.3.1
registry.npmjs.org/mdn-data/2.0.30
registry.npmjs.org/terser-webpack-plugin/5.3.9(esbuild@0.19.4)(webpack@5.88.2)
registry.npmjs.org/webpack/5.88.2(esbuild@0.18.17)
registry.npmjs.org/webpack/5.88.2(esbuild@0.19.4)

if I run pnpm store prune it also clears all packages in store (like there is no ref)

Describe the Bug

The performance improvements introduced for Windows Dev Drives in 8.9.0 seems to have broken it. It works fine on dev drives with 8.8.0, but I get multiple errors as described in the Repro steps above with 8.9.0. I tried with node 18.18.0 and 20.8.0

Expected Behavior

It works as for 8.8.0 (verified that also pruning works correctly)

Which Node.js version are you using?

18.18.0 and 20.8.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

@zkochan
Copy link
Member

zkochan commented Oct 10, 2023

cc @nachoaldamav

@nachoaldamav
Copy link
Contributor

@atsjo Do you have an example package.json I can check? I tried it my self and I don't have any error

PS D:\code\alotta> pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +1316
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1316, reused 1316, downloaded 0, added 1316, done

dependencies:
+ animate.less 2.2.0
+ autoprefixer 10.4.16
+ babel-core 6.26.3
+ babel-eslint 10.1.0
+ babel-loader 8.3.0
+ babel-plugin-lodash 3.3.4
+ babel-plugin-module-resolver 4.1.0
+ babel-plugin-transform-decorators-legacy 1.3.5
+ babel-plugin-transform-runtime 6.23.0
+ babel-polyfill 6.26.0
+ babel-preset-es2015 6.24.1
+ babel-preset-react 6.24.1
+ babel-preset-react-hmre 1.1.1
+ babel-preset-stage-1 6.24.1
+ babel-runtime 6.26.0
+ clean-webpack-plugin 4.0.0
+ core-decorators 0.20.0
+ css-loader 6.8.1
+ css-mqpacker 7.0.0
+ cssnano 5.1.15
+ custom-event-polyfill 1.0.7
+ draft-js 0.11.7
+ ejs 3.1.9
+ eslint 8.51.0
+ eslint-config-airbnb 19.0.4
+ eslint-import-resolver-webpack 0.13.7
+ eslint-plugin-import 2.28.1
+ eslint-plugin-jsx-a11y 6.7.1
+ eslint-plugin-react 7.33.2
+ express 4.18.2
+ express-http-proxy 1.6.3
+ font-awesome 4.7.0
+ fready 1.0.0
+ glob 8.1.0
+ gulp 4.0.2
+ gulp-concat 2.6.1
+ gulp-csslint 1.0.1
+ gulp-cssnano 2.1.3
+ gulp-eol 0.2.0
+ gulp-less 5.0.0
+ gulp-livereload 4.0.2
+ gulp-minify-css 1.2.4
+ gulp-postcss 9.0.1
+ gulp-rename 2.0.0
+ gulp-util 3.0.8
+ happypack 5.0.1
+ highcharts 10.3.3
+ highcharts-solid-gauge 0.1.7
+ history 5.3.0
+ howler 2.2.4
+ imports-loader 4.0.1
+ jquery 3.7.1
+ jquery-ui 1.13.2
+ js-cookie 3.0.5
+ json-loader 0.5.7
+ leftpad 0.0.1
+ less 4.2.0
+ lesshat 4.1.0
+ lodash 4.17.21
+ medium-draft 0.5.18
+ mobx 6.10.2
+ mobx-react 7.6.0
+ moment 2.29.4
+ moment-range 4.0.2
+ moment-timezone 0.5.43
+ password-policy 0.0.3
+ postcss-reporter 7.0.5
+ progress 2.0.3
+ qs 6.11.2
+ raw-loader 4.0.2
+ rc-slider 10.3.0
+ react 18.2.0
+ react-addons-css-transition-group 15.6.2
+ react-addons-shallow-compare 15.6.3
+ react-dnd 16.0.1
+ react-dnd-html5-backend 16.0.1
+ react-dom 18.2.0
+ react-draft-wysiwyg 1.15.0
+ react-dropzone 14.2.3
+ react-grid-layout 1.4.2
+ react-highcharts 16.1.0
+ react-hot-loader 4.13.0
+ react-input-calendar 0.5.4
+ react-lazyload 3.2.0
+ react-measure 2.5.2
+ react-mixin 5.0.0
+ react-responsive 9.0.0-beta.10
+ react-responsive-tabs 4.4.3
+ react-router 6.16.0
+ react-router-dom 6.16.0
+ react-select-plus 1.0.0-rc.3.patch12
+ react-skylight 0.5.1
+ react-sortablejs 6.1.4
+ react-tappable 1.0.4
+ react-tooltip 4.2.21
+ react-virtualized 9.22.5
+ react-waypoint 10.3.0
+ sortablejs 1.15.0
+ style-loader 3.3.3
+ stylelint 14.16.1
+ superagent 8.1.2
+ uglify-js 3.17.4
+ uuid 8.3.2
+ verge 1.10.2
+ webpack-bundle-analyzer 4.9.1
+ webpack-hot-middleware 2.25.4
+ webpack-notifier 1.15.0
+ webpack-split-by-path 2.0.0
+ whatwg-fetch 3.6.19

devDependencies:
+ nan-as 1.6.1

Done in 23.1s

@atsjo
Copy link
Author

atsjo commented Oct 10, 2023

{ 
   "dependencies": { 
     "@angular/animations": "16.2.8", 
     "@angular/cdk": "16.2.7", 
     "@angular/common": "16.2.8", 
     "@angular/compiler": "16.2.8", 
     "@angular/core": "16.2.8", 
     "@angular/fire": "7.6.1", 
     "@angular/forms": "16.2.8", 
     "@angular/material": "16.2.7", 
     "@angular/platform-browser": "16.2.8", 
     "@angular/platform-browser-dynamic": "16.2.8", 
     "@angular/router": "16.2.8", 
     "@azure/msal-node": "2.2.0", 
     "@microsoft/microsoft-graph-client": "3.0.7", 
     "@ngneat/elf": "2.4.0", 
     "@ngneat/elf-devtools": "1.3.0", 
     "@ngneat/elf-entities": "4.5.0", 
     "@ngneat/elf-persist-state": "1.1.6", 
     "@ngneat/elf-requests": "1.9.2", 
     "angular-calendar": "0.31.0", 
     "calendar-utils": "0.10.4", 
     "date-fns": "2.30.0", 
     "fast-json-patch": "3.1.1", 
     "firebase": "10.4.0", 
     "firebase-admin": "11.11.0", 
     "firebase-functions": "4.4.1", 
     "gaxios": "6.1.1", 
     "google-auth-library": "9.1.0", 
     "googleapis": "126.0.1", 
     "idb-keyval": "6.2.1", 
     "immer": "10.0.3", 
     "lru-cache": "10.0.1", 
     "rxjs": "7.8.1", 
     "tslib": "^2.6.2", 
     "zone.js": "0.13.3" 
   }, 
   "devDependencies": { 
     "@angular-devkit/build-angular": "16.2.5", 
     "@angular-devkit/core": "16.2.5", 
     "@angular-devkit/schematics": "16.2.5", 
     "@angular-eslint/eslint-plugin": "16.2.0", 
     "@angular-eslint/eslint-plugin-template": "16.2.0", 
     "@angular-eslint/template-parser": "16.2.0", 
     "@angular/cli": "16.2.5", 
     "@angular/compiler-cli": "16.2.8", 
     "@angular/language-service": "16.2.8", 
     "@firebase/rules-unit-testing": "3.0.1", 
     "@google-cloud/functions-framework": "3.3.0", 
     "@invertase/firestore-stripe-payments": "0.0.7", 
     "@microsoft/microsoft-graph-types": "2.38.0", 
     "@nx/angular": "16.10.0", 
     "@nx/esbuild": "16.10.0", 
     "@nx/eslint-plugin": "16.10.0", 
     "@nx/jest": "16.10.0", 
     "@nx/js": "16.10.0", 
     "@nx/linter": "16.10.0", 
     "@nx/workspace": "16.10.0", 
     "@schematics/angular": "16.2.5", 
     "@types/google-one-tap": "1.2.3", 
     "@types/jest": "29.5.5", 
     "@types/node": "20.8.4", 
     "@typescript-eslint/eslint-plugin": "5.62.0", 
     "@typescript-eslint/parser": "5.62.0", 
     "esbuild": "0.19.4", 
     "eslint": "8.51.0", 
     "eslint-config-prettier": "8.10.0", 
     "jest": "29.7.0", 
     "jest-environment-jsdom": "29.7.0", 
     "jest-preset-angular": "13.1.2", 
     "jsonc-eslint-parser": "2.3.0", 
     "ng-packagr": "16.2.3", 
     "nx": "16.10.0", 
     "postcss": "8.4.31", 
     "postcss-import": "15.1.0", 
     "postcss-preset-env": "9.2.0", 
     "postcss-url": "10.1.3", 
     "prettier": "3.0.3", 
     "ts-jest": "29.1.1", 
     "ts-node": "10.9.1", 
     "typescript": "5.1.6" 
   }, 
   "packageManager": "pnpm@8.9.0" 
 }

@atsjo
Copy link
Author

atsjo commented Oct 10, 2023

Usually don't fail at install, but try pnpm store status, or prune right after install

@nachoaldamav
Copy link
Contributor

After a few tests, sometimes when cloning multiple file (or the the same file multiple times) the destination is empty, I'm working on a solution.

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

8.9.1 fails in the exact same way as 8.9.0... can be triggered with the deps I posted above...

  1. delete store
  2. delete node_modules in project
  3. run pnpm i
  4. run pnpm store status
PS D:\repos\teve-no\task4s> pnpm store status
 ERR_PNPM_MODIFIED_DEPENDENCY  Packages in the store have been mutated

These packages are modified:
registry.npmjs.org/@babel/helper-create-class-features-plugin/7.22.15(@babel/core@7.22.9)
registry.npmjs.org/@babel/helper-create-regexp-features-plugin/7.22.15(@babel/core@7.23.2)
registry.npmjs.org/@babel/helper-define-polyfill-provider/0.4.3(@babel/core@7.23.2)
registry.npmjs.org/@babel/helper-module-transforms/7.23.0(@babel/core@7.23.2)
registry.npmjs.org/@babel/helper-replace-supers/7.22.20(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-syntax-numeric-separator/7.10.4(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/7.8.3(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/7.18.6(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/7.18.6(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-dotall-regex/7.22.5(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-modules-systemjs/7.23.0(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-modules-umd/7.22.5(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-numeric-separator/7.22.11(@babel/core@7.22.9)
registry.npmjs.org/@babel/plugin-transform-parameters/7.22.15(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-private-property-in-object/7.22.11(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-unicode-regex/7.22.5(@babel/core@7.23.2)
registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/7.22.5(@babel/core@7.23.2)
registry.npmjs.org/babel-loader/9.1.3(@babel/core@7.23.2)(webpack@5.88.2)
registry.npmjs.org/css-tree/2.2.1
registry.npmjs.org/css-tree/2.3.1
registry.npmjs.org/terser-webpack-plugin/5.3.9(esbuild@0.18.17)(webpack@5.88.2)
registry.npmjs.org/webpack/5.88.2(esbuild@0.18.17)
registry.npmjs.org/webpack/5.88.2(esbuild@0.19.4)

You can run pnpm install --force to refetch the modified packages

If I didn't delete store first, it worked fine... But then the problem would just surface at some later point while upgrading deps...

@nachoaldamav
Copy link
Contributor

If the issue happens after using pnpm store prune, currently prune does not work with clones. See #7192

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

didn't use pnpm store prune... but as mentioned, it worked the time I didn't delete store first.... tried several times, it doesn't fail the same way always.... different packages are modified etc, and one time it failed during install...

@zkochan
Copy link
Member

zkochan commented Oct 15, 2023

8.9.1 fails in the exact same way as 8.9.0... can be triggered with the deps I posted above...

why do you say that it fails the exact same way? In the original issue installation was failing.

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

because it's not deterministic... as mentioned several places above (and in the original issue), it sometimes fails during install, but usually works... but when checking pnpm store status after install, you can se that some packages are changes from the version in store....

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

I guess when files that pnpm use during install are changed (package.json), then the install fails... but when some other files change, it's not noticed during install...

@zkochan zkochan reopened this Oct 15, 2023
@zkochan
Copy link
Member

zkochan commented Oct 15, 2023

So pnpm install does still fail occasionally or not? It might as well be an issue with the status command, if install doesn't fail anymore.

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

Made it fail once during install... But it always shows mutated packages after install...

@zkochan
Copy link
Member

zkochan commented Oct 15, 2023

ok, I'll revert it for Windows for now. We can investigate this later.

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

I just set hard linking in .npmrc for now...

@atsjo
Copy link
Author

atsjo commented Oct 15, 2023

I tracked down the changes in one of the mutated packages by comparing against an install using hardlinks (where it reports no mutated packages)... in a package called cssom@0.3.8 I found a file called CSSStyleSheet.js with the correct size, but content was all zero's when using cloning.... It's not deterministic which files and packages gets the error, but it's fairly easy to detect by running pnpm store status and diffing against a correct install... I can reproduce mutated packages consistently when deleting both store and node_modules, while keeping the lockfile, and then running pnpm i....

@zkochan
Copy link
Member

zkochan commented Oct 15, 2023

I am releasing 8.9.2, which reverts the change on Windows.

zkochan added a commit to teambit/bit that referenced this issue Oct 16, 2023
## Proposed Changes

- The main reason for this update is to revert the creation of reflinks
on Windows, which doesn't work reliably at the moment (related issue
pnpm/pnpm#7186)
@zkochan
Copy link
Member

zkochan commented Oct 18, 2023

@atsjo when you were testing the fix, have you update the packageManager field in your package.json?

@atsjo
Copy link
Author

atsjo commented Oct 18, 2023

yes... my laptop can easily reproduce this on a dev drive with the procedure described (#7186 (comment) and #7186 (comment)). It was failing with 8.9.0 and 8.9.1, but NOT with 8.9.2, since cloning is now disabled for windows...

@nachoaldamav
Copy link
Contributor

I'm running the following commands on my machine, with the pnpm version 8.9.1:

pnpm i
pnpm store status
pnpm store prune
rimraf node_modules pnpm-lock.yaml && pnpm i
pnpm store status

In my side almost all the status retrieve Packages in the store are untouched.
Based on this, I want to split the issue in 3 parts:

The only status that failed, had this file corrupted, so I'm adding a test for this one in the reflink repo https://pastebin.com/mBqQhYrm

I have a function to find files with null bytes, that should help us to find the problem for empty files

PS D:\code\modified-store> node .\check-null.mjs node_modules\.pnpm
✖ Null bytes found in the following files:
node_modules\.pnpm\css-tree@2.2.1\node_modules\css-tree\cjs\lexer\match.cjs
node_modules\.pnpm\css-tree@2.3.1\node_modules\css-tree\lib\syntax\node\Selector.js
node_modules\.pnpm\css-tree@2.3.1\node_modules\css-tree\lib\utils\string.js
node_modules\.pnpm\csso@5.0.5\node_modules\css-tree\cjs\lexer\match.cjs
node_modules\.pnpm\node_modules\css-tree\lib\syntax\node\Selector.js
node_modules\.pnpm\node_modules\css-tree\lib\utils\string.js
node_modules\.pnpm\svgo@3.0.2\node_modules\css-tree\lib\syntax\node\Selector.js
node_modules\.pnpm\svgo@3.0.2\node_modules\css-tree\lib\utils\string.js

@ridays2001
Copy link

I cannot use pnpm dlx on the root of the Windows 11 dev drive. I get the error: EPERM: Operation not permitted, mkdir D:\, but I am able to use pnpm normally inside all the subfolders. I have tried changing the security settings of the dev drive to grant full access to everyone (all the available profiles), but same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants