I’ve been working on setting up the Quick Start Installation Guide on GCP with someone and multiple time we have been stuck when running the set up of the Iglu Server because of terraform timeout error.
I know that there is multiple timeout error post but I think that what I’ve been facing here was a bit different.
Basically the first time we were running the terraform apply cmd was failing and working the second time (with exactly the same configuration). What I think happens is that the Cloud SQL Instances takes too long to initiate at first then is faster during the second run.
One way to fix this would be to extend the terraform timeout by 5min.
I don’t know if what I’m saying make sense. I’m sharing my experience (with multiple test). Hopefully it can help.
Hi Timo, yeah as Simon said itis linked to the timing of the SQL warm up ( First attempt takes systematically more than 20 minutes. If you leave your instance live and restart your terraform apply, it bugs too. You need to delete it before applying the plan again.
Hi @simonbreton appreciate the feedback on this. CloudSQL is for sure not the fastest service! Although in all my tests I never hit the timeout of 30 minutes - which region where you using in your deployments?
@dsolito would you mind sharing the exact steps you take to resolve this? Is it that on the first apply it hits a timeout and then on the second one you are somehow cleaning the state up so that it can use the deployed instance?
Hi @josh. I did 3 projects and each time the first attempt never pass the timeout (it’s 2-3 minutes after the 20minutes that the instance is ready). The solution is to delete the instance and run terraform apply again. If you don’t delete the instance, terraform waits for a running message that never come (the state is not adapted because the server is ready after the timeout). You just need to pray that it takes shorter time to be ready. To be more precise I don’t modify the tfstate file.
Just bump the Cloud SQL module to v0.1.1 and the timeout problem should be solved for your deployments. If someone has time to give it a test drive to validate would be great!