EB Deployment fails - running old platform hooks

0

I ran into an error deploying some changes to my platform hooks, which were to install NodeJS 18, but deployment failed because this is incompatible with the current platform. So I decided to do the usual solution: deploy the previous application version, which has hook scripts to install NodeJS 15 instead. However when I did this, deployment failed again with the same error message: "Error: Package: 2:nodejs-18.20.2-1nodesource.x86_64 (nodesource-nodejs) Requires: libc.so.6(GLIBC_2.28)(64bit)", as if ElasticBeanstalk were running the new, bugged hook scripts instead of the old ones in the application version that I wanted to deploy.

I have also tried using the EB CLI to deploy the previous version of the application with the older, working hooks, but the logs report the same error. I know the platform is retired, but I cannot update it at this time, because I risk major incompatibilities with the site. Up until now, deployment and deploying old application versions has not been an issue. The EC2 instances are managed with an Application Load Balancer, and I am unable to SSH directly to any instance to rectify the problem that way.

Now the entire website has been down for over an hour and I cannot restore it, because EB is running the wrong platform hook scripts, and will not recognize any changes that I make to the hooks. How can I actually restore my website? I'm happy to provide any further clarifying information or log messages that will help resolve this issue quickly, but again: I cannot update the platform at this time. Thank you.

Update: despite accessing the instances via SSH and totally removing nodejs from the yum install command, deployment is still trying to install node with yum. How do I remove or replace the hook scripts?

Here are the relevant lines in the prebuild hook shell script

# Install necessary packages.
yum install -y git htop zsh tmux nfs-utils rpcbind libtool jq util-linux-user amazon-efs-utils system-rpm-config docker unzip

# Use nvm for nodejs
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -
nvm install '15'

and the result in the logs

2024/05/01 15:07:43.781980 [INFO] Error: Package: 2:nodejs-18.20.2-1nodesource.x86_64 (nodesource-nodejs)
           Requires: libm.so.6(GLIBC_2.27)(64bit)

I've explicitly removed nodejs through yum on all instances and the load balancer just to be sure.

Pete
asked 21 days ago599 views
1 Answer
0

The message Requires: libm.so.6(GLIBC_2.27)(64bit) indicates that you do not have the required glibc version installed for NodeJS 18. If you get this error, I assume you are using Amazon Linux2 environment. Unfortunately, AL2 does not support the required glibc version by default.

https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html#glibc-gcc-and-binutils

The solution is to switch to a newer OS (or use a container such as Docker).

As a more realistic solution, how about trying to install NodeJS 16? I have not tested it, but it may be buildable. (As you know, NodeJS 16 is EOL, so I recommend moving to 18 in the future.)

profile picture
EXPERT
shibata
answered 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions