cloudfoundry-community / terraform-provider-cloudfoundry

Terraform Cloud Foundry Provider
https://registry.terraform.io/providers/cloudfoundry-community/cloudfoundry/latest
Mozilla Public License 2.0
75 stars 87 forks source link

revert 0f945c34a46cec68d7a8d14f7ebd0c472495c3d4 #554

Closed sleungcy closed 9 months ago

sleungcy commented 9 months ago

This reverts 0f945c34a46cec68d7a8d14f7ebd0c472495c3d4

The upgrade to protobuf 1.32.0 seem to cause the provider to crash during calls to NoaaClient.RecentLogs. My test case was able to get the logs after reverting this change.

panic: protobuf tag not enough fields in Envelope.state:

goroutine 2704 [running]:
github.com/gogo/protobuf/proto.(*unmarshalInfo).computeUnmarshalInfo(0x400065a0a0)
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go:341 +0xfa0
github.com/gogo/protobuf/proto.(*unmarshalInfo).unmarshal(0x400065a0a0, {0xe00f40?}, {0x4000900000, 0x2dd, 0x400})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go:138 +0x4c
github.com/gogo/protobuf/proto.(*InternalMessageInfo).Unmarshal(0x400095f6b8?, {0x1013860, 0x400065a000}, {0x4000900000?, 0x2dd?, 0x400?})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go:63 +0xc4
github.com/gogo/protobuf/proto.(*Buffer).Unmarshal(0x400095f700, {0x1013860, 0x400065a000})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/gogo/protobuf/proto/decode.go:424 +0x144
github.com/gogo/protobuf/proto.Unmarshal({0x4000900000, 0x2dd, 0x400}, {0x1013860, 0x400065a000})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/gogo/protobuf/proto/decode.go:342 +0xc0
github.com/cloudfoundry/noaa/consumer.(*Consumer).readTC(0x400092dcc0, {0x4000798720, 0x24}, {0x4000662580, 0x503}, {0xe31e30, 0xa})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/cloudfoundry/noaa/consumer/sync.go:105 +0x330
github.com/cloudfoundry/noaa/consumer.(*Consumer).RecentLogs(0x24?, {0x4000798720?, 0x24?}, {0x4000662580?, 0x3?})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/vendor/github.com/cloudfoundry/noaa/consumer/sync.go:24 +0x30
github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/noaa.NOAAClient.RecentLogs({0x400092dcc0?, {0x1007de0?, 0x40005bce00?}, 0x1?}, {0x4000798720, 0x24})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/cloudfoundry/managers/noaa/noaa.go:37 +0x60
github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/v3appdeployers.RunBinder.processDeployErr({_, _}, {_, _}, {{{0x4000798720, 0x24}, {0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...})
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/cloudfoundry/managers/v3appdeployers/runbinder.go:456 +0x54
github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/v3appdeployers.BlueGreenRolling.Deploy.func4(0x4000892780?)
        /home/appuser/go/src/github.com/terraform-providers/terraform-provider-cf/cloudfoundry/managers/v3appdeployers/bluegreen_rolling_strategy_v3.go:318
         +0x570

@loafoe Seems like we cannot upgrade sonde-go and terraform-plugin-sdk until #459 get resolved.

chombium commented 9 months ago

@sleungcy, @loafoe The /recentlogs endpoint was removed from the Traffic Controller and the NOAA client. That's why the code breaks. We (me and @ZPascal) have taken a look at the code and we need to update few libraries as well. The whole project is full of deprecated dependencies. We have to change the cloudfoundry-cli which it seems that will end up like this PR :( I guess we'll have to go through this :)