Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS RDS provisioning times out #438

Closed
wilb opened this issue Oct 17, 2014 · 14 comments
Closed

AWS RDS provisioning times out #438

wilb opened this issue Oct 17, 2014 · 14 comments

Comments

@wilb
Copy link

wilb commented Oct 17, 2014

I have a config block like:

resource "aws_db_instance" "test" {
    identifier = "test"
    db_subnet_group_name = "test"
    engine = "mysql"
    engine_version = "5.6.19"
    instance_class = "db.t2.small"
    multi_az  = true
    allocated_storage = "50"
    name = "test"
    username = "root"
    password = "password"
    vpc_security_group_ids  = [ "${aws_security_group.test-db-servers.id}", "${aws_security_group.test-app-servers.id}" ]
    backup_retention_period = 7
}

The provisioning will stall for a while (the instance creation does happen as expected) and eventually bail with:

aws_db_instance.test: Error: timeout while waiting for state to become 'available'
Error applying plan:

1 error(s) occurred:

 * timeout while waiting for state to become 'available'

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

I've tried creating this with publicly_accessible = "true" set but this doesn't help. The instance is created as expected, but in the AWS console it is still at the modifying stage for a good while after creation has timed out at the console. Is this just simply a need to increase the timeout,?

Obviously this leaves terraform in a state of inconsistency; I'm having to comment out my db instance provisioning after initial creation otherwise terraform then tries to recreate an already existing host.

@wilb
Copy link
Author

wilb commented Oct 17, 2014

Actually having just double checked the ultimate outcome what actually happens when you run terraform apply again is that it deletes the instance it's created (but thinks has failed):

aws_db_instance.test: Destruction complete
Apply complete! Resources: 0 added, 1 changed, 1 destroyed.

Interestingly even though this operation takes a long time too there is no timeout reported here.

Commenting out the host after provisioning doesn't help either as then terraform thinks I want to delete the host, resulting in it being destroyed anyway. So currently it's impossible to actually provision an RDS instance for me.

I'm using the latest codebase built this morning after #410 was fixed.

@pearkes
Copy link
Contributor

pearkes commented Feb 27, 2015

Should be less frequent, increased the DB instance timeout to 40 minutes in 6f27f90

@geekmuse
Copy link

Still seeing this behavior even at the 40 minute threshold, particularly with SQL Server RDS instances

@JonRoma
Copy link

JonRoma commented Aug 26, 2016

Seeing this with Terraform v0.7.2 and Oracle SE2 12.1.0.2.v4 RDS in a db.t2.micro instance type.

Times out right at 40 minutes.

@ossareh
Copy link

ossareh commented Sep 1, 2016

@pearkes it's not so much the timeout that is the issue, it's that any treatment to the RDS instance is then delayed until the next run. The timeout itself feels like it should be a variable; is that reasonable?

@mattsoftware
Copy link

I am seeing this too. Trying to restore an aurora instance with a large snapshot, takes over 40 minutes to do, but does complete. After the cluster is created, and terraform is re-run, it first destroys the cluster and then tries to create it again.

@ff-pspiess
Copy link

I am seeing this too, it takes more than 40 minutes for the cluster to come online. Is there a workaround?

@clearly
Copy link

clearly commented Feb 9, 2017

+1

@jpriebe
Copy link

jpriebe commented Feb 10, 2017

Seeing 40+ minutes to stand up RDS Aurora with a 30GB database deployed across two AZs. Please fix this issue; I'm not sure how I'm going to be able to use Terraform unless I either exclude RDS from the config or I fork terraform and compile my own version.

@rfink
Copy link

rfink commented Mar 2, 2017

+1

@Hashfyre
Copy link

Seeing this with terraform v0.8.2, RDS, Postgres

Error applying plan:

1 error(s) occurred:

* aws_db_instance.test-postgres: timeout while waiting for state to become 'available' (last state: 'modifying', timeout: 40m0s)

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

@wilb
Copy link
Author

wilb commented Mar 28, 2017

I suspect no one is picking this up as it's a closed bug... Pinging @pearkes who upped the timeout originally?

@joseph-wortmann
Copy link

We just started having this with Postgres instances. DB created in AWS after about 15 minutes, TF waits for ~40 minutes and then times out. Rerun of TF shows no changes required.

@ghost
Copy link

ghost commented Aug 13, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests