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

Container::exec weird behavior #270

Open
vv9k opened this issue Feb 11, 2021 · 2 comments
Open

Container::exec weird behavior #270

vv9k opened this issue Feb 11, 2021 · 2 comments

Comments

@vv9k
Copy link
Contributor

vv9k commented Feb 11, 2021

I'm trying to run bash -c 'curl https://google.com' in a container and this is the output that I'm receiving below.
In the example I only modified the command being run to this:

let options = ExecContainerOptions::builder() ‣options: ExecContainerOptions ‣ExecContainerOptionsBuilder
        .cmd(vec!["bash", "-c", "curl http://google.com"]) ‣&mut ExecContainerOptionsBuilder
        .env(vec!["VAR=value"]) ‣&mut ExecContainerOptionsBuilder
        .attach_stdout(true)
        .attach_stderr(true)
        .build();
❯ cargo run --example containerexec centt
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/containerexec centt`
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Tim
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xfer
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload
Stdout:   % Total    % Received % Xferd  Average
Stdout:   % Total    % Received % Xfe
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Spee
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    L
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Ti
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd  Averag
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average Sp
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Spee
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  Average Speed   Ti
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Lef
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Averag
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average Spee
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xfe
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Avera
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Aver
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  Avera
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Up
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received %
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Averag
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd  Av
Stdout:   % Total    % Received % Xferd
Stdout:   % Total    % Received % Xferd  A
Stdout:   % Total    % Received % Xferd  Ave
Stdout:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  • Crate version: master branch
  • OS: Arch Linux
  • Output of running docker version on the command line:
❯ docker version
Client:
 Version:           20.10.3
 API version:       1.41
 Go version:        go1.15.7
 Git commit:        48d30b5b32
 Built:             Tue Feb  2 19:54:22 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.3
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.15.7
  Git commit:       46229ca1d8
  Built:            Tue Feb  2 19:53:25 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b.m
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@vv9k
Copy link
Contributor Author

vv9k commented Feb 11, 2021

I also had a thought that perhaps my PR #251 could be the cause so I went ahead and tested it with a commit before it was merged and it shows the same output.

@vv9k
Copy link
Contributor Author

vv9k commented Feb 11, 2021

From further investigation it looks like no output is correct.

Here is a yum -y update as an example:

❯ cargo run --example containerexec centt
   Compiling shiplift v0.7.0 (/home/wojtek/dev/shiplift)
    Finished dev [unoptimized + debuginfo] target(s) in 4.27s
     Running `target/debug/examples/containerexec centt`
Stdout: CentOS Linux 8 - AppStream                      5.8 MB/s | 6.3 MB     00:01

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 907 to finish.

Stdout: Waiting for process with pid 940 to finish.

Stdout: Waiting for process with pid 946 to finish.

Stdout: Waiting for process with pid 919 to finish.

Stdout: Waiting for process with pid 926 to finish.

Stdout: Last metadata expiration check: 0:00:02 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:03 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:03 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:03 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:03 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:04 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:04 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:04 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:06 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:07 ago on Thu Feb 11 09:23:38 2021.

Stdout: Waiting for process with pid 980 to finish.

Stdout: Last metadata expiration check: 0:00:08 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:08 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:08 ago on Thu Feb 11 09:23:38 2021.

Stdout: Waiting for process with pid 1168 to finish.

Stdout: Last metadata expiration check: 0:00:09 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:09 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:09 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:10 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:10 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:10 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:10 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:11 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:11 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:11 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:12 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:12 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:12 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:13 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:13 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:13 ago on Thu Feb 11 09:23:38 2021.

Stdout: /var/cache/dnf/expired_repos.json is empty file

Stdout: Last metadata expiration check: 0:00:14 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:14 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:14 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:15 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:15 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:15 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:15 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:16 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:16 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:16 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:16 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:17 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:17 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:17 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:17 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:18 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:18 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:18 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:19 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:19 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:19 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:19 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:20 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:20 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:20 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:20 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:21 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:21 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:21 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:21 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:22 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:22 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:22 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:22 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:23 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:23 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:23 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:23 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:24 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:24 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:24 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:24 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:25 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:25 ago on Thu Feb 11 09:23:38 2021.

Stdout: Last metadata expiration check: 0:00:25 ago on Thu Feb 11 09:23:38 2021.

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

No branches or pull requests

1 participant