cyrilgdn / terraform-provider-rabbitmq

Terraform RabbitMQ provider
https://www.terraform.io/docs/providers/rabbitmq/
Mozilla Public License 2.0
45 stars 36 forks source link

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

Open nsurleraux-railnova opened 1 year ago

nsurleraux-railnova commented 1 year ago

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)

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
willemgovaerts commented 1 year ago

Getting the same error when configuring a shovel

mcwarman commented 1 year ago

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

barziv commented 6 months ago

Hey do you have any solution for this problem?

mcwarman commented 6 months ago

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.