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

Traefik failing on POST request #1008

Closed
Tester98 opened this issue Dec 31, 2016 · 1 comment · Fixed by #1016
Closed

Traefik failing on POST request #1008

Tester98 opened this issue Dec 31, 2016 · 1 comment · Fixed by #1016

Comments

@Tester98
Copy link

Tester98 commented Dec 31, 2016

What version of Traefik are you using (traefik version)?

v1.1.2

What is your environment & configuration (arguments, toml...)?

linux, simple file backend

[retry]

[backends]
[backends.testing]
[backends.testing.servers.server1]
url = "http://primary:80"
weight = 1
[backends.testing.servers.server2]
url = "http://backup:80"
weight = 1

What did you do?

if the request is a POST request and if the primary backend has failed, then traefik will retry the request to backup ( or vice-versa first backup then primary).

What did you expect to see?

Request being forwarded to another server and a response

What did you see instead?

traefik fails to retry request and post data is destroyed. traefik debug logs below

time="2016-12-31T10:50:50+01:00" level=warning msg="Error forwarding to http://primary:80, err: dial tcp primary:80: getsockopt: connection refused"
time="2016-12-31T10:50:50+01:00" level=debug msg="New attempt 2 for request: /api/adduser"
time="2016-12-31T10:50:50+01:00" level=warning msg="Error forwarding to http://backup:80, err: http: invalid Read on closed Body"

i have found out a similar case here, please have a look
flynn/flynn#872

@bamarni
Copy link
Contributor

bamarni commented Jan 4, 2017

Should be fixed with #1016

emilevauge pushed a commit to bamarni/traefik that referenced this issue Feb 2, 2017
As the http client always closes the request body,
this makes sure the request can be retried if needed.

Fixes traefik#1008
jangie pushed a commit to jangie/traefik that referenced this issue Feb 23, 2017
As the http client always closes the request body,
this makes sure the request can be retried if needed.

Fixes traefik#1008
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants