ansible / terraform-provider-ansible

community terraform provider for ansible
https://registry.terraform.io/providers/ansible/ansible/latest
GNU General Public License v3.0
183 stars 42 forks source link

[ERROR] gRPC "message larger than max" error #54

Open LZiHaN opened 11 months ago

LZiHaN commented 11 months ago

Problem: When you see below error on your terraform runs

[ERROR] eval: *terraform.EvalDiff, err: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4797537 vs. 4194304) Error is ResourceExhausted desc = grpc: received message larger than max (4207558 vs. 4194304), where the max is 4MB

Cause:

This does not have to do with Docker, memory (RAM) or any other system constraints (local or on TFC/E). Instead, this is an error due to an underlying hardcoded 4MB limit in the gRPC message size for messages sent to and from the provider plugin. At this time there is no way to exceed this 4MB limit.

Solution:

The feature update to increase the size to 256MB has been implemented in terraform-plugin-go v0.6.0 and is used by the terraform-plugin-sdk. However, this update has not been adopted by the provider plugins yet.

In the mean time, to avoid this problem, you'll need to refactor your terraform configuration - such that your resource and state data is smaller than 4MB.

LZiHaN commented 11 months ago

Supporting documentation:

irishgordo commented 5 months ago

Currently hitting this issue:


Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Plugin error
│ 
│   with ansible_playbook.dockerregistry-vm-ansible-playbook,
│   on main.tf line 195, in resource "ansible_playbook" "dockerregistry-vm-ansible-playbook":
│  195: resource "ansible_playbook" "dockerregistry-vm-ansible-playbook" {
│ 
│ The plugin returned an unexpected error from plugin.(*GRPCProvider).UpgradeResourceState: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (8028326 vs. 4194304)
irishgordo commented 5 months ago

@LZiHaN do you happen to know any current work-arounds for this, outside of deleting the .tfstate file? Thanks for any insight / info :smile: !