How I went from adding a single function to a Node.js webapp to changing the operating system of the EC2

Ishak M. B (Isaak)
3 min readDec 7, 2022

The VM I am using has these features:

  • Operating system Amazon Linux 2
  • Backend hosted in my EC2 with a Codedeploy pipeline between AWS and Github
  • I have an elastic IP Address
  • Webapp has a website and a mobile app
  • Frontend is hosted in another EC2 instance
  • I have a script that does the automation of the build and deployment each time I push to GitHub: application_start.sh, application_stop.sh, before_install.sh…etc

I wanted to do some minor changes to my backend one of them was adding .utc() but I could not, the server was outputting [stderr] due to glibc (GLIBC provides the core libraries for systems that uses Linux as a system, and other libraries are dependent on it) as shown in the image bellow:

Report from the deployment logs

stderr: standard error is a message that points out each time there is an error

You could see that those libraries are required by node.

After doing some thorough research about this issue, I have seen that it is not possible to upgrade the latest glibc, and Amazon Linux 2 only 2.26 as shown in the re:Post Amazon questions:
https://repost.aws/questions/QUrXOioL46RcCnFGyELJWKLw/glibc-2-27-on-amazon-linux-2.

The only solution now is to change the operating system as I am in need to for those glibc. I contacted the Amazon technical support in order to see their opinion, maybe they could suggest a solution other than changing the operating system. They said the only solution is to change the operating system as shown their response email:

Response to my ticket

Note that the technical tickets are not free, you have to pay for a monthly subscription -I chose the Developer subscription- for 29$.

Now I am going to create another EC2 instance with all the conifgs mentioned above except for the operating system which I will change to Ubuntu (creating a new instance with Ubuntu server is easy the internet is full with demos). After that I will try to link my Elastic IP, RDS, and everything to the newly created virtual machine.

Keep in mind that arriving to this solution took a bit of time, since I have the app on production, there are developer who are still facing this problem and they do not know what to do, and the solution is basically doing a migration of the app, If you would like to see how I automated my deployment for this one check out this article

I would not recommend using Amazon Linux 2 as it does not support one of the main libraries, and I have not made further research about other problems, if you are using Node.js I do not think it will support your app unless your app is built with lower version libraries, which is not recommended as vulnerabilities will arise

Thank you for reading and if you have any suggestions please point them out.

--

--

Ishak M. B (Isaak)

Certified IT Support Specialist, Developer, Junior Cyber Security Researcher, I like manipulating code, Tech Volunteer, Interested also in Cloud & Data Analysis