terraform-provider-kafka-connect
terraform-provider-kafka-connect copied to clipboard
Parsing Errors on Bad Gateway and 404
Related to #6
Really handy provider. Thanks.
I have essentially a load balancer in front of Kafka Connect, and part of my deploy spins up and down the container underneath; before updating the Connector config.
This results in either Bad Gateway or 404 errors for a short period of time. Unfortunately, these don't appear to be handled very well, and I get
kafka-connect_connector.loyalty-api-dynamodb-source: kafka-connect_connector.blah: invalid character 'B' looking for beginning of value
or
kafka-connect_connector.loyalty-api-dynamodb-source: kafka-connect_connector.blah: can't parse Number as value ``
So there's two things here:
One is that it's trying to parse the response even if the HTTP response code is not in the 200s; which seems very wrong.
The other is that it doesn't have retries on all operations, just create. Adding it to the others would improve my CI experience dramatically.
This also happens when authentication to the API fails and it returns a 401:
Error: invalid character 'U' looking for beginning of value
The response from the API:
HTTP/1.1 401 Unauthorized
Date: Thu, 14 Jan 2021 17:49:08 GMT
Content-Type: application/json
Content-Length: 32
Server: Jetty(9.4.24.v20191120)
User cannot access the resource.