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
질문됨 한 달 전713회 조회
2개 답변
0
수락된 답변

Ultimately, we had to abandon this environment, clone our staging one, and re-build necessary configuration from there. It may have been possible to remove the nodesource repo from yum's configuration folder and add the v16 one instead, but I'll never know.

Pete
답변함 11일 전
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
전문가
shibata
답변함 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