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

  1. Clone https://github.com/merceyz/typescript-to-proptypes
  2. yarn install
  3. works fine
  4. 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

Most upvoted comments

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:

  • Node: v12.16.1
  • Yarn: 2.0.0-rc.31

The three errors (all linked to https://github.com/yarnpkg/berry/tree/master/packages/plugin-compat/sources/patches):

  • fsevents@patch:fsevents@npm%3A1.2.12#builtin<compat/fsevents>::version=1.2.12&hash=77dfe6: The remote archive doesn’t match the expected checksum
  • resolve@patch:resolve@npm%3A1.15.1#builtin<compat/resolve>::version=1.15.1&hash=8fccd0: The remote archive doesn’t match the expected checksum
  • typescript@patch:typescript@npm%3A3.8.3#builtin<compat/typescript>::version=3.8.3&hash=270b6c: The remote archive doesn’t match the expected checksum
Screenshot 2020-04-01 at 12 58 29

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!