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

AssertionError: Unexpected event: <InformationalResponseReceived #5050

Open
Prinzhorn opened this issue Jan 12, 2022 · 3 comments
Open

AssertionError: Unexpected event: <InformationalResponseReceived #5050

Prinzhorn opened this issue Jan 12, 2022 · 3 comments

Comments

@Prinzhorn
Copy link
Member

I don't think this was broken recently, originally happened on a pretty outdated branch of mine (as far back as c718d4f) but repros on main as well

Steps to reproduce the behavior:

  1. mitmdump
  2. curl --insecure --proxy localhost:8080 https://www.shopify.com/
127.0.0.1:40186: client connect
127.0.0.1:40186: server connect www.shopify.com:443 (104.16.255.71:443)
127.0.0.1:40186: mitmproxy has crashed!
Traceback (most recent call last):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/server.py", line 294, in server_event
    for command in layer_commands:
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 255, in handle_event
    yield from self._handle(event)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/__init__.py", line 742, in _handle_event
    yield from self.event_to_child(handler, event)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/__init__.py", line 751, in event_to_child
    for command in child.handle_event(event):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/__init__.py", line 619, in passthrough
    for command in self.child_layer.handle_event(event):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/tunnel.py", line 75, in _handle_event
    yield from self.receive_data(event.data)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/tls.py", line 291, in receive_data
    yield from self.event_to_child(
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/tls.py", line 357, in event_to_child
    yield from super().event_to_child(event)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/tunnel.py", line 109, in event_to_child
    for command in self.child_layer.handle_event(event):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/tunnel.py", line 90, in _handle_event
    yield from self.event_to_child(event)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/tunnel.py", line 109, in event_to_child
    for command in self.child_layer.handle_event(event):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/__init__.py", line 742, in _handle_event
    yield from self.event_to_child(handler, event)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/__init__.py", line 751, in event_to_child
    for command in child.handle_event(event):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layer.py", line 144, in handle_event
    command = command_generator.send(send)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/_http2.py", line 381, in _handle_event
    for cmd in self._handle_event2(event):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/_http2.py", line 425, in _handle_event2
    yield from super()._handle_event(event)
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/_http2.py", line 156, in _handle_event
    if (yield from self.handle_h2_event(h2_event)):
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/_http2.py", line 461, in handle_h2_event
    return (yield from super().handle_h2_event(event))
  File "/home/alex/src/forks/mitmproxy/mitmproxy/proxy/layers/http/_http2.py", line 234, in handle_h2_event
    raise AssertionError(f"Unexpected event: {event!r}")
AssertionError: Unexpected event: <InformationalResponseReceived stream_id:1, headers:[(b':status', b'103'), (b'link', b'<https://cdn.shopify.com/shopifycloud/brochure/assets/application-e4598a9a40dfeaa77f3cfb05d6d502d3e2f0020008fdfcc09747333d2666c424.css>; as=style; rel=preload, <https://cdn.shopify.com/shopifycloud/brochure/assets/manifests/home/index-c9203e6aecacc53dbe4781dc6fe3805ab20876c009b62307490723e3b96de5ea.css>; as=style; rel=preload')]>

127.0.0.1:40186: GET https://www.shopify.com/ HTTP/2.0
     << HTTP/2.0 200 OK 160k
127.0.0.1:40186: client disconnect
127.0.0.1:40186: server disconnect www.shopify.com:443 (104.16.255.71:443)

System Information

Paste the output of "mitmproxy --version" here.

Mitmproxy: 8.0.0.dev (+202, commit 1e97073)
Python:    3.8.10
OpenSSL:   OpenSSL 1.1.1m  14 Dec 2021
Platform:  Linux-5.11.0-46-generic-x86_64-with-glibc2.29
@Prinzhorn Prinzhorn added the kind/triage Unclassified issues label Jan 12, 2022
@mhils mhils added area/protocols kind/bug and removed kind/triage Unclassified issues labels Jan 12, 2022
@Prinzhorn
Copy link
Member Author

Just in case Shopify changes something on their end and it won't be reproducible anymore, here's verbose logs with --set proxy_debug -vvv

shopify.log

@owen800q
Copy link

I hit the same issue, any solution?

@rosydawn6
Copy link
Contributor

Hello, getting up to speed as I was also encountering the same issue and found this ticket. When running the above curl with:
Mitmproxy: 8.1.1 binary
Python: 3.10.5
OpenSSL: OpenSSL 3.0.3 3 May 2022
Platform: Linux-5.13.0-52-generic-x86_64-with-glibc2.31

No exception is raised.

When I run the above curl with:
Mitmproxy: 8.0.0 binary
Python: 3.10.2
OpenSSL: OpenSSL 1.1.1n 15 Mar 2022
Platform: Linux-5.13.0-52-generic-x86_64-with-glibc2.31

It raises the InformationalResponseReceived exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants