node.js - 没有可用的 Nodejs 包。 Elastic Beanstalk 上的错误 : Nothing to do. Rails 应用程序

标签 node.js ruby-on-rails amazon-web-services amazon-elastic-beanstalk ruby-on-rails-6

我在 Elastic Beanstalk 上使用 Rails 6 应用程序已超过 6 个月,没有出现任何问题。昨天,在部署一些更改后,构建突然开始失败,因为它无法安装 NodeJs,这与我之前部署的更改无关。

我有用于 eb 配置的 01_download_nodejs02_install_nodejs 命令,自从我大约 6 个月前第一次设置应用程序以来,它们一直没有更改。

cfn-init.log 文件中显示以下内容:

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

cfn-init-cmd.log 文件中显示以下内容:

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:

命令:“curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo -E bash -”

02_install_nodejs:

命令:“yum -y 安装nodejs”

Elastic Beanstalk 平台版本:3.3.5

最佳答案

您遇到的问题可能是由于 SSL 证书过期所致,如下所述:https://aws.amazon.com/premiumsupport/knowledge-center/ec2-expired-certificate/

您可以使用 .ebextensions 中安装最新证书的文件来解决此问题。例如,对于 Amazon Linux 1:

commands:
  00_ssl_certs:
    command: yum -y install https://cdn.amazonlinux.com/patch/ca-certificates-update-2021-09-30/ca-certificates-2018.2.22-65.1.24.amzn1.noarch.rpm

关于node.js - 没有可用的 Nodejs 包。 Elastic Beanstalk 上的错误 : Nothing to do. Rails 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69415453/

相关文章:

amazon-web-services - 是否可以通过 Cloudformation 在 AWS datapipeline 中创建数组管道对象?

amazon-web-services - Elastic beanstalk动态创建和删除单个实例的警报

node.js - 丢失的 Mongoose Schema 属性仍在返回中

node.js - NodeJS - sqlite3,数据同步

javascript - 比较字符串中的非英文字符

javascript - 多个代理可以同时使用唯一的 Twilio 号码吗?

javascript - rails : hide/close a rendered partial through a button in that partial

ruby-on-rails - 如何以表格形式显示Rails ActiveRecord模型的序列化Array属性?

javascript - 如何使用 AngularJS、Devise 和 UI Router 全局实现身份验证?

scala - AWS EMR 添加步骤 : How to add multiple jars from s3 in --jars and --driver-class-path options?