Open rioastamal opened 1 year ago
@rioastamal I'm facing the same issue when trying to provision the instance despite modifying adding the echo command. Any idea how I could further diagnose this? Your comment is the only info I could find regarding this issue...
Hi @FluffyCheeks, my suggestion is during the CREATE_IN_PROGRESS of EC2Instance resource try to see on EC2 dashboard if the instance is in Running state. If it does just try to SSH in and do some quick debugging. To prevent the terminated by CloudFormation you can send signal to CloudFormation that the EC2 is fine and ready to use.
/usr/local/bin/cfn-signal --success true --stack CF_STACK_ID --resource EC2Instance --region REGION
Hi @rioastamal, really appreciate your response, am new to this so knowing that the signal to stop the termination can be sent from the instance was really helpful. It appears to be issues with setup/nextcloud.sh failing to wget the installation package, which causes all subsequent steps to fail, specifically when it tries to run
wget_verify https://download.nextcloud.com/server/releases/nextcloud-$version.zip $hash /tmp/nextcloud.zip.
when running InstallNextcloud()
. Will have to look into this further. Again thanks for pointing me in the right direction.
I tried @rioastamal fix but it still fails to create the instance correclty. Anybody else got this working?
Hello! I am trying to implement this solution following the steps described here: https://aws.amazon.com/es/blogs/opensource/fully-automated-deployment-of-an-open-source-mail-server-on-ay/ I need to migrate all my emails from Gandi, therefore I am not configuring my domain (DNS, Glue Records), I plan to do that later when the solution is active.
However, the CloudFormation stack fails to complete.
I'm wondering if this is because my domain is not set up yet or is there some other reason it could be failing?
I would appreciate if you could guide me to solve my problem, any ideas?
Did you use the most recent version of the CloudFormation template from my PR above (as opposed to the hitting the "Launch" Button from the Blogpost that still references the old version)?
Thank you @mmeidlinger I did try to use your template. I downloaded it, then uploaded it to CloudFormation. Same situation, the process fails to complete. I have reviewed everything, static IP, buckets... The only thing I have not done is change the configuration of my domain. Do you think it has something to do with it ?
Issue
CloudFormation always fail when provisioning EC2 instance.
Expected
CloudFormation should be able to provision all the resources.
Details
I've tried the steps found at https://aws.amazon.com/blogs/opensource/fully-automated-deployment-of-an-open-source-mail-server-on-aws/.
It turn out caused by the installation script issuing
sudo
command which took long and caused CloudFormation to timed-out. The sudo trying to resolve the hostname but it does not written on/etc/hosts
. So to execute a singgle command it took ages to complete and gives warning:Several script such as setup/nextcloud.sh uses sudo to run several commands.
Fixes
My fix is simple, I modify EC2 userdata on CloudFormation template and write the hostname to
/etc/hosts
file.