I am seeing intermittent errors when using mitmproxy 3.0.3. The error is always:
502 Bad Gateway
HttpReadDisconnect(‘Server disconnected’,).
I installed mitmproxy 2.0.2 via pip to test, and have never received this error when using version 2. Immediately switching back to 3.0.3 causes the error to reappear (on the same web sites). The python version for both is 3.6.4 and its running in Arch linux.
Does anyone know why this might be happening, or have any troubleshooting suggestions?
The only entries that seem to coincide are the clientdisconnect messages in the log, and the Server disconnected messages in the console:
Log-
info: 127.0.0.1:33094: clientconnect
info: 127.0.0.1:33094: clientdisconnect
info: 127.0.0.1:33096: clientconnect
info: 127.0.0.1:33064: clientdisconnect
info: 127.0.0.1:33074: clientdisconnect
Additionally, I did disable http2 with ‘mitmproxy --no-http2’, however the errors kept occurring. Often if I refresh the page a few times it eventually works. Also, this is happening to a few people in my team, the same errors, so its not limited to my machine.
Is there a way of turning on more verbose logging (debug style) to see what the underlying problem is?
I get this error too with mitmdump 3.0.3. It seems that the problem occurs when I’m idle about one minute.
With -v I don’t see any problem.
I modified _read_response_line(rfile) function on read.py file, to debug with pdb:
def _read_response_line(rfile):
import pdb
try:
line = _get_first_line(rfile)
except exceptions.HttpReadDisconnect:
pdb.set_trace()
# We want to provide a better error message.
raise exceptions.HttpReadDisconnect("Server disconnected")