Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chmod in .ebextensions on AWS Elastic Beanstalk failing

I'm trying to automate the setup of my Symfony2 Application using the .ebextensions *.config files but its failing when I try to execute a chmod. This is my first time on AWS so I've hit a bit of a wall

Here is the config of my symfony.config file in .ebextensions:

container_commands:
  01_chmod_cache:
    command: chmod -fR 777 /var/app/current/app/cache
  02_chmod_logs:
    command: chmod -fR 777 /var/app/current/app/logs
  03_db_migrate:
    command: php /var/app/current/app/console doctrine:schema:update  --env=prod --force
  04_update_assets:
    command: php /var/app/current/app/console assetic:dump --env=prod --no-debug
  05_clear_cache:
    command: php /var/app/current/app/console cache:clear --env=prod --no-debug

I can run all of those commands on CLI when I ssh in. When I review the logs I get the following which isn't very helpful Error occurred during build: Command 01_chmod_cache failed

I think it might have something to do with the user thats executing commands but I don't know where I can configure this

Can anyone assist ?

Cheers.

like image 996
Patty Fong Avatar asked Dec 04 '13 05:12

Patty Fong


People also ask

How do I change my environment in Elastic Beanstalk?

To change your environment's capacityOpen the Elastic Beanstalk console , and in the Regions list, select your AWS Region. In the navigation pane, choose Environments, and then choose the name of your environment from the list. If you have many environments, use the search bar to filter the environment list.

When should you not use Elastic Beanstalk?

Elastic Beanstalk isn't great if you need a lot of environment variables. The simple reason is that Elastic Beanstalk has a hard limit of 4KB to store all key-value pairs. The environment had accumulated 74 environment variables — a few of them had exceedingly verbose names.


1 Answers

Maybe adding quotes to your commands will help:

container_commands: 
    01_chmod_cache: 
        command: "chmod -fR 777 /var/app/current/app/cache"
like image 109
kukido Avatar answered Oct 11 '22 13:10

kukido