[mozproxy] mozproxy logs an error when mitmproxy shuts down and causes tests to fail

RESOLVED FIXED in Firefox 68

Status

defect
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: erahm, Assigned: erahm)

Tracking

Version 3
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

3 months ago

See bug 1532491, comment 15-17.

If we specify --no-upstream-cert mitmproxy sets an error code on exit for the AWSY tp6-based tests. From what I can tell the playback actually runs fine (I've visually verified this locally). This causes mozproxy shutdown logic to log an error which will cause the test to fail in automation.

The simplest solution is to just not log at the error level. Given we're using a 2 year old version of mitmproxy this is probably the best option.

Assignee

Comment 1

3 months ago

mitmproxy appears to return an error code of 1 if we use the --no-upstream-cert. The actual playback works fine, this patch reduces the log level to info in order to prevent tests from erroneously failing due to this error code.

The actual underlying problem here seems to be a crash of mitmproxy:

WebSocket connection closed by client: (status code missing) (message missing), unknown status code
Traceback (most recent call last):
File "mitmproxy/proxy/server.py", line 119, in handle
File "mitmproxy/proxy/modes/http_proxy.py", line 9, in call
File "mitmproxy/proxy/protocol/tls.py", line 383, in call
File "mitmproxy/proxy/protocol/http1.py", line 72, in call
File "mitmproxy/proxy/protocol/http.py", line 188, in call
File "mitmproxy/proxy/protocol/http.py", line 257, in _process_flow
File "mitmproxy/proxy/protocol/http.py", line 206, in handle_regular_connect
File "mitmproxy/proxy/protocol/tls.py", line 383, in call
File "mitmproxy/proxy/protocol/http1.py", line 72, in call
File "mitmproxy/proxy/protocol/http.py", line 188, in call
File "mitmproxy/proxy/protocol/http.py", line 420, in _process_flow
File "mitmproxy/proxy/protocol/websocket.py", line 154, in call
File "mitmproxy/net/tcp.py", line 387, in ssl_read_select
TypeError: argument must be an int, or have a fileno() method.

mitmproxy has crashed!

We are upgrading to mitmproxy 4.0.4 over on bug 1457274, and it should land hopefully soon. Would that solve your problem Eric?

Depends on: 1457274
Flags: needinfo?(erahm)
Assignee

Comment 3

3 months ago

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #2)

The actual underlying problem here seems to be a crash of mitmproxy:

WebSocket connection closed by client: (status code missing) (message missing), unknown status code
Traceback (most recent call last):
File "mitmproxy/proxy/server.py", line 119, in handle
File "mitmproxy/proxy/modes/http_proxy.py", line 9, in call
File "mitmproxy/proxy/protocol/tls.py", line 383, in call
File "mitmproxy/proxy/protocol/http1.py", line 72, in call
File "mitmproxy/proxy/protocol/http.py", line 188, in call
File "mitmproxy/proxy/protocol/http.py", line 257, in _process_flow
File "mitmproxy/proxy/protocol/http.py", line 206, in handle_regular_connect
File "mitmproxy/proxy/protocol/tls.py", line 383, in call
File "mitmproxy/proxy/protocol/http1.py", line 72, in call
File "mitmproxy/proxy/protocol/http.py", line 188, in call
File "mitmproxy/proxy/protocol/http.py", line 420, in _process_flow
File "mitmproxy/proxy/protocol/websocket.py", line 154, in call
File "mitmproxy/net/tcp.py", line 387, in ssl_read_select
TypeError: argument must be an int, or have a fileno() method.

mitmproxy has crashed!

We are upgrading to mitmproxy 4.0.4 over on bug 1457274, and it should land hopefully soon. Would that solve your problem Eric?

It does not, we now see an error code of -9. Given the concerns over missing real failures, I'm going to rework the patch to make the log level for this specific error configurable so that I can unblock landing the awsy-tp6 tests.

Flags: needinfo?(erahm)
Attachment #9053791 - Attachment description: Bug 1539317 - Use info level to report mitmproxy shutdown error code. r=whimboo → Bug 1539317 - Add option to ignore mitmproxy shutdown error code. r=rwood

If we really get a failure due to the error code I would be fine with moving the log line to an info level without making it configurable. That wasn't that clear before. A try build might have helped.

Comment 5

3 months ago
Pushed by erahm@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/78a419376c0c
Add option to ignore mitmproxy shutdown error code. r=rwood

Comment 6

3 months ago
bugherder
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.