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

End-user yarn dependency resolution fails due to remote archive doesn't match the expected checksum #547

Closed
dustinbyrne opened this issue Dec 2, 2022 · 6 comments
Assignees

Comments

@dustinbyrne
Copy link
Contributor

dustinbyrne commented Dec 2, 2022

E.g.

➤ YN0018: │ d3-path@npm:1.0.9: The remote archive doesn't match the expected checksum
➤ YN0018: │ d3-selection@npm:1.4.2: The remote archive doesn't match the expected checksum
➤ YN0018: │ crypto-js@npm:4.1.1: The remote archive doesn't match the expected checksum
➤ YN0018: │ d3-drag@npm:1.2.5: The remote archive doesn't match the expected checksum
➤ YN0018: │ d3-shape@npm:1.3.7: The remote archive doesn't match the expected checksum
➤ YN0018: │ d3-timer@npm:1.0.10: The remote archive doesn't match the expected checksum
➤ YN0018: │ d3-transition@npm:1.3.2: The remote archive doesn't match the expected checksum
➤ YN0018: │ d3-zoom@npm:1.8.3: The remote archive doesn't match the expected checksum
➤ YN0018: │ dashdash@npm:1.14.1: The remote archive doesn't match the expected checksum
➤ YN0018: │ data-urls@npm:2.0.0: The remote archive doesn't match the expected checksum
➤ YN0018: │ debounce-fn@npm:4.0.0: The remote archive doesn't match the expected checksum
➤ YN0018: │ debug@npm:4.3.4: The remote archive doesn't match the expected checksum
➤ YN0018: │ decompress-response@npm:4.2.1: The remote archive doesn't match the expected checksum
➤ YN0018: │ dagre@npm:0.8.5: The remote archive doesn't match the expected checksum
➤ YN0000: └ Completed in 0s 583ms
➤ YN0000: Failed with errors in 3s 118ms
@brikelly brikelly assigned dividedmind and symwell and unassigned dividedmind Dec 16, 2022
@symwell
Copy link
Contributor

symwell commented Dec 16, 2022

Log.

dustinbyrne asks "Do we need checksumBehavior: reset here?"

Theres' a suggestion to use

YARN_CHECKSUM_BEHAVIOR=update yarn

It'll update the lockfile with the new cache checksums.

@symwell
Copy link
Contributor

symwell commented Dec 16, 2022

Reproduced in appmap-js by editing yarn.lock and changing one of the checksums to be incorrect.

test@work[2022-12-16_13:51:09]:~/src/appmap-js$ yarn
➤ YN0000: ┌ Resolution step
...
➤ YN0000: ┌ Fetch step
➤ YN0013: │ @ampproject/remapping@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0018: │ @ampproject/remapping@npm:2.1.1: The remote archive doesn't match the expected checksum
➤ YN0000: └ Completed in 1s 84ms
➤ YN0000: Failed with errors in 1s 574ms

Fixed by running

test@work[2022-12-16_13:51:15]:~/src/appmap-js$ YARN_CHECKSUM_BEHAVIOR=update yarn
➤ YN0000: ┌ Resolution step
...
➤ YN0000: ┌ Fetch step
➤ YN0013: │ @ampproject/remapping@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 0s 776ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 1s 501ms
➤ YN0000: Done with warnings in 3s 263ms

Running with reset didn't fix it.

test@work[2022-12-16_14:13:14]:~/src/appmap-js$ YARN_CHECKSUM_BEHAVIOR=reset yarn
➤ YN0000: ┌ Resolution step
...
➤ YN0000: ┌ Fetch step
➤ YN0018: │ @ampproject/remapping@npm:2.1.1: The remote archive doesn't match the expected checksum
➤ YN0000: └ Completed in 0s 633ms
➤ YN0000: Failed with errors in 1s 125ms

@dividedmind
Copy link
Contributor

While I'm not against this, I still don't understand why we would need this or what it would fix exactly. If so many checksums don't match as in the original report, obviously there is something weird going on with the network and the archives are coming back corrupted (perhaps a captive proxy is returning an error page instead of them).

Did we see any instance of checksum corruption that doesn't fit this pattern?

@symwell
Copy link
Contributor

symwell commented Dec 19, 2022

It could fix yarn calculating an incorrect mtime to produce/verify .zip archives. Maybe users running a version of yarn without this bug fix see this error.

yarn pack seems to produce different output per OS.

It could also be something weird with the network.

@symwell
Copy link
Contributor

symwell commented Dec 19, 2022

Did we see any instance of checksum corruption that doesn't fit this pattern?

I didn't. I spot checked 10+ instances of this error. There is some variance in the list of packages but the checksum corruption pattern is the same.

@symwell
Copy link
Contributor

symwell commented Dec 22, 2022

I don't see this error in the logs anymore. Closing.

@symwell symwell closed this as completed Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants