getting timeout after streaming logs for some time
See original GitHub issueThis is very likely an engine issue, first I would like to open here.
It looks like there is a change in behavior. When streaming logs with 1.10 I get timeout:
Traceback (most recent call last):
File "/usr/lib64/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/tt/g/sen/sen/tui/widgets/list/common.py", line 43, in fetch_logs
for line in generator:
File "/home/tt/.local/lib/python3.5/site-packages/docker/client.py", line 279, in _stream_raw_result
for out in response.iter_content(chunk_size=1, decode_unicode=True):
File "/usr/lib/python3.5/site-packages/requests/utils.py", line 363, in stream_decode_response_unicode
for chunk in iterator:
File "/usr/lib/python3.5/site-packages/requests/models.py", line 667, in generate
raise ConnectionError(e)
requests.exceptions.ConnectionError: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out.
generator is client.logs(c, stream=True)
This repro should be sufficient: https://github.com/docker/docker-py/issues/919#issuecomment-181795059
I know this also happens when using compose.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How to Fix the ERR_CONNECTION_TIMED_OUT Error - Kinsta
All you have to do is figure out which one was at fault. Return to the wp-content directory, and rename your original plugins...
Read more >How to Get to the Bottom of Network Timeout Issues
Based on the basic idea, first check the ECS instance and link for packet loss from the monitoring. The result shows that no...
Read more >What Does a Server Connection Timeout Mean?
A server connection timeout means that a server is taking too long to reply to a data request made from another device. Timeouts...
Read more >Common Timeouts effecting Web Services, HTTP and SOAP ...
The default value is 5 seconds. Increase the value to 30 seconds or greater. Set the value using the administrative console.
Read more >Debugging AWS Lambda Timeouts - Lumigo
Some time ago, an ex-colleague of mine at DAZN received an alert ... Task timed out after against a Lambda function's log group...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On a detached container,
for l in container.logs(stream=True, follow=True): print(l)
times out after a while with the following traceback:This happens when the container has no console output for long enough to exceed the timeout. A couple of workarounds helped:
client = docker.from_env(timeout=None)
(None
means no timeout tourllib3
)This sounds like the issue @TomasTomecek. It also makes sense that @jasonamyers and @akki might hit this with other parts of the API that can possibly wait a long time for the server to respond.
While I’m not familiar with the code, ideally, these methods would set an infinite timeout, while other methods would set a reasonable default timeout.
Indeed you did; I missed the pingback from #1959.
That patch works for me in place of the workarounds in my previous comment.
+1