提问者:小点点

弹性Beanstalk平台挂钩因“权限被拒绝”而失败


在部署ElasticBeanstalk应用程序时,我的一个钩子失败,“权限被拒绝”。我在/var/log/eb-engine.log中获得以下内容:

[信息]正在运行的平台钩子:.平台/钩子/预部署/collectstatic.sh

[错误]执行命令[app-部署]-[RunAppDeployPreDeployHooks]时出错。停止运行命令。错误:命令.平台/钩子/预部署/predeploy.sh 失败,错误为fork/exec.平台/钩子/预部署/predeploy.sh:权限被拒绝

我该如何修复?


共2个答案

匿名用户

根据文档,平台挂钩需要是可执行的。当然,这意味着它们需要根据git执行,因为这就是ElasticBeanstalk用来部署的。

您可以通过< code > git ls-files-s . platform 检查它们是否可执行;在该命令的输出中,您应该在任何shell文件之前看到< code>100755。如果在任何shell文件之前看到< code>100644,请运行< code>git add - chmod= x -。平台/*/*/*。sh使它们可执行。

匿名用户

在.eextensions文件夹下按正确顺序创建一个文件,并将其命名为:001_chmod.config

  # This command finds all the files within hooks folder with extension .sh and makes them executable.
container_commands:
  01_chmod1:
    command: find .platform/hooks/ -type f -iname "*.sh" -exec chmod +x {} \;

资料来源:https://www.barot.us/running-sidekiq-on-amazon-linux-2/