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

Terraform fails with empty string errors #1574

Closed
bitglue opened this issue Apr 17, 2015 · 2 comments · Fixed by #1576
Closed

Terraform fails with empty string errors #1574

bitglue opened this issue Apr 17, 2015 · 2 comments · Fixed by #1576

Comments

@bitglue
Copy link

bitglue commented Apr 17, 2015

Since updating from master a week or two ago, Terraform has started giving me mystery errors:

$ awsudo terraform refresh
module.dev_vpc.aws_vpc.vpc: Refreshing state... (ID: vpc-3ac99d5f)
module.internal_vpc.aws_vpc.vpc: Refreshing state... (ID: vpc-6aca9e0f)
module.main_registry_storage.aws_iam_role.rw: Refreshing state... (ID: main-docker-registry-rw)
module.main_registry_storage.aws_iam_role.ro: Refreshing state... (ID: main-docker-registry-ro)
module.main_registry_storage.aws_s3_bucket.registry: Refreshing state... (ID: main-docker-registry-paperg-com)
module.main_registry_storage.aws_iam_instance_profile.rw: Refreshing state... (ID: main-docker-registry-rw)
module.main_registry_storage.aws_iam_instance_profile.ro: Refreshing state... (ID: main-docker-registry-ro)
module.dev_vpc.aws_internet_gateway.gateway: Refreshing state... (ID: igw-bd3ca8d8)
Error refreshing state: 1 error(s) occurred:

* 1 error(s) occurred:

* 1 error(s) occurred:

* 

If I run it with TF_LOG=1 and grep for errors, I see a lot of this:

2015/04/17 13:03:09 [ERROR] root.internal_vpc: eval: *terraform.EvalValidateCount, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.internal_vpc: eval: *terraform.EvalOpFilter, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.internal_vpc: eval: *terraform.EvalSequence, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.dev_vpc: eval: *terraform.EvalValidateCount, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.dev_vpc: eval: *terraform.EvalOpFilter, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.dev_vpc: eval: *terraform.EvalSequence, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.main_registry_storage: eval: *terraform.EvalValidateCount, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.main_registry_storage: eval: *terraform.EvalOpFilter, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.main_registry_storage: eval: *terraform.EvalSequence, err: Warnings: []. Errors: []
2015/04/17 13:03:09 [ERROR] root.main_registry_storage: eval: *terraform.EvalValidateCount, err: Warnings: []. Errors: 

I'm confused because it says "1 error(s) occurred:" but then there's no error, and the logs say "[ERROR]" and then explain that there's an empty list of errors.

A guess: I recently deleted some resources through the AWS web console, which is necessary because destroy doesn't work (#922). Running refresh should notice this, and remove the resource from the state file, but it's a common bug for providers to forget about that case (#889). I think I might be hitting such a case somewhere, but without any actual error messages I can only guess.

Sorry I can't narrow it down any more -- I realize this is totally unreproducable. But maybe since this seems like a recent change to master, someone remembers some change that might be relevant.

bitglue pushed a commit to bitglue/terraform that referenced this issue Apr 17, 2015
If reading an S3 bucket's state, and that bucket has been deleted, don't
fail with a 404 error. Instead, update the state to reflect that the
bucket does not exist. Fixes hashicorp#1574.
@bitglue
Copy link
Author

bitglue commented Apr 17, 2015

Found the issue. I guess it could be considered a bug in the AWS SDK that some of its errors Error() to an empty string, which is about the least useful thing possible. Though, maybe at least the logs generated by TF_LOG=1 could print the error with %#v, or something else more verbose than %s?

@ghost
Copy link

ghost commented May 3, 2020

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.

@hashicorp hashicorp locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant