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 install ENAMETOOLONG #2605

Closed
sveyret opened this issue Jun 3, 2020 · 10 comments · Fixed by #2607
Closed

pnpm install ENAMETOOLONG #2605

sveyret opened this issue Jun 3, 2020 · 10 comments · Fixed by #2607
Assignees
Milestone

Comments

@sveyret
Copy link

sveyret commented Jun 3, 2020

pnpm version:

5.1.2

Code to reproduce the issue:

I am working on the intl-ts project: https://github.com/slune-org/intl-ts

The project is still virgin and I try to install dependencies:

pnpm install

It fails with an ENAMETOOLONG error.

Expected behavior:

Install with no error.

Actual behavior:

$ pnpm install
Lockfile is up-to-date, resolution step is skipped
Packages: +596
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ERROR  ENAMETOOLONG: name too long, open '/home/stephane/.pnpm-store/v3/files/24/886a9c26ac23dc83f92b2692ab870714d212e65d417e41b909d2d9573ba6e41043ef3288fe40639b9686976fe182f854ce5cea296289858f809fe72502e9ef-index.json.3493966179'
Resolving: total 596, reused 0, downloaded 0

Additional information:

  • node -v prints: v14.2.0
  • Windows, OS X, or Linux?: Linux (Gentoo)
@sveyret
Copy link
Author

sveyret commented Jun 3, 2020

I tried other versions to be sure:

  • This is not corrected in next 5.1.3;
  • Version 4.14.4 is working correctly;
  • Version 5.0.0 is the first non working one I found.

@zkochan
Copy link
Member

zkochan commented Jun 3, 2020

We started to use a content-addressable storage in v5. So the file names in the store are longer. They are SHA512 converted to HEX.

This file is even a bit longer because it has the .json.3493966179 at the end. We write to the store atomically. So we write to a temp file and then we rename it. What is the max length filename that you can write to the '/home/stephane/.pnpm-store/v3/files/24/' directory?

Can you create a file called 886a9c26ac23dc83f92b2692ab870714d212e65d417e41b909d2d9573ba6e41043ef3288fe40639b9686976fe182f854ce5cea296289858f809fe72502e9ef-index.json?

@alexeyten
Copy link

Looks like you have eCryptfs
https://unix.stackexchange.com/a/32834/61540

@zkochan hex is really long. May be consider to use base64/base36/base32?

@sveyret
Copy link
Author

sveyret commented Jun 3, 2020

Yes, I can create a file in this directory with a name as long as 143 characters:

 886a9c26ac23dc83f92b2692ab870714d212e65d417e41b909d2d9573ba6e41043ef3288fe40639b9686976fe182f854ce5cea296289858f809fe72502e9ef-index.json-12345

If I add one more character, I have a file name too long.

My file system is an EcryptFS over EXT4. The maximum recommended file name length for EcryptFS is 140 characters, but actual length can go up to 143: https://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs.

EDIT: sorry @alexeyten, I didn't see your post which was saying rather the same thing as this one…

@zkochan
Copy link
Member

zkochan commented Jun 3, 2020

ok, we can reduce this temp file name length. The temp file name can be actually something short, like '/home/stephane/.pnpm-store/v3/files/24/_tmp<random hash>'

@alexeyten I like your idea. We can't use base64 because of case insensitive filesystems. But we can probably use base36. But it will be a breaking change... I guess it is a bit too soon to release v6

@zkochan
Copy link
Member

zkochan commented Jun 3, 2020

🚢 5.1.4

@ramnes
Copy link

ramnes commented Jul 20, 2023

@zkochan It seems back with pnpm 8.6.9:

 ENAMETOOLONG  ENAMETOOLONG: name too long, open '/home/ramnes/.local/share/pnpm/store/v3/files/56/52445747ce43b044c4eb076001ab81b1226688bc0fe065dbe7fa57646b5dead14b2967a7e6411e63ef6886bc733d008f1ed63bb67946a7e0620ec40f59d184-index.json_tmp_19567'

If I rollback to 7.33.5 with npm install -g pnpm@7.33.5, I don't have the error.

@zkochan
Copy link
Member

zkochan commented Jul 20, 2023

This issue is closed. There is this: #4549
and this: #6830

@zkochan
Copy link
Member

zkochan commented Jul 20, 2023

actually, this one is related to the store. It is caused by this change: #6817

Previously temp files were shorter, now we append _tmp_{process id} to the target file name. We could probably remove the -index.json part to make it shorter.

so the temp file would be /home/ramnes/.local/share/pnpm/store/v3/files/56/52445747ce43b044c4eb076001ab81b1226688bc0fe065dbe7fa57646b5dead14b2967a7e6411e63ef6886bc733d008f1ed63bb67946a7e0620ec40f59d184_tmp_19567

but the target file would be the same

also, in a next major version we could probably make the store path smaller by removing the "files" subdirectory.

@ramnes
Copy link

ramnes commented Jul 20, 2023

/home/ramnes/.local/share/pnpm/store/v3/files/56/52445747ce43b044c4eb076001ab81b1226688bc0fe065dbe7fa57646b5dead14b2967a7e6411e63ef6886bc733d008f1ed63bb67946a7e0620ec40f59d184_tmp_19567 works

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