question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

H2 StreamClosed error while requesting duckduckgo.com

See original GitHub issue

Running the following script on the current master:

import asyncio
import httpx

async def main():
    cl = httpx.AsyncClient()
    resp = await cl.get("https://duckduckgo.com")
    print(resp)

if __name__ == "__main__":
    asyncio.run(main())

Errors with the following traceback:

Traceback (most recent call last):
  File ".dev/middlewares.py", line 14, in <module>
    asyncio.run(main())
  File "/Users/yeray/.pyenv/versions/3.7.3/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/Users/yeray/.pyenv/versions/3.7.3/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File ".dev/middlewares.py", line 8, in main
    resp = await cl.get("https://duckduckgo.com")
  File "/Users/yeray/code/personal/_forks/httpx/httpx/client.py", line 327, in get
    timeout=timeout,
  File "/Users/yeray/code/personal/_forks/httpx/httpx/client.py", line 560, in request
    timeout=timeout,
  File "/Users/yeray/code/personal/_forks/httpx/httpx/client.py", line 155, in send
    allow_redirects=allow_redirects,
  File "/Users/yeray/code/personal/_forks/httpx/httpx/client.py", line 188, in send_handling_redirects
    request, verify=verify, cert=cert, timeout=timeout
  File "/Users/yeray/code/personal/_forks/httpx/httpx/dispatch/connection_pool.py", line 116, in send
    raise exc
  File "/Users/yeray/code/personal/_forks/httpx/httpx/dispatch/connection_pool.py", line 111, in send
    request, verify=verify, cert=cert, timeout=timeout
  File "/Users/yeray/code/personal/_forks/httpx/httpx/dispatch/connection.py", line 51, in send
    response = await self.h2_connection.send(request, timeout=timeout)
  File "/Users/yeray/code/personal/_forks/httpx/httpx/dispatch/http2.py", line 48, in send
    status_code, headers = await self.receive_response(stream_id, timeout)
  File "/Users/yeray/code/personal/_forks/httpx/httpx/dispatch/http2.py", line 122, in receive_response
    event = await self.receive_event(stream_id, timeout)
  File "/Users/yeray/code/personal/_forks/httpx/httpx/dispatch/http2.py", line 155, in receive_event
    events = self.h2_state.receive_data(data)
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/connection.py", line 1463, in receive_data
    events.extend(self._receive_frame(frame))
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/connection.py", line 1486, in _receive_frame
    frames, events = self._frame_dispatch_table[frame.__class__](frame)
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/connection.py", line 1702, in _receive_window_update_frame
    frame.window_increment
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/stream.py", line 1126, in receive_window_update
    StreamInputs.RECV_WINDOW_UPDATE
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/stream.py", line 129, in process_input
    return func(self, previous_state)
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/stream.py", line 397, in window_on_closed_stream
    return self.recv_on_closed_stream(previous_state)
  File "/Users/yeray/.pyenv/versions/httpx/lib/python3.7/site-packages/h2/stream.py", line 336, in recv_on_closed_stream
    raise StreamClosedError(self.stream_id)
h2.exceptions.StreamClosedError: 1

Anyone else getting this error?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
vmagamedovcommented, Jul 31, 2019

This is already fixed in h2, waiting for a new release.

1reaction
sethmlarsoncommented, Jul 31, 2019

Verified that the latest master for h2 fixes this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting java.io.IOException: Stream closed error without ...
You are using the syntax try-with-resource. Everything inside the parenthesis will be closed automatically as if there is a finally block to ...
Read more >
IO Exception: "java.io.IOException: Stream Closed"; [90031-168]
I'm using eclipse PDT, which uses H2 DB for indexing data. there are problems with accesing db - indexing a single file takes...
Read more >
DuckDuckGo !Bang
DuckDuckGo enables you to search directly on 100s of other sites with our, "!bang" commands. !bangs are shortcuts that start with an exclamation...
Read more >
DuckDuckGo Private Browser - Apps on Google Play
The DuckDuckGo app provides the most comprehensive online privacy protection with the push of a button. With one download, you get a new ......
Read more >
Join failed : stream closed - Dataiku Community
Hi, I am trying to do a join a 2 dataset and the job keep failing. I get the error : IO Exception:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found