eb-php-wordpress: Error occurred during build: Command 01_mount failed

Tried this, set the vpc and subnet, but got this error, not sure why yet…

2020-05-20 16:51:17,029 [INFO] -----------------------Starting build-----------------------
2020-05-20 16:51:17,035 [INFO] Running configSets: _OnInstanceBoot
2020-05-20 16:51:17,038 [INFO] Running configSet _OnInstanceBoot
2020-05-20 16:51:17,041 [INFO] Running config AWSEBBaseConfig
2020-05-20 16:51:17,165 [INFO] Command clearbackupfiles succeeded
2020-05-20 16:51:17,169 [INFO] Running config AWSEBCfnHupEndpointOverride
2020-05-20 16:51:17,173 [INFO] Command clearbackupfiles succeeded
2020-05-20 16:51:17,174 [INFO] ConfigSets completed
2020-05-20 16:51:17,174 [INFO] -----------------------Build complete-----------------------
2020-05-20 16:52:07,557 [INFO] -----------------------Starting build-----------------------
2020-05-20 16:52:07,564 [INFO] Running configSets: Infra-EmbeddedPreBuild
2020-05-20 16:52:07,567 [INFO] Running configSet Infra-EmbeddedPreBuild
2020-05-20 16:52:07,569 [INFO] Running config prebuild_0_spectre_blog
2020-05-20 16:52:11,566 [ERROR] Command 01_mount (/tmp/mount-efs.sh) failed
2020-05-20 16:52:11,566 [ERROR] Error encountered during build of prebuild_0_spectre_blog: Command 01_mount failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
    CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
    changes['commands'] = CommandTool().apply(self._config.commands)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
    raise ToolError(u"Command %s failed" % name)
ToolError: Command 01_mount failed
2020-05-20 16:52:11,567 [ERROR] -----------------------BUILD FAILED!------------------------
2020-05-20 16:52:11,567 [ERROR] Unhandled exception during build: Command 01_mount failed
Traceback (most recent call last):
  File "/opt/aws/bin/cfn-init", line 171, in <module>
    worklog.build(metadata, configSets)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 129, in build
    Contractor(metadata).build(configSets, self)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 530, in build
    self.run_config(config, worklog)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
    CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
    changes['commands'] = CommandTool().apply(self._config.commands)
  File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
    raise ToolError(u"Command %s failed" % name)
ToolError: Command 01_mount failed

About this issue

Most upvoted comments

Hello All, I have found a solution and I have been able to successfully mount an efs drive to aws elasticbeans running on ami v2.

Steps:

  1. Create a local directory in your application source code root called ‘my_efs’
  2. Create an EFS file system from the aws EFS dashboard, select the default VPC, choose the subnets and the security group.
  3. To allow connections, edit the security group rules for the file system. The rules must allow inbound connections on port 2049 (Network File System or NFS) from the security group for instances in your Elastic Beanstalk environment.
  4. Update the instance security group to allow outbound connections on port 2049 to the Amazon EFS security group.
  5. In my setup, I have both the ec2 instance, and the efs on the same region and same availability zone.
  6. Edit the ‘env_var.config’ with your <EFS_FILE_SYSTEM_ID> and <EFS_MOUNT_DIR> values
  7. Make sure you have the script mount-efs.sh’ is inside ‘.platform/hooks/postdeploy’ at the root of your elasticbeans’s project root directory. No need to alter anything in this script.
  8. Deploy the application, and you have read/write access to the folder ‘my_efs’ inside the root of your application, where the content of ‘my_efs’ dir actually resides in your EFS persistent storage on AWS.
  9. The application will access ‘my_efs’ folder normally as if it is located on the same machine.
  10. For elasticbeans application, you can find the app dir in the ec2 in this location ‘/var/app/current/’ and the ‘my_efs’ folder will be in ‘/var/app/current/my_efs/’

files are located here: my github repo Thank you,

@deeptirajput2 @ray-moncada @kenoxx83 @amarathota @tebayoso @jmosbech @jpswade

Another workaround that I’ve found is to Environment Configuration and type “/” in Document root box. I didn’t have anything before there, and after I completed it worked like a charm!

@amarathota My solution only applies if you use Amazon Elastic Beanstalk. When you create the main instance, you need to go to Environment Configuration and set the Document root option to “/” (it is NULL initially). I hope that will help you.

I don’t see a Document Root setting anywhere in EB… image

I found it on > Configuration > Software , under Nginx.

@amarathota My solution only applies if you use Amazon Elastic Beanstalk. When you create the main instance, you need to go to Environment Configuration and set the Document root option to “/” (it is NULL initially). I hope that will help you.

I don’t see a Document Root setting anywhere in EB… image

@amarathota My solution only applies if you use Amazon Elastic Beanstalk. When you create the main instance, you need to go to Environment Configuration and set the Document root option to “/” (it is NULL initially). I hope that will help you.