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.

Docker 4.12.0 on Windows throws "The pipe has been ended" error

See original GitHub issue

Hi team,

We’ve started to see error messages with Docker Desktop v4.12.0 on Windows. We are attaching to the container by calling {container_instance}.attach(stream=True, logs=True, demux=True) and then iterating through the logs streams. This is working fine with earlier versions but it started to throw following error with Docker Desktop v4.12.0.

Traceback (most recent call last):
  File "c:\users\administrator\workplace\aws-sam-cli\samcli\local\docker\container.py", line 401, in _write_container_output
    for stdout_data, stderr_data in output_itr:
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\types\daemon.py", line 32, in __next__
    return next(self._stream)
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\api\client.py", line 406, in <genexpr>
    gen = (demux_adaptor(*frame) for frame in gen)
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\utils\socket.py", line 94, in frames_iter_no_tty
    (stream, n) = next_frame_header(socket)
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\utils\socket.py", line 66, in next_frame_header
    data = read_exactly(socket, 8)
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\utils\socket.py", line 51, in read_exactly
    next_data = read(socket, n - len(data))
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\utils\socket.py", line 35, in read
    return socket.recv(n)
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\transport\npipesocket.py", line 23, in wrapped
    return f(self, *args, **kwargs)
  File "c:\users\administrator\workplace\aws-sam-cli\venv\lib\site-packages\docker\transport\npipesocket.py", line 117, in recv
    err, data = win32file.ReadFile(self._handle, bufsize)
pywintypes.error: (109, 'ReadFile', 'The pipe has been ended.')

A simplified version of how we are reading the logs;

# stdout and stderr are StreamWriter's that is been provided earlier
logs_itr = container.attach(stream=True, logs=True, demux=True)

for stdout_data, stderr_data in output_itr:
  if stdout_data and stdout:
    stdout.write(stdout_data)

  if stderr_data and stderr:
    stderr.write(stderr_data)

See related issue here: https://github.com/aws/aws-sam-cli/issues/4222

Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
brother-zcommented, Sep 28, 2022

Exact same thing happens for container.exec_run, only downgrade to earlier version of Docker Desktop fixes it.

2reactions
brother-zcommented, Nov 2, 2022

Works great, updated Docker Desktop to 4.13.1 and my scripts are happy again 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sam Build Fails with pywintypes.error: (109, 'ReadFile', 'The ...
Description: When ever I do a sam build I get an error that says "pywintypes.error: (109, 'ReadFile', 'The pipe has been ended.')".
Read more >
docker python package 4.3.1 not working with Docker Desktop ...
error : (109, 'ReadFile', 'The pipe has been ended.') python · docker · Share.
Read more >
open \\.\pipe\docker_engine_windows: The system cannot find ...
I've been to many forums and tried many things, it's not working at all. PS C:\temp> docker config ls Error response from daemon:...
Read more >
Changelog - Cypress Documentation
Cypress now throws an error if any Cypress commands are invoked from inside a .should() ... This feature had been previously removed in...
Read more >
What to Do if Docker Desktop for Windows Does Not Start
I got the Docker command line application in the Command Prompt, but the hello-world example ended with an error:.
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