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

Downloading binaries fails with wrong sha256 checksum #10312

Closed
Quesstor opened this issue Nov 17, 2021 · 7 comments
Closed

Downloading binaries fails with wrong sha256 checksum #10312

Quesstor opened this issue Nov 17, 2021 · 7 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before. team/client Issue for team Client. topic: binary distribution
Milestone

Comments

@Quesstor
Copy link

Quesstor commented Nov 17, 2021

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
@Quesstor Quesstor added the kind/bug A reported bug. label Nov 17, 2021
@pantharshit00
Copy link
Contributor

pantharshit00 commented Nov 17, 2021

I am unable to reproduce this. Looks like a temporary network error on your end. Are you able to consistently reproduce this?

Looks like I can't reproduce this on Windows docker but I can indeed reproduce this in an linux machine. Thanks for the report.

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before. process/candidate team/client Issue for team Client. topic: binary distribution and removed kind/bug A reported bug. labels Nov 17, 2021
@janpio janpio added this to the 3.6.0 milestone Nov 17, 2021
@janpio
Copy link
Member

janpio commented Nov 17, 2021

Thanks, we have identified the issue and are working on a fix.

@janpio
Copy link
Member

janpio commented Nov 17, 2021

Update: We have applied a first fix on our caching infrastructure. Can you please try again and let us know if the problem is consistently fixed for you? @ggmon @Quesstor

@janpio janpio self-assigned this Nov 17, 2021
@janpio
Copy link
Member

janpio commented Nov 17, 2021

We are pretty confident this problem is now resolved. We would still love to get confirmation from people that experienced it before of course - please let us know by answering this issue.

@Quesstor
Copy link
Author

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

@DarkSmile92
Copy link

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?

@janpio
Copy link
Member

janpio commented Nov 11, 2022

Reposted and responded in #16233 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before. team/client Issue for team Client. topic: binary distribution
Projects
None yet
Development

No branches or pull requests

4 participants