nodesource / distributions

NodeSource Node.js Binary Distributions
https://nodesource.com
MIT License
13.5k stars 3.07k forks source link

[ERROR] Node.js 20 on debian Bullseye Installation fails due to checksum error #1576

Closed RebelSoftware closed 1 year ago

RebelSoftware commented 1 year ago

When installing Node into docker container an error is received to say that there is a hash failure

#0 23.91 E: Failed to fetch https://deb.nodesource.com/node_20.x/dists/bullseye/main/binary-amd64/Packages.gz  File has unexpected size (777 != 776). Mirror sync in progress? [IP: 23.217.103.89 443]
#0 23.91    Hashes of expected file:
#0 23.91     - Filesize:776 [weak]
#0 23.91     - SHA256:b8ca63ac4fbe9dad6950b850a9258db453c68c7b1c60f25457b9709684154e47
#0 23.91     - SHA1:35c0928a4089a3064e90b1c3cd0eb3f90d96983f [weak]
#0 23.91     - MD5Sum:333f082eb4c6371f533f47acb4774153 [weak]
#0 23.91    Release file created at: Tue, 16 May 2023 15:52:17 +0000

Distribution Information:

Node Version:

To Reproduce Steps to reproduce the behavior: Use installation process

RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
         && apt-get install -y nodejs \
         && npm install --global yarn

Expected behavior Node npm and yarn to install into image

Walter-o commented 1 year ago

Failed to fetch https://deb.nodesource.com/node_18.x/dists/jammy/main/binary-arm64/Packages.gz File has unexpected size (778 != 776). Mirror sync in progress? [IP: 84.53.175.42 443]

ARM64 Ubuntu 22.04 in Docker

Update1: Same configuration worked for me 1 hour later. woooooooo

ecgould04 commented 1 year ago

Experiencing the same issue. `

0 13.09

0 13.09 ## Running apt-get update for you...

0 13.09

0 13.09 + apt-get update

0 13.55 Get:1 https://deb.nodesource.com/node_18.x focal InRelease [4583 B]

0 13.72 Get:2 https://deb.nodesource.com/node_18.x focal/main arm64 Packages [776 B]

0 13.72 Err:2 https://deb.nodesource.com/node_18.x focal/main arm64 Packages

0 13.72 File has unexpected size (778 != 776). Mirror sync in progress? [IP: 23.34.82.11 443]

0 13.72 Hashes of expected file:

0 13.72 - Filesize:776 [weak]

0 13.72 - SHA256:4cdc71073957aaffbea511d99669cc4fa98b752eab966068a023558555e0ab92

0 13.72 - SHA1:0b9c08bd020fac9bc1d05b3008fe7aeee3d1a182 [weak]

0 13.72 - MD5Sum:fc5eace817a48e2a439589628112ec00 [weak]

0 13.72 Release file created at: Thu, 13 Apr 2023 14:12:04 +0000

0 13.74 Hit:3 http://ports.ubuntu.com/ubuntu-ports focal InRelease

0 13.84 Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease

0 13.94 Hit:5 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease

0 14.03 Hit:6 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease

0 14.56 Fetched 4583 B in 1s (3386 B/s)

0 14.56 Reading package lists...

0 15.86 E: Failed to fetch https://deb.nodesource.com/node_18.x/dists/focal/main/binary-arm64/Packages.gz File has unexpected size (778 != 776). Mirror sync in progress? [IP: 23.34.82.11 443]

0 15.86 Hashes of expected file:

0 15.86 - Filesize:776 [weak]

0 15.86 - SHA256:4cdc71073957aaffbea511d99669cc4fa98b752eab966068a023558555e0ab92

0 15.86 - SHA1:0b9c08bd020fac9bc1d05b3008fe7aeee3d1a182 [weak]

0 15.86 - MD5Sum:fc5eace817a48e2a439589628112ec00 [weak]

0 15.86 Release file created at: Thu, 13 Apr 2023 14:12:04 +0000

0 15.86 E: Some index files failed to download. They have been ignored, or old ones used instead.

0 15.87 Error executing command, exiting

`

m-filippov commented 1 year ago

