Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing request results in a misleading empty success response from sidekick #64

Closed
gbdolberg opened this issue Jun 21, 2022 · 2 comments
Assignees
Labels
community all incoming issues fixed triage all incoming issues in triage

Comments

@gbdolberg
Copy link

A request that fails during go's reverse proxy ServeHTTP results in a basically empty response with a 200 status code.
To me it seems very misleading because boto f.e. ends up excepting when it can't find the headers it expects a successful response to have.

Expected Behavior

I would think in case of an errorours request the response would be attached with a status code that reflects an issue.
Like go's defaultErrorHandler does by writing http.StatusBadGateway.

Current Behavior

SideKick's Backend's custom ErrorHandler only logs and sets the backend as offline, without changing the response.
So when the http tracer finishes with f(rw, r) it continues the same regardless of if the request was successful or not, and just relies on its custom ResponseWriter's default StatusCode: http.StatusOK,.
So the end result is an empty response in my case (with just 'Server' : 'SideKick' as a single header) and a 200 return code.

Possible Solution

I think the custom ErrorHandler should do what defaultErrorHandler and apply http.StatusBadGateway to the response.
Or change ResponseWriter's default status code to that.

Steps to Reproduce (for bugs)

Actually not sure, don't really understand yet why in my env the http requests even fail ("OpError" that just says "tcp"), as a result of transport.RoundTrip(outreq).
But I would assume that causing that RoundTrip to fail somehow would reproduce this.

Context

For some reason sometimes when sidekick sends requests to my env ServeHTTP fails, and instead of reflecting that something went wrong sidekick returns a 200 response. Causing my boto to except when it can't find an ETag in the response headers.

Your Environment

  • Version used (sidekick version): Custom build of a clone of the master branch (dce1854).
  • Operating System and version (uname -a): amazon linux 2
@gbdolberg gbdolberg added community all incoming issues triage all incoming issues in triage labels Jun 21, 2022
@harshavardhana harshavardhana self-assigned this Jun 21, 2022
@harshavardhana
Copy link
Member

Please provide a reproducer @gbdolberg - thank you

@harshavardhana
Copy link
Member

No valid reproducer provided closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community all incoming issues fixed triage all incoming issues in triage
Projects
None yet
Development

No branches or pull requests

2 participants