JetBrains / package-search-gradle-plugins

Gradle plugins for Docker, Terraform and Liquibase.
Apache License 2.0
32 stars 8 forks source link

How to debug: Error: "xxxx": required field is not set #6

Closed farrukhnajmi closed 2 years ago

farrukhnajmi commented 2 years ago

I am new to terraform and this plugin.

When I execute the terraformMainPlan task I get the following errors. I am unsure how to debug the errors and fix them. TIA for any guidance.

> Task :terraform:terraformExtract UP-TO-DATE
> Task :terraform:copyMainMetadataFiles NO-SOURCE
> Task :terraform:terraformMainMetadata UP-TO-DATE
> Task :terraform:generateMainExecutionContext UP-TO-DATE
> Task :terraform:generateMainResFile UP-TO-DATE
> Task :terraform:copyMainResFileInExecutionContext

> Task :terraform:terraformMainInit FAILED
Initializing modules...

Initializing the backend...

> Task :terraform:syncMainLockFile UP-TO-DATE
7 actionable tasks: 2 executed, 5 up-to-date
╷
│ Error: "region": required field is not set
│ 
│ 
╵

╷
│ Error: "bucket": required field is not set
│ 
│ 
╵

╷
│ Error: "key": required field is not set
│ 
│ 
╵
lamba92 commented 2 years ago

Hello! I believe there are some issues in your provider configuration in your TF sources. Can you share the project?

Also which version of the plugin are you using?

farrukhnajmi commented 2 years ago

Thank you! I have determined the cause of my problem to be a backend using S3 provider which was missing some required arguments. The broader question I have is not specific to my project but how best to determine which line in which file or at least which type of block has the issue. Anything that would help me find the source of the mis-configuration.

lamba92 commented 2 years ago

The plugin should output the terraform errors 1 to 1. The error message you attached in the first message is from Terraform itself, but indeed it seems lacking some details like the lines where the error is.

I am not sure if it's the plugin fault or IntelliJ fault (if you are using IJ, the error output logs are often manipulated and some lines but have been swallowed).

Can you reproduce the error using just the command line and paste the output?

farrukhnajmi commented 2 years ago

Hi @lamba92 , The terraform command line gives same error lacking details on where to look. So it seems like a terraform limitation.

I am closing this issue.