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

Yarn 3 YN0001- Error while persisting #4985

Closed
pedronastasi opened this issue Oct 24, 2022 · 6 comments
Closed

Yarn 3 YN0001- Error while persisting #4985

pedronastasi opened this issue Oct 24, 2022 · 6 comments
Labels
external bug This issue highlights a bug in another project node-modules reproducible This issue can be successfully reproduced

Comments

@pedronastasi
Copy link

pedronastasi commented Oct 24, 2022

I'm getting YN0001- Error while persisting.... on windows when I run yarn install . Version Yarn 3.2.3

It occurs during the linking process. I'm using node-modules linker.

I haven't found any solution for this issue
on the internet .

➤ YN0001: │ Error: While persisting /C:/Users/.../AppData/Local/Yarn/Berry/cache/json-schema-library-npm-7.2.0-542ab2e6c3-8.zip/node_modules/json-schema-library/ -> /C:/Users/...backstage/node_modules/json-schema-library ENOENT: no such file or directory, open 'C:\Users\PNastasi\Documents\eg-group\backstage\node_modules\json-schema-library\profiles\develop-doValidations-2022-09-28 15:37:34.txt'

`

@merceyz merceyz transferred this issue from yarnpkg/yarn Oct 24, 2022
@larixer
Copy link
Member

larixer commented Oct 24, 2022

We need reproduction steps. I cannot reproduce:

c:\yarn.test>yarn set version 3.2.3
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.2.3/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.2.3.cjs
➤ YN0000: Done in 0s 857ms

c:\yarn.test>yarn add json-schema-library@7.2.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 396ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ gson-conform@npm:1.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ gson-pointer@npm:4.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ gson-query@npm:5.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ json-schema-library@npm:7.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ valid-url@npm:1.0.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done in 0s 514ms

@larixer larixer added unreproducible This issue cannot be reproduced on master node-modules waiting for feedback Will autoclose in a while unless more data are provided labels Oct 24, 2022
@merceyz
Copy link
Member

merceyz commented Oct 24, 2022

I can reproduce on Windows with the following:

cd $(mktemp -d)
yarn init -2
yarn set version 3.2.3
yarn config set nodeLinker node-modules
yarn add json-schema-library@7.2.0

The issue is that json-schema-library@7.2.0 contains filenames with reserved characters which aren't allowed on Windows, specifically the : (colon).
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=except%20for%20the,%3A%20(colon)

@pedronastasi
Copy link
Author

I'm using node 14.17.5. I'm not sure why this is happening and how to reproduce it. It just happens on my windows machine. it seems like something is misconfigured in my local environment. I've tried making fresh installs on my repo, Uninstalled and installed yarn, node and npm and it still keeps happening.
Any idea on how to reset yarn or whatever yarn depends on my local environment?

@larixer
Copy link
Member

larixer commented Oct 24, 2022

Okay, we were able to reproduce your issue. The verdict is: this is a bug in json-schema-library@7.2.0, they should not publish filenames with : as they are invalid on Windows. Moreover they seem to not mean publishing this file (profiles\develop-doValidations-2022-09-28 15:37:34.txt) at all, as it is generated and probably not used by their package at all. Closing as external bug.

@larixer larixer closed this as completed Oct 24, 2022
@larixer larixer added reproducible This issue can be successfully reproduced external bug This issue highlights a bug in another project and removed unreproducible This issue cannot be reproduced on master waiting for feedback Will autoclose in a while unless more data are provided labels Oct 24, 2022
@pedronastasi
Copy link
Author

Ok. Thanks guys, I'll try to install a version that didn't have that issue before

@TreyRhodes1
Copy link

I'm also facing this issue. My case is unique from the original post because I was trying to migrate our project from yarn classic to modern so we could take advantage of the expanded workspace functionality. This wasn't a problem in yarn classic, and it is now preventing us from upgrading to modern. In classic, the special characters would be removed from the filenames in the external dependencies and it wasn't an issue, but modern won't even complete the install due to this bug. In my case, the dependency uses '<>' in some of it's filenames.

I don't disagree with the verdict that this is an external bug, but I unfortunately am limited on ways that I can interact with my dependency and I don't think I have an option to change the filenames. We've used patch-package to fix bugs in dependencies before, but that requires a successful install to start. I just wanted to call this out in case anyone else is looking to upgrade from classic to modern - be weary of this possible dependency conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external bug This issue highlights a bug in another project node-modules reproducible This issue can be successfully reproduced
Projects
None yet
Development

No branches or pull requests

4 participants