berry: [Bug] YN0018 in github actions when using TypeScript
Describe the bug
yarn install fails with on GitHub actions but not locally with YN0018
- yarn cache clean --all did not help
- updating yarn to latest did not help
- updating yarn to sources did not help
Also tried:
/D/p/m/typescript-to-proptypes (master|✔) $ yarn -v
2.0.0-rc.31.git.20200327.c2902096
~/D/p/m/typescript-to-proptypes (master|✔) $ yarn cache clean --all
➤ YN0000: Done in 0.07s
~/D/p/m/typescript-to-proptypes (master|✔) $ set -x YARN_CHECKSUM_BEHAVIOR update
~/D/p/m/typescript-to-proptypes (master|✔) $ yarn
which did not change anything. The install did take quite a while though. It seemed to be frozen after it downloaded everything.
To Reproduce
- Clone https://github.com/merceyz/typescript-to-proptypes
- yarn install
- works fine
- same commit fails in github actions: https://github.com/merceyz/typescript-to-proptypes/runs/547813870
Screenshots
https://github.com/merceyz/typescript-to-proptypes/runs/550247915#step:5:3273
Environment if relevant (please complete the following information):
- GitHub runner version 2.165.2 using ubuntu-latest
Additional context
Seems related to typescript 3.5.2
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (16 by maintainers)
Commits related to this issue
- Try another suggestion from https://github.com/yarnpkg/berry/issues/1142 — committed to iotaledger/iota-wiki by jlvandenhout 2 years ago
- Migrate to yarn v2 (#443) * Migrate to yarn v2 * Change gh-page workflow * Change gh-pages workflow 2 * Remove --immutable * Generate new lock file * Add dependenciesMeta * Delete d... — committed to iotaledger/iota-wiki by kilianhln 2 years ago
- Add yarn checksum bahvior Related https://github.com/yarnpkg/berry/issues/1142\#issuecomment-607272809 — committed to dooboolab-community/dooboo-native-ts by DevYuns 2 years ago
- Add yarn checksum behavior Related https://github.com/yarnpkg/berry/issues/1142\#issuecomment-607272809 — committed to dooboolab-community/dooboo-native-ts by DevYuns 2 years ago
- Add yarn checksum behavior Related https://github.com/yarnpkg/berry/issues/1142\#issuecomment-607272809 — committed to dooboolab-community/dooboo-native-ts by DevYuns 2 years ago
- Listing more binary files explicitly to further protect from checksum errors https://github.com/yarnpkg/berry/issues/1142 — committed to goldstack/goldstack by mxro 2 years ago
- Ensure Library Publish Condition Evaluates Correctly (#226) * Ensure library publish * Trigger library build * Listing more binary files explicitly to further protect from checksum errors https://g... — committed to goldstack/goldstack by mxro 2 years ago
- chore: update yarn checksum behaviour Workaround as described here: https://github.com/yarnpkg/berry/issues/1142 Feels like a terrible hack. Checksums have a purpose, to simply update them blindly w... — committed to davidvuong/pozition by davidvuong 2 years ago
- Release 0.68+ (#180) * Migrating proj to SDK 45 * Enable ios to build succeeded with @hyochan/react-native-fbt * Enable android build with new architecture * package test * Resolve type i... — committed to dooboolab-community/dooboo-native-ts by DevYuns 2 years ago
- fix(ci): update tauri-plugin-log package checksum this should enable running github actions reference: https://github.com/yarnpkg/berry/issues/1142#issuecomment-607272809 — committed to MintterHypermedia/mintter by horacioh 2 years ago
- fix(ci): update tauri-plugin-log package checksum this should enable running github actions reference: https://github.com/yarnpkg/berry/issues/1142#issuecomment-607272809 — committed to MintterHypermedia/mintter by horacioh 2 years ago
- build(yarn berry): configure Yarn berry package manager I was getting the error "The remote archive doesn't match the expected checksum" while trying to install a commit of this library using Yarn (h... — committed to Howdju/saga-slice by carlgieringer 2 years ago
- Migrate to yarn v2 (#443) * Migrate to yarn v2 * Change gh-page workflow * Change gh-pages workflow 2 * Remove --immutable * Generate new lock file * Add dependenciesMeta * Delete d... — committed to iota-community/communitydriven-blog by kilianhln 2 years ago
- Migrate to yarn v2 (#443) * Migrate to yarn v2 * Change gh-page workflow * Change gh-pages workflow 2 * Remove --immutable * Generate new lock file * Add dependenciesMeta * Delete d... — committed to iotaledger/iota-wiki by kilianhln 2 years ago
My best guess is that this is due to this change, committed a few weeks ago: https://github.com/yarnpkg/berry/blob/master/packages/plugin-patch/sources/patchUtils.ts#L143
It slightly changed the patch mechanism with regard to line endings to make it more consistent, but unfortunately it was already too late and I should have bumped the cache version since the old one wasn’t compatible with the new one anymore.
To workaround this, try the following:
yarn cache clean --all
At this point, running
yarn install
should start to fail. Then run this:YARN_CHECKSUM_BEHAVIOR=update yarn
It’ll update the lockfile with the new cache checksums.
You have to install yarn berry on the CI Cd
I get this with Yarn 2 on Github CI but only with a git repo dependency:
https://github.com/LearnSomethingTeam/mathjs.git#commit=3c3048bedb39db7352bec75846ed6e8a04b9f862
“The remote archive doesn’t match the expected checksum”
I do use Typescript
When I set YARN_CHECKSUM_BEHAVIOR=update the CI build succeeds, but I’d really rather not use that.
Good news! I’ve isolated the problem to an unstable mtime generated in the zip archives when using the patch protocol (hence why it failed for fsevents, resolve, and typescript only). The fix is #1155, it’ll land in master shortly and I’ll make a release not long after.
There’s no need to install Berry on GitHub actions if it’s checked in to version control. Also, the logs clearly show that Berry is the version that’s used.
Same here, it doesn’t fail locally though. But it fails in gitlab or when running it in docker locally.
Use
yarn set version from sources
to install master in your project.I have the exact same issue (works locally but not in Github Actions). During the installation we can see checksum mismatches such as https://github.com/merceyz/typescript-to-proptypes/runs/547813870#step:5:1204 (see following screenshot) but not sure if it is linked.
I use:
The three errors (all linked to https://github.com/yarnpkg/berry/tree/master/packages/plugin-compat/sources/patches):
Still broken for me unfortunately 😦
Repository: https://gitlab.com/niklaskorz/nkchat Failing pipeline: https://gitlab.com/niklaskorz/nkchat/-/jobs/526714686
I’m also having this with dependencies pulled from github. On my local computer the checksums don’t match the CI’s and everyone else’s local.
I compared the package files between my PC and a coworker’s and noticed that for them, yarn adds a “packageManager” attribute to the dependencies’ package.json file, but for me it doesn’t. That’s why the checksum on my PC doesn’t match anyone else’s.
awesome!