nodesource / distributions

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

[ERROR] Node.js 20.x on amazonlinux:2023 Installation fail: GPG check FAILED #1747

Closed timd73 closed 8 months ago

timd73 commented 8 months ago

Installation of Node.js 20.x from nodesource fails on "GPG check FAILED" The exact same steps were working until yesterday (Jan 2 2024) - the Dockerfile has not changed.

The error is:

#18 [stage-1  6/49] RUN dnf install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
#18 6.550 nodejs-20.10.0-1nodesource.x86_64.rpm           9.3 MB/s |  36 MB     00:03
#18 6.552 --------------------------------------------------------------------------------
#18 6.553 Total                                           9.2 MB/s |  36 MB     00:03
#18 6.711 Node.js Packages for Linux RPM based distros -  1.6 MB/s | 1.7 kB     00:00
#18 6.768 Importing GPG key 0x9B1BE0B4:
#18 6.768  Userid     : "NSolid <nsolid-gpg@nodesource.com>"
#18 6.768  Fingerprint: 6F71 F525 2828 41EE DAF8 51B4 2F59 B5F9 9B1B E0B4
#18 6.768  From       : /etc/pki/rpm-gpg/NODESOURCE-NSOLID-GPG-SIGNING-KEY-EL
#18 6.792 Key imported successfully
#18 6.996 Import of key(s) didn't help, wrong key(s)?
#18 6.997 Public key for nodejs-20.10.0-1nodesource.x86_64.rpm is not installed. Failing package is: nodejs-2:20.10.0-1nodesource.x86_64
#18 6.997  GPG Keys are configured as: file:///etc/pki/rpm-gpg/NODESOURCE-NSOLID-GPG-SIGNING-KEY-EL
#18 6.998 The downloaded packages were saved in cache until the next successful transaction.
#18 6.998 You can remove cached packages by executing 'dnf clean packages'.
#18 7.019 Error: GPG check FAILED
#18 ERROR: process "/bin/sh -c dnf install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1" did not complete successfully: exit code: 1

Distribution Information:

Node Version:

To Reproduce Steps to reproduce the behavior:

FROM amazonlinux:2023
RUN dnf remove -y nodejs npm
RUN dnf install https://rpm.nodesource.com/pub_20.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
RUN dnf install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1

Expected behavior Installation succeeds, as it did until Jan 2 2024.

Update Using the following steps seems to fix the problem:

RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
RUN dnf install -y nodejs

I am not sure where the previous steps came from - perhaps when the nodesource "regular" install was not properly supporting amazonlinux:2023

If the old steps are invalid and the correct steps now work, perhaps this can be closed.

timd73 commented 8 months ago

Updated the bug description with steps to solve the problem. Perhaps it's not a bug. Leaving open for someone on the nodesource team to review.

kmonty commented 8 months ago

Experiencing the same issue on Node.js 18.x, nodesource-release-nodistro-1.noarch

acastruc commented 8 months ago

Same with 18.x on Rocky8 I tried

sudo yum install https://rpm.nodesource.com/pub_20.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
sudo yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1         

and this gave me the error

Downloading Packages: nodejs-20.10.0-1nodesource.x86_64.rpm 73 MB/s | 36 MB 00:00
Total 73 MB/s | 36 MB 00:00
warning: /var/cache/dnf/nodesource-nodejs-cd8becc9b2a5d74b/packages/nodejs-20.10.0-1nodesource.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3af28a14: NOKEY Node.js Packages for Linux RPM based distros - 1.6 MB/s | 1.7 kB 00:00
Importing GPG key 0x9B1BE0B4: Userid : "NSolid nsolid-gpg@nodesource.com" Fingerprint: 6F71 F525 2828 41EE DAF8 51B4 2F59 B5F9 9B1B E0B4 From : /etc/pki/rpm-gpg/NODESOURCE-NSOLID-GPG-SIGNING-KEY-EL Key imported successfully Import of key(s) didn't help, wrong key(s)? Public key for nodejs-20.10.0-1nodesource.x86_64.rpm is not installed. Failing package is: nodejs-2:20.10.0-1nodesource.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/NODESOURCE-NSOLID-GPG-SIGNING-KEY-EL

I changed it to

 sudo curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
 sudo dnf install -y nodejs

and that worked did not work. edit: worked (was missing sudo) Curious if there is a way to make it work with yum?

renanfferreira commented 8 months ago

I'm facing the same problem

JesusPaz commented 8 months ago

Now you need to use the script to install Node.js:

curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
yum install -y nodejs
renanfferreira commented 8 months ago

This works, thank you

maunzCache commented 8 months ago

You should prefer dnf over yum in amazonlinux2023, thus make it

curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
dnf install -y nodejs

https://docs.aws.amazon.com/linux/al2023/ug/package-management.html

paulrutter commented 8 months ago

I'm facing the same issue recently on AL2023 (since 2024, before it worked fine), and followed the instructions mentioned on https://github.com/nodesource/distributions/wiki/How-to-select-the-Node.js-version-to-install to pin to a specific node version.

Any help is appreciated.

RUN yum install -q -y https://rpm.nodesource.com/pub_20.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm && \
  yum install -q -y nodejs-20.9.0-1nodesource --setopt=nodesource-nodejs.module_hotfixes=1

Seems like a duplicate of https://github.com/nodesource/distributions/issues/1755

AngelicaFWhite commented 8 months ago

Our Beanstalk deployment also started failing because of the same issue. original: sudo dnf upgrade -y command: sudo dnf install https://rpm.nodesource.com/pub_18.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y changed: command: curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - command: dnf install -y nodejs

However it isn't installing node js 18.19.x How can change to request the newer version installation? Thank you for the support.

tgy commented 7 months ago

this is still an issue. i'm trying to install 21 on Rocky Linux 9 and I get this error as well.

@JesusPaz why did you close this?

riosje commented 7 months ago

@tgy what's the error? I just tried it and everything works.

run -it  rockylinux:9 bash
curl -fsSL https://rpm.nodesource.com/setup_21.x | bash -
yum install -y nodejs
Installed:
  nodejs-2:21.6.1-1nodesource.x86_64

Complete!
[root@55c2d9a54553 /]# node -v
v21.6.1
tgy commented 7 months ago

sorry my bad @riosje it works now!