I've been using my Rails 6 app on Elastic Beanstalk for more than 6 months with no issue. Suddenly yesterday after deploying some changes the build started to fail due to it not being able to install NodeJs, which is not related to the changes I'd deployed earlier.
I have 01_download_nodejs and 02_install_nodejs commands for eb configs and they haven't been changed since I've setup the app for the first time around 6 months ago.
In cfn-init.log file it shows the following:
2021-10-02 08:46:19,017 [INFO] Command 01_download_nodejs succeeded
2021-10-02 08:46:23,515 [ERROR] Command 02_install_nodejs (yum -y install nodejs) failed
2021-10-02 08:46:23,516 [ERROR] Error encountered during build of prebuild_2_sst_app:
Command 02_install_nodejs failed
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 573, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 273, in build
self._config.commands)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command 02_install_nodejs failed
2021-10-02 08:46:23,516 [ERROR] -----------------------BUILD FAILED!------------------------
2021-10-02 08:46:23,516 [ERROR] Unhandled exception during build: Command
02_install_nodejs failed
Traceback (most recent call last):
File "/opt/aws/bin/cfn-init", line 176, in <module>
worklog.build(metadata, configSets)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 135, in build
Contractor(metadata).build(configSets, self)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 561, in build
self.run_config(config, worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 573, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 273, in build
self._config.commands)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command 02_install_nodejs failed
In cfn-init-cmd.log file it shows the following:
2021-10-02 08:46:18,976 P22197 [INFO] Command 01_download_nodejs
2021-10-02 08:46:19,017 P22197 [INFO] Completed successfully.
2021-10-02 08:46:19,017 P22197 [INFO]
============================================================
2021-10-02 08:46:19,017 P22197 [INFO] Command 02_install_nodejs
2021-10-02 08:46:23,514 P22197 [INFO] -----------------------Command Output-----------------------
2021-10-02 08:46:23,515 P22197 [INFO] Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
2021-10-02 08:46:23,515 P22197 [INFO] No package nodejs available.
2021-10-02 08:46:23,515 P22197 [INFO] Error: Nothing to do
2021-10-02 08:46:23,515 P22197 [INFO] ------------------------------------------------------------
2021-10-02 08:46:23,515 P22197 [ERROR] Exited with error code 1
01_download_nodejs:
command: "curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo -E bash -"
02_install_nodejs:
command: "yum -y install nodejs"
Elastic Beanstalk Platform Version: 3.3.5