-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Misleading error message when JSON parsing fails #16332
Comments
Just ran into this as well. I had an errant |
This is a likely duplicate of: #14333 |
validated json from jsonlint ..still gets this error |
Hi all! Sorry for this weird behavior and for the delayed response. I've just tried this with the v0.12.0-alpha1 release using the following simplified configuration: provider "aws" {
region = "us-west-2"
}
resource "aws_ecs_task_definition" "task" {
family = "placeholder"
container_definitions = "invalid"
} In the alpha release, this validation problem is now being correctly caught and reported during the plan step:
Unfortunately the reported location of the invalid definition is not correct yet because the providers have not yet been updated to return detailed source location information and so it's just indicating the Since the direct problem reported in this issue has been addressed -- that resource validation errors during plan were not always halting the plan -- I'm going to close this out. The error messages will be improved further in later issues/PRs. Thanks for reporting this, and sorry again for the delay in addressing it. |
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. |
Terraform Version
Terraform v0.10.7
Terraform Configuration Files
This module:
depends on this definition:
I was getting this very misleading error message:
It's confusing, because I can see very clearly that the task definition exists. Running with TF_LOG=DEBUG revealed the following logs:
Basically, the JSON was invalid. Here's the JSON file - there's a trailing comma that I missed.
It would be nice if the JSON error message was bubbled up to the default log level, so I could see what the problem was, instead of the (very confusing) error message about how a resource didn't exist.
The text was updated successfully, but these errors were encountered: