gpt4 book ai didi

amazon-web-services - 将环境变量添加到 NodeJS Elastic Beanstalk 时出错

转载 作者:行者123 更新时间:2023-12-04 08:13:47 24 4
gpt4 key购买 nike

我的配置一直工作到昨天。我添加了 nginx NodeJS https redirect extension from AWS .现在,当我尝试通过 Elastic Beanstalk 配置添加新的环境变量时,出现以下错误:

[Instance: i-0364b59cca36774a0] Command failed on instance. Return code: 137 Output: + rm -f /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf + service nginx stop Stopping nginx: /sbin/service: line 66: 27395 Killed env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}. Hook /opt/elasticbeanstalk/hooks/configdeploy/post/99_kill_default_nginx.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

当我查看 eb-activity.log 时,我看到了这个错误:
[2018-02-18T17:24:58.762Z] INFO  [13848] - [Configuration update 1.0.61@112/ConfigDeployStage1/ConfigDeployPostHook/99_kill_default_nginx.sh] : Starting activity...
[2018-02-18T17:24:58.939Z] INFO [13848] - [Configuration update 1.0.61@112/ConfigDeployStage1/ConfigDeployPostHook/99_kill_default_nginx.sh] : Activity execution failed, because: + rm -f /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf
+ service nginx stop
Stopping nginx: /sbin/service: line 66: 14258 Killed env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} (ElasticBeanstalk::ExternalInvocationError)
caused by: + rm -f /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf
+ service nginx stop
Stopping nginx: /sbin/service: line 66: 14258 Killed env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} (Executor::NonZeroExitStatus)

我究竟做错了什么?自从几个月前我更改了环境变量时,这一切正常,最近发生了什么变化。

最佳答案

我也遇到了这个问题,亚马逊承认了文档中的错误。这是一个可以在 .ebextensions 配置文件中使用的有效重启脚本。

  /opt/elasticbeanstalk/hooks/configdeploy/post/99_kill_default_nginx.sh:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash -xe
rm -f /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf
status=`/sbin/status nginx`

if [[ $status = *"start/running"* ]]; then
echo "stopping nginx..."
stop nginx
echo "starting nginx..."
start nginx
else
echo "nginx is not running... starting it..."
start nginx
fi

关于amazon-web-services - 将环境变量添加到 NodeJS Elastic Beanstalk 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48854707/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com