简体   繁体   中英

EB not able to access file in .ebextensions

I have the following container_command in my django.config that points to a script at path .ebextensions/supervise.sh :

container_commands:
  01-supervise:
    command: .ebextensions/supervise.sh

However when I deploy I get a permission error. Command failed on instance. Return code: 126 Output: /bin/sh: .ebextensions/supervise.sh: Permission denied.

I'm wondering what is required to set permissions correctly? What is causing this error? As far as I can tell the issue isn't well documented. Thanks!

If you are using Windows, it looks like scripts lose their executable bit when packing/unpacking them.

Try resetting the executable bit before running them:

container_commands:
  01-set-exec-bit:
    command: chmod +x .ebextensions/deployschema.sh
    test: "[ -f .ebextensions/deployschema.sh ]"
  02-create-table:
    command: ".ebextensions/deployschema.sh"
    leader_only: true

From: https://forums.aws.amazon.com/thread.jspa?threadID=262121

First of all do not put you.sh files in.ebextensions folder. Create a separate folder in your app root and put it there. And update the.config file with following:

container_commands:
  01-supervise:
    command: "sh scripts/supervise.sh"

I know i am late in answering this but hopefully this will help someone struggling with this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM