terraform-provider-rabbitmq icon indicating copy to clipboard operation
terraform-provider-rabbitmq copied to clipboard

Error: json: cannot unmarshal string into Go struct field ChannelDetails.consumer_details.channel_details.peer_port of type uint

Open nsurleraux-railnova opened this issue 1 year ago • 4 comments

Hi,

We are upgrading from 1.7.0 to 1.8.0, and we are encountering an issue with unmarshaling.

Terraform Version

Terraform v1.4.4

Affected Resource(s)

  • rabbitmq_queue

Terraform Configuration Files

resource "rabbitmq_queue" "RNAME" {
  name     = "NAME"
  vhost    = "HOST"

  settings {
    durable        = true
    auto_delete    = false
    arguments_json = <<EOF
{
  "x-queue-type": "quorum"
}
EOF
  }
}

Debug Output

Error: json: cannot unmarshal string into Go struct field ChannelDetails.consumer_details.channel_details.peer_port of type unit

Expected Behavior

The unmarshaling should not crash.

Actual Behavior

See earlier error

Steps to Reproduce

  1. terraform plan

nsurleraux-railnova avatar Apr 07 '23 13:04 nsurleraux-railnova

Getting the same error when configuring a shovel

willemgovaerts avatar Apr 20 '23 15:04 willemgovaerts

Related: https://github.com/michaelklishin/rabbit-hole/issues/279

mcwarman avatar Aug 18 '23 16:08 mcwarman

Hey do you have any solution for this problem?

barziv avatar Apr 22 '24 09:04 barziv

I got the downstream dependency updated in https://github.com/michaelklishin/rabbit-hole/issues/279 and it was released in michaelklishin/rabbit-hole/2.16.0.

But when I looked to upgrade the version in the provider it required a lot more work than I originally expected. And I wasn't able to find the time to get it work.

The problem is the changes will cause a schema change and therefore require handling state upgrades.

Reference: https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade.

This meant from a provider perspective we had to avoid upgrading to 1.8.0 and stick to using 1.7.0.

mcwarman avatar Apr 23 '24 19:04 mcwarman