nodesource / distributions

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

[ERROR] Node.js 18.14.0 - 18.16.0 on Ubuntu22.04.3 Installation fail - unexpected file size #1657

Closed antoni-szych-rtbhouse closed 9 months ago

antoni-szych-rtbhouse commented 1 year ago

Describe your bug Unexpected file size of Node binaries.

Distribution Information:

Node Version:

To Reproduce Steps to reproduce the behavior:

  1. Import keys as specified in the instruction
  2. NODE_MAJOR=18
    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
  3. sudo apt update
  4. sudo apt install nodejs=18.14.0-1nodesource1

Actually, the same is reproducible with:

18.14.1-1nodesource1
18.14.2-1nodesource1
18.15.0-1nodesource1
18.16.0-1nodesource1

However it's working fine with:

18.16.1-1nodesource1
18.17.0-1nodesource1
18.17.1-1nodesource1

Expected behavior

Installation success.

Screenshots

sudo apt install nodejs=18.14.0-1nodesource1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  nodejs
1 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Need to get 29,0 MB of archives.
After this operation, 5 931 kB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_18.x nodistro/main amd64 nodejs amd64 18.14.0-1nodesource1 [29,0 MB]
Err:1 https://deb.nodesource.com/node_18.x nodistro/main amd64 nodejs amd64 18.14.0-1nodesource1
  File has unexpected size (28609760 != 29017700). Mirror sync in progress? [IP: 2606:4700:10::6816:51a 443]
  Hashes of expected file:
   - SHA512:17fcb59ef3e1b8e57e20c7e5e3157d77c686f23c79fb0992c53b9c37c7591a372d8935ae6a5916c9a7daaf1184fe9fb87a7eedc02e1e31a6214ce6d92658d384
   - SHA256:3800000f97eb40d5b15d9e03520abf193b74dab228ddd0aed4015cf217854d9c
   - SHA1:74b136a5527ce99e8062e3af4c56746a3222fe0d [weak]
   - MD5Sum:2905962bef8a243cad3c378cca5679a9 [weak]
   - Filesize:29017700 [weak]
E: Failed to fetch https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.14.0-1nodesource1_amd64.deb  File has unexpected size (28609760 != 29017700). Mirror sync in progress? [IP: 2606:4700:10::6816:51a 443]
   Hashes of expected file:
    - SHA512:17fcb59ef3e1b8e57e20c7e5e3157d77c686f23c79fb0992c53b9c37c7591a372d8935ae6a5916c9a7daaf1184fe9fb87a7eedc02e1e31a6214ce6d92658d384
    - SHA256:3800000f97eb40d5b15d9e03520abf193b74dab228ddd0aed4015cf217854d9c
    - SHA1:74b136a5527ce99e8062e3af4c56746a3222fe0d [weak]
    - MD5Sum:2905962bef8a243cad3c378cca5679a9 [weak]
    - Filesize:29017700 [weak]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

so the hashes are correct, but the filesize is different. Maybe that's an issue with apt or something? Let's try sending a direct HTTP request:

