-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
podman exec -i truncates the STDIN input #5046
Comments
Can you try this as root, and see if that resolves the issue? Want to see if this is definitely Podman or potentially fuse-overlayfs |
Hi @mheon, I don't see any difference:
|
@haircommander Could we be losing information along the Unix socket? Conmon not reading it fast enough, maybe? |
I couldn't reproduce with run:
However, with this podman version, the podman exec stdin is ignored: localhost ~ $ podman run --name ubi8 ubi8 sleep infinity
localhost ~ $ cat /usr/bin/vim | podman exec -i 'ubi8' '/usr/bin/dd' of=/tmp/a
0+0 records in
0+0 records out
0 bytes copied, 0.000112077 s, 0.0 kB/s |
Ah, that's the pipe issue - we fixed that in 1.7.0 |
The fact that run works means it's probably not a direct problem with attach, but something related to exec. Interesting... Also, are there objections to using |
is there any newer version for el7? it's getting more and more annoying...even on fedora and on rhel/centos-7 it not possible to load a mysql/mariadb dump into container. isn't it a basic feature? |
Fedora definitely has a version with a fix for the pipes issue with run, though we're still not sure what's going on with exec here. I believe there is an updated repo for EL7 that has more up-to-date versions of Podman; @lsm5 poke |
@mheon, Podman 1.7.0-2 from Fedora is also broken:
|
it's still not working in 1.8.0 |
I see a similar issue with 1.8.0 when piping a tar.gz. It gets part of the file across, but then breaks: $ podman --version
podman version 1.8.0
$ uname -a
Linux chrmarti-ubuntu 5.3.0-29-generic #31-Ubuntu SMP Fri Jan 17 17:27:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ cat libpod-1.8.0.tar.gz | podman exec -i 41d03453f tar tvz
drwxrwxr-x root/root 0 2020-02-06 22:22 libpod-1.8.0/
-rw-rw-r-- root/root 24746 2020-02-06 22:22 libpod-1.8.0/.cirrus.yml
drwxrwxr-x root/root 0 2020-02-06 22:22 libpod-1.8.0/.copr/
-rw-rw-r-- root/root 676 2020-02-06 22:22 libpod-1.8.0/.copr/Makefile
-rw-rw-r-- root/root 1084 2020-02-06 22:22 libpod-1.8.0/.copr/prepare.sh
drwxrwxr-x root/root 0 2020-02-06 22:22 libpod-1.8.0/.github/
-rw-rw-r-- root/root 1738 2020-02-06 22:22 libpod-1.8.0/.github/ISSUE_TEMPLATE.md
drwxrwxr-x root/root 0 2020-02-06 22:22 libpod-1.8.0/.github/workflows/
-rw-rw-r-- root/root 671 2020-02-06 22:22 libpod-1.8.0/.github/workflows/stale.yml
-rw-rw-r-- root/root 457 2020-02-06 22:22 libpod-1.8.0/.gitignore
-rw-rw-r-- root/root 479 2020-02-06 22:22 libpod-1.8.0/.golangci.yml
-rw-rw-r-- root/root 322 2020-02-06 22:22 libpod-1.8.0/.pre-commit-config.yaml
-rw-rw-r-- root/root 1766 2020-02-06 22:22 libpod-1.8.0/.ubuntu_prepare.sh
-rw-rw-r-- root/root 87135 2020-02-06 22:22 libpod-1.8.0/API.md
-rw-rw-r-- root/root 15798 2020-02-06 22:22 libpod-1.8.0/CONTRIBUTING.md
-rw-rw-r-- root/root 3401 2020-02-06 22:22 libpod-1.8.0/Dockerfile
-rw-rw-r-- root/root 2528 2020-02-06 22:22 libpod-1.8.0/Dockerfile.centos
-rw-rw-r-- root/root 2271 2020-02-06 22:22 libpod-1.8.0/Dockerfile.fedora
-rw-rw-r-- root/root 11357 2020-02-06 22:22 libpod-1.8.0/LICENSE
-rw-rw-r-- root/root 24980 2020-02-06 22:22 libpod-1.8.0/Makefile
-rw-rw-r-- root/root 258 2020-02-06 22:22 libpod-1.8.0/OWNERS
-rw-rw-r-- root/root 10461 2020-02-06 22:22 libpod-1.8.0/README.md
-rw-rw-r-- root/root 99783 2020-02-06 22:22 libpod-1.8.0/RELEASE_NOTES.md
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Error: non zero exit code: 2: OCI runtime error |
Just to clarify: pipes have nothing to do with this, at least not between host and container (possibly between conmon and podman though). Same thing happens with simple redirection: # podman exec -i alpine_container dd of=/tmp/aaa </bin/vi
1808+0 records in [ expected: 2747]
1808+0 records out
# !!
2696+0 records in
2696+0 records out Curiously, it does not seem to happen (despite dozens of retries) when # podman exec -i alpine_container dd of=/dev/null </bin/vi
2747+1 records in
2747+1 records out (I say "curiously" because conmon has no way of knowing that the container's output is |
This issue now blocks compatibility with the VSCode Remote extension (microsoft/vscode-remote-release#116 (comment)). |
Could it be a timing issue then? Writing |
Exact amount copied seems to vary, but on my system, it seems like ~60kb is the threshold for a successful, non-truncating copy. |
Fragment of strace, around where the copy stopped:
The file I sent wasn't evenly divisible by 512, which makes me think this might be client-side - we're reading along as normal, but then we get a read of 0 for EOF. The closes are pretty interesting, because I don't know where or why we're doing that, and why we're closing STDOUT after EOF on STDIN (and not STDERR, which remains open). |
Block size has an effect |
I was able to reproduce the issue fairly reliably (on Fedora 32 with 1.8.1). In one terminal I ran following command,
Btw my test file had 500 kB. While the loop was running it wasn’t printing anything, no truncation occurred. And then in the second terminal I spawned and exited another container (plain bash and just ran |
We've traced this further and believe that it's a problem somewhere in Conmon. For now, in use-cases related to |
and also don't forget |
It was resolved in containers/conmon#131 ,fix is in conmon >= 2.0.14 |
- exec: add test for containers#5046, in which conmon swallowed chars on a large byte transfer - pod: add 'pod exists' tests, both positive and negative; consolidate tests; add '--label', and check in 'pod inspect' add 'pod ps' tests - networking: add test for containers#5466, in which detached run with --userns=keep-id would not forward a port Signed-off-by: Ed Santiago <santiago@redhat.com>
Problem happens after all tests pass: Run command with stdout: podman exec --user pytest -i ansible-test-controller-hLEbtZTx sh -c 'tar cf - -C /root/ansible_collections/scale_computing/hypercore/tests --exclude .tmp output | gzip' Run command with stdin: tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests WARNING: Command "tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests" returned exit status 2. >>> Standard Error gzip: stdin: unexpected end of file tar: Unexpected EOF in archive Maybe this will help. See also containers/podman#5046 Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Problem happens after all tests pass: Run command with stdout: podman exec --user pytest -i ansible-test-controller-hLEbtZTx sh -c 'tar cf - -C /root/ansible_collections/scale_computing/hypercore/tests --exclude .tmp output | gzip' Run command with stdin: tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests WARNING: Command "tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests" returned exit status 2. >>> Standard Error gzip: stdin: unexpected end of file tar: Unexpected EOF in archive Maybe this will help. See also containers/podman#5046 Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Problem happens after all tests pass: Run command with stdout: podman exec --user pytest -i ansible-test-controller-hLEbtZTx sh -c 'tar cf - -C /root/ansible_collections/scale_computing/hypercore/tests --exclude .tmp output | gzip' Run command with stdin: tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests WARNING: Command "tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests" returned exit status 2. >>> Standard Error gzip: stdin: unexpected end of file tar: Unexpected EOF in archive Maybe this will help. See also containers/podman#5046 Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Problem happens after all tests pass: Run command with stdout: podman exec --user pytest -i ansible-test-controller-hLEbtZTx sh -c 'tar cf - -C /root/ansible_collections/scale_computing/hypercore/tests --exclude .tmp output | gzip' Run command with stdin: tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests WARNING: Command "tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests" returned exit status 2. >>> Standard Error gzip: stdin: unexpected end of file tar: Unexpected EOF in archive Maybe this will help. See also containers/podman#5046 Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
ansible-test-gh-action is used for ansible-test sanity and units. Some sanity and units test are update, as errors were reported. Gitlab CI config is removed, we do not need it any more. Podman is not used - we had some tar and pipe problems. See also containers/podman#5046 Problem happens after all tests pass: Run command with stdout: podman exec --user pytest -i ansible-test-controller-hLEbtZTx sh -c 'tar cf - -C /root/ansible_collections/scale_computing/hypercore/tests --exclude .tmp output | gzip' Run command with stdin: tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests WARNING: Command "tar oxzf - -C /home/runner/work/HyperCoreAnsibleCollection/HyperCoreAnsibleCollection/ansible_collections/scale_computing/hypercore/tests" returned exit status 2. >>> Standard Error gzip: stdin: unexpected end of file tar: Unexpected EOF in archive Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Hi,
I tried to get Ansible working with pipelining. Pipelining makes use of STDIN. The following command works fine with
1.8.0-dev
:echo 'print("a\n");'| podman exec -i 'ubi8' '/bin/sh' -c '/usr/bin/python3.6 && sleep 0'
But I get a failure if I try to inject something bigger (an Ansiblz). I managed to reproduce the problem with
dd
and an ubi8 container:Pass a content to
podman exec -i
.The content is truncated.
podman-1.8.0-1580495541.git4699d5e0.fc31.x86_64
The text was updated successfully, but these errors were encountered: