Open jpswade opened 4 years ago
Looks like the changes from here are needed:
Did those changes worked for you? I'm still receiving the error.
We're seeing the exact same issue when trying to mount an efs volume on a Docker platform:
Looking at /var/log/cfn-init-cmd.log
reveals this:
2020-06-07 13:54:47,011 P5815 [INFO] /tmp/mount-efs.sh: line 4: /opt/elasticbeanstalk/bin/get-config: No such file or directory
2020-06-07 13:54:47,011 P5815 [INFO] Mounting EFS filesystem to directory ...
2020-06-07 13:54:47,011 P5815 [INFO] Stopping NFS ID Mapper...
2020-06-07 13:54:47,011 P5815 [INFO] rpc.idmapd is already stopped!
2020-06-07 13:54:47,011 P5815 [INFO] Checking if EFS mount directory exists...
2020-06-07 13:54:47,012 P5815 [INFO] Directory already exists!
2020-06-07 13:54:47,012 P5815 [INFO] mount -t efs -o tls :/
2020-06-07 13:54:47,012 P5815 [INFO] mount: :/: can't find in /etc/fstab.
So it seems that the /opt/elasticbeanstalk/bin/get-config
does not exist.
A workaround was to simply change these lines in storage-efs-mountfilesystem.config
:
EFS_MOUNT_DIR=$(/opt/elasticbeanstalk/bin/get-config environment -k MOUNT_DIRECTORY)
EFS_FILE_SYSTEM_ID=$(/opt/elasticbeanstalk/bin/get-config environment -k FILE_SYSTEM_ID)
to
EFS_MOUNT_DIR='/efs'
EFS_FILE_SYSTEM_ID='fs-xxxxxxxx'
@jmosbech I see the same issue. Did you find any solution?
I forgot I had posted this here, I posted the solution over here:
https://github.com/awsdocs/elastic-beanstalk-samples/issues/120#issuecomment-636009209
Thank you!!
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!
@hopingsteam do you mind posting the full solution? thanks!
@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.
Thanks @hopingsteam, this solved my problem too.
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!
Hi I have the same issue than @jpswade but I couldnt fix it with the solution:
awsdocs/elastic-beanstalk-samples#120 (comment)
Please your help
2021-07-07 05:06:34,138 [INFO] Running config AWSEBBaseConfig
2021-07-07 05:06:34,389 [INFO] Command clearbackupfiles succeeded
2021-07-07 05:06:34,393 [INFO] Running config AWSEBCfnHupEndpointOverride
2021-07-07 05:06:34,397 [INFO] Command clearbackupfiles succeeded
2021-07-07 05:06:34,398 [INFO] ConfigSets completed
2021-07-07 05:06:34,398 [INFO] -----------------------Build complete-----------------------
2021-07-07 05:06:40,988 [INFO] -----------------------Starting build-----------------------
2021-07-07 05:06:41,045 [INFO] Running configSets: Infra-EmbeddedPreBuild
2021-07-07 05:06:41,066 [INFO] Running configSet Infra-EmbeddedPreBuild
2021-07-07 05:06:41,080 [INFO] Running config prebuild_0_test
2021-07-07 05:06:41,088 [INFO] ConfigSets completed
2021-07-07 05:06:41,088 [INFO] -----------------------Build complete-----------------------
2021-07-07 05:06:50,563 [INFO] -----------------------Starting build-----------------------
2021-07-07 05:06:50,570 [INFO] Running configSets: Infra-EmbeddedPostBuild
2021-07-07 05:06:50,572 [INFO] Running configSet Infra-EmbeddedPostBuild
2021-07-07 05:06:50,573 [INFO] ConfigSets completed
2021-07-07 05:06:50,573 [INFO] -----------------------Build complete-----------------------
2021-07-07 05:18:56,983 [INFO] -----------------------Starting build-----------------------
2021-07-07 05:18:56,989 [INFO] Running configSets: Infra-EmbeddedPreBuild
2021-07-07 05:18:56,992 [INFO] Running configSet Infra-EmbeddedPreBuild
2021-07-07 05:18:56,995 [INFO] Running config prebuild_0_test
2021-07-07 05:18:56,999 [INFO] Running config prebuild_1_test
2021-07-07 05:19:05,513 [INFO] Yum installed ['amazon-efs-utils']
2021-07-07 05:19:05,857 [ERROR] Command 01_mount (/tmp/mount-efs.sh) failed
2021-07-07 05:19:05,857 [ERROR] Error encountered during build of prebuild_1_test: Command 01_mount failed
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 573, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 273, in build
self._config.commands)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command 01_mount failed
2021-07-07 05:19:05,860 [ERROR] -----------------------BUILD FAILED!------------------------
2021-07-07 05:19:05,860 [ERROR] Unhandled exception during build: Command 01_mount failed
Traceback (most recent call last):
File "/opt/aws/bin/cfn-init", line 176, in
@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..
@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..
I found it on > Configuration > Software , under Nginx.
After Adding
EFS_MOUNT_DIR='/efs'
EFS_FILE_SYSTEM_ID='fs-xxxxxxxx'
to environment variables, it worked for me
Hi,
I changed above 2 paths(EFS_MOUNT_DIR='/efs' EFS_FILE_SYSTEM_ID='fs-xxxxxxxx') but still getting below error
cfnbootstrap.construction_errors.ToolError: Command 01_mount failed
2022-12-30 15:24:57,934 [ERROR] -----------------------BUILD FAILED!------------------------
2022-12-30 15:24:57,934 [ERROR] Unhandled exception during build: Command 01_mount failed
Traceback (most recent call last):
File "/opt/aws/bin/cfn-init", line 181, in
Please help.
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:
files are located here: my github repo Thank you,
@deeptirajput2 @ray-moncada @kenoxx83 @amarathota @tebayoso @jmosbech @jpswade
Tried this, set the vpc and subnet, but got this error, not sure why yet...