The strange thing is the same code works with some of our hubs but not others. Is this a known issue that later versions of azure-amqp-common-go fix? Or is there some setting that needs to be configured in the IoT Hub to prevent this from happening?
Below is debug output from the underlying pack.ag/amqp package showing some TX/RX frames. It appears to receive a nil value for NextIncomingID
which results in the error are seeing. I'm not familiar enough with AMQP to know if that is an error that would be caused by a server side issue, or if there would need to be some change on the client side code to fix this.
16:57:15.364382 TX: Begin{RemoteChannel: 0, NextOutgoingID: 0, IncomingWindow: 100, OutgoingWindow: 100, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.412592 TX: Begin{RemoteChannel: 0, NextOutgoingID: 0, IncomingWindow: 100, OutgoingWindow: 100, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.426561 RX: Begin{RemoteChannel: 0, NextOutgoingID: 1, IncomingWindow: 4294967295, OutgoingWindow: 100, HandleMax: 4294967295, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.426665 TX: Attach{Name: L-cTAXLOyxlAOfA6EurUVtCOQu5oCag-yjx6-hNfCT-7b837ef28BQ, Handle: 0, Role: Sender, SenderSettleMode: <nil>, ReceiverSettleMode: <nil>, Source: <nil>, Target: source{Address: $cbs, Durable: 0, ExpiryPolicy: , Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.480834 RX: Begin{RemoteChannel: 0, NextOutgoingID: 1, IncomingWindow: 5000, OutgoingWindow: 100, HandleMax: 255, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.480928 TX: Attach{Name: zmoI64EQc9nqHUQFt2bKT0stoh4leXB9_zVIREhtH46qsdjiomn986ls, Handle: 0, Role: Sender, SenderSettleMode: <nil>, ReceiverSettleMode: <nil>, Source: <nil>, Target: source{Address: $cbs, Durable: 0, ExpiryPolicy: , Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 0, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.490770 RX(Session): Attach{Name: L-cTAXLOyxlAOfA6EurUVtCOQu5oCag-yjx6-hNfCT-7b837ef28BQ, Handle: 0, Role: Receiver, SenderSettleMode: mixed, ReceiverSettleMode: first, Source: <nil>, Target: source{Address: $cbs, Durable: 0, ExpiryPolicy: session-end, Timeout: 0, Dynamic: false, DynamicNodeProperties: map[], Capabilities: []}, Unsettled: map[], IncompleteUnsettled: false, InitialDeliveryCount: 0, MaxMessageSize: 1048576, OfferedCapabilities: [], DesiredCapabilities: [], Properties: map[]}
16:57:15.490825 RX(Session): Flow{NextIncomingID: <nil>, IncomingWindow: 4294967295, NextOutgoingID: 0, OutgoingWindow: 100, Handle: 0, DeliveryCount: 0, LinkCredit: 50, Available: <nil>, Drain: false, Echo: false, Properties: map[]}