databricks-sql-go icon indicating copy to clipboard operation
databricks-sql-go copied to clipboard

RoundTripper returned a response & error; ignoring response

Open mdibaiee opened this issue 1 year ago • 3 comments

We are using this library in our connector: https://github.com/estuary/connectors/tree/main/materialize-databricks

We have been seeing this log from the library:

RoundTripper returned a response & error; ignoring response

I did some investigation and it seems Golang's http.Client expects that only one of resp or err have a non-nil value in the response of a RoundTripper.RoundTrip, see: https://github.com/golang/go/blob/release-branch.go1.22/src/net/http/client.go#L260-L264

Also see the documentation here: https://pkg.go.dev/net/http#RoundTripper

RoundTrip must return err == nil if it obtained a response, regardless of the response's HTTP status code. A non-nil err should be reserved for failure to obtain a response.

A similar issue has been spotted and fixed here: https://github.com/nfx/slrp/commit/5ea1bdd4677e668263df5dce225be6da7bde03f9

I haven't yet found a way to fix this issue in this library, perhaps maintainers know better where to look for possible causes of this error.

mdibaiee avatar Jul 22 '24 13:07 mdibaiee