Downloading binaries fails with wrong sha256 checksum

See original GitHub issue

Bug description

running npm i prisma almost always fails with error

sha256 of 
https://binaries.prisma.sh/all_commits/78a5df6def6943431f4c022e1428dbc3e833cf8e/debian-openssl-1.1.x/prisma-fmt.gz 
(zipped) should be 
5d18a91bf5db61a3e494b867e8e3f3053a62f44828226c0070818a3961c27a5e 
but is 
8745e26243463b6e06bb3ae5861507cb52c49e4a84923d6b54b2f4bbb54ca6ca

Further inspection revealed that wget https://binaries.prisma.sh/all_commits/78a5df6def6943431f4c022e1428dbc3e833cf8e/debian-openssl-1.1.x/prisma-fmt.gz returns a binary with sha256 8745e26243463b6e06bb3ae5861507cb52c49e4a84923d6b54b2f4bbb54ca6ca. Weirdly it sometimes (but very rarely) returns the binary with the correct sha256.

This problems seems to occur on the other binaries as well.

How to reproduce

# Dockerfile:

FROM ubuntu:latest AS build
RUN apt-get update && apt-get install -y wget
RUN wget https://binaries.prisma.sh/all_commits/78a5df6def6943431f4c022e1428dbc3e833cf8e/debian-openssl-1.1.x/prisma-fmt.gz 
RUN sha256sum prisma-fmt.gz
# Results in 
# Step 4/4 : RUN sha256sum prisma-fmt.gz
# ---> Running in c2a96a9150f4
# 8745e26243463b6e06bb3ae5861507cb52c49e4a84923d6b54b2f4bbb54ca6ca  prisma-fmt.gz

Expected behavior

Correct sha256 checksum when downloading the binary.

Prisma information

Not needed, installation of prisma fails even without a schema

Environment & setup

  • OS: Ubuntu 20.04
  • Database: PostgreSQL
  • Node.js version: 16.3.0

Prisma Version

3.5.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
DarkSmile92commented, Nov 11, 2022

Since this morning we encounter this issue and there is not much information out there, so that is why I open this old issue 😃 The Dockerfile executes RUN npm ci

[2022-11-11T14:28:23.999Z] Step 7/161 : RUN npm ci
[2022-11-11T14:28:23.999Z]  ---> Running in a3b499d60536
--- snip ---
[2022-11-11T14:29:06.387Z] npm ERR! code 1
[2022-11-11T14:29:06.387Z] npm ERR! path /app/node_modules/@prisma/engines
[2022-11-11T14:29:06.387Z] npm ERR! command failed
[2022-11-11T14:29:06.387Z] npm ERR! command sh -c -- node scripts/postinstall.js
[2022-11-11T14:29:06.387Z] npm ERR! /app/node_modules/@prisma/engines/dist/scripts/postinstall.js:22677
[2022-11-11T14:29:06.387Z] npm ERR!             throw new Error(`sha256 of ${url} (zipped) should be ${zippedSha256} but is ${zippedHash}`);
[2022-11-11T14:29:06.387Z] npm ERR!                   ^
[2022-11-11T14:29:06.387Z] npm ERR! 
[2022-11-11T14:29:06.387Z] npm ERR! Error: sha256 of https://binaries.prisma.sh/all_commits/694eea289a8462c80264df36757e4fdc129b1b32/linux-musl/migration-engine.gz (zipped) should be fef9a669cb5a4a866b0c3f54c87b19fa23b34029770e156ff65af0086b8cfb47 but is a8c0f25dba718250a33974276a0dacbcc8e8d9ac754ef2f60c40fbc011b772fd
[2022-11-11T14:29:06.387Z] npm ERR!     at /app/node_modules/@prisma/engines/dist/scripts/postinstall.js:22677:19
[2022-11-11T14:29:06.387Z] npm ERR!     at runMicrotasks (<anonymous>)
[2022-11-11T14:29:06.387Z] npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-11-11T14:29:06.387Z] 
[2022-11-11T14:29:06.387Z] npm ERR! A complete log of this run can be found in:
[2022-11-11T14:29:06.387Z] npm ERR!     /root/.npm/_logs/2022-11-11T14_28_24_565Z-debug-0.log
[2022-11-11T14:29:06.387Z] The command '/bin/sh -c npm ci' returned a non-zero code: 1

Is there a way to solve this on our own?

3reactions
Quesstorcommented, Nov 17, 2021

Yes, i can confirm that it works now. Thanks alot

Read more comments on GitHub >

github_iconTop Results From Across the Web

Downloading binaries of 4.6.1 fails with wrong sha256 ...
Correct sha256 checksum when downloading the binary. Prisma information. Not needed, installation of prisma fails even without a schema.
Read more >
All downloaded files have wrong checksum SHA256
Dear Microsoft Community, I have problem with all devices in my network. When I download file this have wrong checksum and sometimes is...
Read more >
Why does SHA256 hash not match after uploading and ...
First try without the upload/download just to see if it matches. Are you getting any exceptions. If the hash isn't valid you should...
Read more >
File SHA256 checksum failed, but OK on reboot
Turns out the downloaded file doesn't match the published checksum. I then tried downloading the file via FTP. This one worked. No SmartScreen ......
Read more >
How to verify your Ubuntu download
1. Overview · 2. Necessary software · 3. Download checksums and signatures · 4. Retrieve the correct signature key · 5. Verify the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found