Hey everyone. I’m new to Terraform and evaluating it for my needs. So far so good, other than one glaring issue: some error messages are completely unactionable. This may or may not be an actual Terraform issue; it might be an Azure (azurerm) provider issue, databricks provider issue, or issue with Azure itself. Here’s the error message when using terraform apply:
Here’s the scenario. I’m using Azure and trying to set up a Databricks workspace and cluster. I’m using the official Databricks provider to configure the cluster. The actual error is that I’m exceeding the 4 vCPU limit per-region that Azure free-tier accounts are limited to. To figure this out, I had to log in to the Databricks workspace UI, navigate to the cluster, and look at the log. In there, I could see the entire message.
To me, this is something that should be shown at the terraform apply stage. I tried turning on trace logging, but the trace log is also truncated.
I’m not entirely sure where the issue lies, but before I go down the route of creating a GitHub issue, I figured I’d ask here to see if I’m doing anything wrong.
From Terraform Core’s perspective, the only modification it makes to diagnostic messages returned from providers is to attempt to identify a location in the configuration to attribute them to, which is ideally a particular argument but is more often just the particular resource that raised it, because providers are often surfacing errors from underlying APIs that don’t provide machine-readable information about what aspect of the request was incorrect.
Based on the partial error message you shared here, and the fact that you saw it also truncated in the trace log, I suspect that this message is being truncated by something either in the provider or upstream from the provider. Given that this seems to be DataBricks intermediating a request to Azure and returning Azure’s message, it’s possible that it’s the remote DataBricks API that is doing the truncation, in which case the full error message would not be available client-side at all.
I don’t see the string azure_error_code anywhere in the DataBricks provider repository, so I have to assume this error message is either coming from the API itself or from whatever Go SDK the provider uses to interact with the DataBricks API.