I have the same problem with amd64 node_16.x `E: Failed to fetch https://deb.nodesource.com/node_16.x/dists/bullseye/main/binary-amd64/Packages.gz File has unexpected size (775 != 776). Mirror sync in progress? [IP: 23.213.161.30 443] Hashes of expected file:

kay-ramme commented 1 year ago

any workaround ?

kay-ramme commented 1 year ago

switching edge servers seems to help :-)

JuanjoEPS commented 1 year ago

Fallo al obtener https://deb.nodesource.com/node_16.x/dists/focal/main/binary-amd64/Packages.gz El archivo tiene un tamaño inesperado (776 != 775). ¿La sincronización de la réplica está en progreso?

[IP: 130.206.192.15 443] Hashes of expected file:

JuanjoEPS commented 1 year ago

It is solved by editing /etc/apt/sources.list.d/nodesource.list and changing https to http in the URLs, thus:

deb [signed-by=/usr/share/keyrings/nodesource.gpg] http://deb.nodesource.com/node_16.x focal main deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] http://deb.nodesource.com/node_16.x focal main

And then typing:

apt update

apt upgrade

ambarishsatheesh-rs commented 1 year ago

It is solved by editing /etc/apt/sources.list.d/nodesource.list and changing https to http in the URLs, thus:

deb [signed-by=/usr/share/keyrings/nodesource.gpg] http://deb.nodesource.com/node_16.x focal main deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] http://deb.nodesource.com/node_16.x focal main

And then typing:

apt update

apt upgrade

If you're using the install script, something like this works: curl -sL https://deb.nodesource.com/setup_16.x | sed 's/https:\/\/deb.nodesource.com/http:\/\/deb.nodesource.com/g' | bash - Not very comfortable with such a hacky method but better than complete breakage?

francoism90 commented 1 year ago

I really dislike switching to http.. any workarounds?

Have the same issue with Laravel Sail.

natwallbank commented 1 year ago

I really dislike switching to http.. any workarounds?

Have the same issue with Laravel Sail.

I ended up using nvm to install node in my Dockerfile, to enable our builds to complete.

snakethatlovesstaticlibs commented 1 year ago

I'm also seeing the same issue in our CI

shadinaif commented 1 year ago

node 16 on ubuntu 20.04, not working, same error

it's working fine now, no change from my side, no workaround! Maybe it was a caching issue somewhere, I doubt it was my server since I tried clearing the cache

abotteram commented 1 year ago

Same problem here. Docker, using the debian:11-slim image.

#0 1.328 Err:5 https://deb.nodesource.com/node_16.x bullseye/main arm64 Packages
#0 1.328   File has unexpected size (778 != 777). Mirror sync in progress? [IP: 84.53.175.98 443]
#0 1.328   Hashes of expected file:
#0 1.328    - Filesize:777 [weak]
#0 1.328    - SHA256:c6ed70e1806861e1c42fe6f958761189365484a7aa23333e4e42789c487eb4c4
#0 1.328    - SHA1:6dfe05ffd1fd3d20612c3bde25c8c8fb1b481a8f [weak]
#0 1.328    - MD5Sum:36131829d98b2079d9fc77038bbc3328 [weak]
#0 1.328   Release file created at: Wed, 19 Apr 2023 16:10:35 +0000
#0 1.334 Fetched 4586 B in 0s (13.9 kB/s)
#0 1.334 Reading package lists...
#0 1.566 E: Failed to fetch https://deb.nodesource.com/node_16.x/dists/bullseye/main/binary-arm64/Packages.gz  File has unexpected size (778 != 777). Mirror sync in progress? [IP: 84.53.175.98 443]
#0 1.566    Hashes of expected file:
#0 1.566     - Filesize:777 [weak]
#0 1.566     - SHA256:c6ed70e1806861e1c42fe6f958761189365484a7aa23333e4e42789c487eb4c4
#0 1.566     - SHA1:6dfe05ffd1fd3d20612c3bde25c8c8fb1b481a8f [weak]
#0 1.566     - MD5Sum:36131829d98b2079d9fc77038bbc3328 [weak]
#0 1.566    Release file created at: Wed, 19 Apr 2023 16:10:35 +0000
#0 1.566 E: Some index files failed to download. They have been ignored, or old ones used instead.
#0 1.568 Error executing command, exiting

I fixed the error temporarily by downloading and copying the setup_16.x script manually into the container and running it. I renamed it to node_16_setup.sh.

FROM debian:11-slim

WORKDIR /app

COPY ./node_16_setup.sh ./

RUN chmod +x ./node_16_setup.sh \
    && apt-get update \
    && ./node_16_setup.sh \
    && apt-get install -y nodejs \
kay-ramme commented 1 year ago

see above, just switch edge servers, that works as a workaround ..

abotteram commented 1 year ago

@kay-ramme

And how would I go about doing that? I don't know what that means. :)

kay-ramme commented 1 year ago

edge servers are mirrors of the origin server, the edge server is typically chosen to be somehow the nearest to your client it seems, that some of these edge servers are out of sync with the origin, leading to above reported issue while others are working properly

different edge servers have different IPs, so, if you have some edge server which is working (you can try e.g. on some remote host or use some other provider), then you use this edge server in the region where you see the error

simplest way was, to just put the IP and the domain name into your /etc/hosts file

e.g. this was working for me

23.216.155.10 deb.nodesource.com

I added it to end of my /etc/hosts

Zenexer commented 1 year ago

HTTPS is working again for Node 20.x, bookworm, arm64.

Is it possible that the origin servers are briefly receiving outdated artifacts as part of the build process, resulting in a race condition with the edge servers? If a request is made to an affected file on an edge server during this period, it would presumably cache on outdated artifact.

That would also explain why HTTPS is more often affected than HTTP: since the script defaults to HTTPS, more systems are making requests to the HTTPS URL, so the race condition is more likely to arise.

chrisk-tbot commented 1 year ago

Still encountering this. Node 16, Debian 11 bullseye. Attempted to purge cache, but still getting the file size mismatch

@JesusPaz should be reopened?

32.76 E: Failed to fetch https://deb.nodesource.com/node_16.x/dists/bullseye/main/binary-amd64/Packages.gz  File has unexpected size (775 != 776). Mirror sync in progress? [IP: 23.213.161.30 443]
32.76    Hashes of expected file:
32.76     - Filesize:776 [weak]
32.76     - SHA256:e5d3c880cdb1ec15f193329e5a3abe68056c59f6026144de4d4b52fcce2131e6
...
32.76 E: Some index files failed to download. They have been ignored, or old ones used instead.
Zenexer commented 1 year ago

I'm seeing 775 and up-to-date timestamps in all of the following:

I'm still betting on this being a race condition with caching. If that's the case, clearing the CDN's cache is always just going to be a temporary fix.

Does the origin have multiple servers that auto-scale or similar? If so, do servers ever come online prior to ensuring that they're up-to-date? That would cause this issue, and the CDN wouldn't be to blame.

Aghassi commented 1 year ago

@JesusPaz Why is this issue closed? Node 16 and other versions that aren't Node 20 are still impacted by this. Can you provide guidance to the community as to what to do to work around this and or when the fix for all versions will be landed?

Our internal CI is currently flakey because of this and we are trying to determine if we keep relying on this package or not as a result.

Zenexer commented 1 year ago

It's closed because several people reported that it was resolved across two different issues. I'm sure they'll reopen it now that people are reporting the fix didn't stick.

lenhartd-apex commented 1 year ago

@JesusPaz We are in the exact same situation as @Aghassi

Zenexer commented 1 year ago

Thanks, @JesusPaz. As before, let me know if there's any way I can help troubleshoot.

elalecs commented 1 year ago

Can someone explain how to force the use of an edge server?

Zenexer commented 1 year ago

That's not actually going to fix it. It might work around it once or twice, but it'll break again. There are instructions above, but you probably shouldn't use them.

JesusPaz commented 1 year ago

@Aghassi can you include some logs to help us understand what you're experiencing?

Aghassi commented 1 year ago

@JesusPaz


[2023-06-26T22:52:50.228Z] #6 10.20 ## Running `apt-get update` for you...

[2023-06-26T22:52:50.228Z] #6 10.20 

[2023-06-26T22:52:50.228Z] #6 10.20 + apt-get update

[2023-06-26T22:52:50.228Z] #6 10.34 Get:1 https://deb.nodesource.com/node_16.x focal InRelease [4583 B]

[2023-06-26T22:52:50.483Z] #6 10.41 Get:2 https://deb.nodesource.com/node_16.x focal/main amd64 Packages [776 B]

[2023-06-26T22:52:50.483Z] #6 10.41 Err:2 https://deb.nodesource.com/node_16.x focal/main amd64 Packages

[2023-06-26T22:52:50.483Z] #6 10.41   File has unexpected size (775 != 776). Mirror sync in progress? [IP: 23.216.147.192 443]

[2023-06-26T22:52:50.483Z] #6 10.41   Hashes of expected file:

[2023-06-26T22:52:50.483Z] #6 10.41    - Filesize:776 [weak]

[2023-06-26T22:52:50.483Z] #6 10.41    - SHA256:e5d3c880cdb1ec15f193329e5a3abe68056c59f6026144de4d4b52fcce2131e6

[2023-06-26T22:52:50.483Z] #6 10.41    - SHA1:87f1583949354fe006bc0137a84d8cfe90b0229d [weak]

[2023-06-26T22:52:50.483Z] #6 10.41    - MD5Sum:c881892f3a46cc943e7ff44162cbee62 [weak]

[2023-06-26T22:52:50.483Z] #6 10.41   Release file created at: Wed, 19 Apr 2023 16:10:36 +0000

[2023-06-26T22:52:50.483Z] #6 10.56 Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease

[2023-06-26T22:52:50.483Z] #6 10.57 Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease

[2023-06-26T22:52:50.738Z] #6 10.71 Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease

[2023-06-26T22:52:50.738Z] #6 10.85 Get:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]

[2023-06-26T22:52:51.299Z] #6 11.36 Fetched 113 kB in 1s (105 kB/s)

[2023-06-26T22:52:52.224Z] #6 11.36 Reading package lists...

All we are doing in our dockerfile is

curl -sL https://deb.nodesource.com/setup_16.x | bash -
lenhartd-apex commented 1 year ago
E: Failed to fetch https://deb.nodesource.com/node_16.x/dists/focal/main/binary-arm64/Packages.gz  File has unexpected size (778 != 777). 
Mirror sync in progress?
   Hashes of expected file:
    - Filesize:777 [weak]
    - SHA256:c6ed70e1806861e1c42fe6f958761189365484a7aa23333e4e42789c487eb4c4
    - SHA1:6dfe05ffd1fd3d20612c3bde25c8c8fb1b481a8f [weak]
    - MD5Sum:36131829d98b2079d9fc77038bbc3328 [weak]
   Release file created at: Wed, 19 Apr 2023 16:10:36 +0000
oliverbrancovdexcare commented 1 year ago

Any update on this?

JesusPaz commented 1 year ago

This issue is resolved with our new repository. More information can be found here.

jrunestone commented 1 year ago

@JesusPaz I just migrated to the new repo, I'm still getting the same error just now

EDIT: works today (the next day)

image

franee commented 1 year ago

@JesusPaz, thanks for that, I've added some extra notes for Ubuntu on the wiki.

michael-freidgeim-webjet commented 5 months ago

@franee

@JesusPaz, thanks for that, I've added some extra notes for Ubuntu on the wiki.

Link to wiki is broken

SturdyStubs commented 3 months ago

Still experiencing this issue, can we get an updated link to the wiki?

riosje commented 3 months ago

Hi @SturdyStubs would you to open a new issue with your error? The installation script should not be throwing this error anymore.

the-veloper commented 2 months ago

this is still happening. any news?

6.603 Fetched 44.3 kB in 2s (22.9 kB/s)
6.603 Reading package lists...
11.20 E: Failed to fetch https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_16.20.2-1nodesource1_amd64.deb  File has unexpected size (27528856 != 27210210). Mirror sync in progress? [IP: 104.22.4.26 443]
11.20    Hashes of expected file:
11.20     - SHA256:80730cbf61c72b9cf55435cdf8bef44a865cd797bdf4b62b7e3a9151568a0a17
11.20     - SHA1:f3ce40f55d97d4582eed117e4d26fdaa09d46a32 [weak]
11.20     - MD5Sum:94cdd9c58e730374a1cf2c818e8ecedb [weak]
11.20     - Filesize:27210210 [weak]
11.20 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
NewEraCracker commented 1 week ago

@JesusPaz https://github.com/nodesource/distributions/issues/1576#issuecomment-1698012034

This issue is resolved with our new repository. More information can be found here.

Why did you delete that page? Thankfully the WebArchive institution still has it:

@the-veloper https://github.com/nodesource/distributions/issues/1576#issuecomment-2334194944

this is still happening. any news?

May I suggest: apt clean && apt update && apt autoremove