curl -v https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.14.0-1nodesource1_amd64.deb
*   Trying 2606:4700:10::ac43:acd:443...
* Connected to deb.nodesource.com (2606:4700:10::ac43:acd) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
...
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
*  start date: Aug 29 00:00:00 2023 GMT
*  expire date: Aug 27 23:59:59 2024 GMT
*  subjectAltName: host "deb.nodesource.com" matched cert's "deb.nodesource.com"
*  issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
...
> GET /node_18.x/pool/main/n/nodejs/nodejs_18.14.0-1nodesource1_amd64.deb HTTP/2
> Host: deb.nodesource.com
> user-agent: curl/7.81.0
> accept: */*
> 
< HTTP/2 200 
< date: Fri, 08 Sep 2023 11:10:35 GMT
< content-type: application/octet-stream
< content-length: 28609760
< x-amz-id-2: mLuB7+HvVTu40md9GRK9AtJpy4m00rXT1ehX12xGBdTdn+XIxUhfWVH9chUKE/fL+SG0Bro7jbM=
< x-amz-request-id: K921F0PFS0JA8TY1
< last-modified: Mon, 28 Aug 2023 20:06:08 GMT
< etag: "1d0aacda76659af36caaa3e2505c3d2b-4"
< cache-control: max-age=14400
< cf-cache-status: HIT
< age: 907
< accept-ranges: bytes
< server: cloudflare
< cf-ray: 8036beed0eb4347c-WAW
< 
...

see the content-length: 28609760 ? It was supposed to be 29017700 according to the index file (see second line from the bottom):

curl -s https://deb.nodesource.com/node_18.x/dists/nodistro/main/binary-amd64/Packages | grep -B 13 "2905962bef8a243cad3c378cca5679a9"
Package: nodejs
Priority: optional
Section: web
Installed-Size: 181302
Maintainer: NodeSource Support <support@nodesource.com>
Architecture: amd64
Version: 18.14.0-1nodesource1
Replaces: nodejs-dev (<= 0.8.22), nodejs-legacy, npm (<= 1.2.14)
Provides: nodejs-dev, nodejs-doc, nodejs-legacy, npm
Depends: libc6 (>= 2.28), python3, ca-certificates
Conflicts: nodejs-dev, nodejs-doc, nodejs-legacy, npm
Filename: pool/main/n/nodejs/nodejs_18.14.0-1nodesource1_amd64.deb
Size: 29017700
MD5sum: 2905962bef8a243cad3c378cca5679a9

Additional context

None that seems relevant.

Grothesk242 commented 1 year ago

This is true for the oldest nodejs16 builds too. More recent ones are okay. But I haven't investigated what is the first release to be installable.

jdmartin commented 1 year ago

I'm also seeing this behavior with the 20_x releases:

Get:10 https://deb.nodesource.com/node_20.x nodistro/main amd64 Packages [2,961 B] Err:10 https://deb.nodesource.com/node_20.x nodistro/main amd64 Packages File has unexpected size (2795 != 2961). Mirror sync in progress? [IP: 104.22.5.26 443] Hashes of expected file:

JesusPaz commented 1 year ago

@jdmartin Node.js v20 errors are due to a new version being released and may appear while the cache is being updated.

jdmartin commented 1 year ago

Gotcha. As it happens, I waited until now, ran apt-get clean, and then the upgrade proceeded as expected. :)

JesusPaz commented 1 year ago

@antoni-szych-rtbhouse we will do an investigation into what is happening

antoni-szych-rtbhouse commented 1 year ago

Please note that this issue is not reproducible anymore with any of the examples I provided previously:

18.14.0-1nodesource1
18.14.1-1nodesource1
18.14.2-1nodesource1
18.15.0-1nodesource1
18.16.0-1nodesource1

Now their size matches the size specified in the index file and the installation succeeds without any issues.

Example headers:

curl -v https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.14.0-1nodesource1_amd64.deb
*   Trying 2606:4700:10::ac43:acd:443...
* Connected to deb.nodesource.com (2606:4700:10::ac43:acd) port 443 (#0)
...
< HTTP/2 200 
< date: Wed, 11 Oct 2023 09:19:11 GMT
< content-type: application/octet-stream
< content-length: 29017700
< x-amz-id-2: LDjoaPVNoOmJIgopU9FeF35FigAOmpVk/BFcEZtEEbHinyXJwo0HY+GNDZhVENeJkhUk1+ublx8=
< x-amz-request-id: 1EBVFEHZ5NSKMB6E
< x-amz-meta-md5: 2905962bef8a243cad3c378cca5679a9
< last-modified: Mon, 18 Sep 2023 23:04:07 GMT
< etag: "2905962bef8a243cad3c378cca5679a9"
< cache-control: max-age=14400
< cf-cache-status: MISS
< accept-ranges: bytes
< server: cloudflare
< cf-ray: 8146051b79e135ba-WAW

Maybe the last-modified: Mon, 18 Sep 2023 23:04:07 GMT will be helpful in case you would like to investigate this further. Otherwise please feel free to close this issue as not reproducible anymore (at least for node 18.x).

jmahlik commented 1 year ago

It seems this might be occurring again with the nodejs_20.9.0 release. Specifically the Packages.bz2 file.

31.98 E: Failed to fetch https://deb.nodesource.com/node_20.x/dists/nodistro/main/binary-amd64/Packages.bz2  File has unexpected size (4070 != 3613). Mirror sync in progress? [IP: ...]
31.98    Hashes of expected file:
31.98     - Filesize:3613 [weak]
31.98     - SHA512:2baf8ce0fd06ccf978d7e73b1adc6fa8390dc5ff7942ab2d5b89903460ec9e188203851f12877cedcac57fc7047224194e64b772de199d733f72dbfb10b68317
31.98     - SHA256:fba8379cf729d58a5b6adab466a20a4e5bcef6a4e8dc584fe7c2a33f568cb062
31.98     - SHA1:b2ed6eae7078e1c3644014c3afb9f6e2aea85f33 [weak]
31.98     - MD5Sum:a9aebf4761f08a52bda814a67963e487 [weak]
31.98    Release file created at: Tue, 24 Oct 2023 15:16:00 +0000
31.98 E: Some index files failed to download. They have been ignored, or old ones used instead.
w601sxs commented 1 year ago

Failing for other versions as well: (is there a workaround?!)

E: Failed to fetch https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.17.1-deb-1nodesource1_amd64.deb  404  Not Found [IP: 104.22.5.26 443]
riosje commented 9 months ago

This issue was due to a cache corruption, but as of today everything is working properly.