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

Fedora - command 'tc' not found #121

Closed
diegolovison opened this issue Mar 2, 2019 · 2 comments
Closed

Fedora - command 'tc' not found #121

diegolovison opened this issue Mar 2, 2019 · 2 comments

Comments

@diegolovison
Copy link

I would like to run pumba on Fedora. Based on my researches there is no iproute2 package but there is iproute

I decided to run with docker run -it --rm --name tryme fedora:latest sh -c "yum -y install iproute && yum -y install iputils && ping www.google.com"

The console is printing

64 bytes from gru06s28-in-f4.1e100.net (172.217.29.228): icmp_seq=167 ttl=37 time=33.6 ms
64 bytes from gru06s28-in-f4.1e100.net (172.217.29.228): icmp_seq=168 ttl=37 time=33.5 ms
64 bytes from gru06s28-in-f4.1e100.net (172.217.29.228): icmp_seq=169 ttl=37 time=33.5 ms
64 bytes from gru06s28-in-f4.1e100.net (172.217.29.228): icmp_seq=170 ttl=37 time=33.4 ms
64 bytes from gru06s28-in-f4.1e100.net (172.217.29.228): icmp_seq=171 ttl=37 time=33.4 ms

In the other hand, I ran docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock gaiaadm/pumba netem --interface eth0 --duration 1m delay --time 3000 tryme and received the following error

ERRO[0000] command does not exist inside the container   app=pumba function=github.com/alexei-led/pumba/pkg/container.dockerClient.execOnContainer source="container/client.go:560"
ERRO[0000] command 'tc' not found inside the /tryme (e61e81d48df93ffa613111f571f22a5ea8454be267003b3827ee5dec44261e3e) container  app=pumba function=github.com/alexei-led/pumba/pkg/container.dockerClient.NetemContainer source="container/client.go:240"
ERRO[0000] failed to start netem for container           app=pumba error="command 'tc' not found inside the /tryme (e61e81d48df93ffa613111f571f22a5ea8454be267003b3827ee5dec44261e3e) container" function=github.com/alexei-led/pumba/pkg/chaos/netem.runNetem source="netem/netem.go:27"
ERRO[0000] failed to delay network for container         app=pumba container="{{0xc0003dc000 [] 0xc0003f0000 0xc0003f4000} {sha256:c582c1438f27b3775e2534abc82d14974ecb00c2c53161d05ec73a73d35e1235 [fedora:latest] [fedora@sha256:b41cd083421dd7aa46d619e958b75a026a5d5733f08f14ba6d53943d6106ea6d]   2018-09-07T19:20:02.809176076Z 4f9840a89fa4606d98d9c597752fa90bdd2ca35b38c4b01dca59c10295449948 0xc000404000 17.06.2-ce [Adam Miller <[email protected]>] [Patrick Uiterwijk <[email protected]>] 0xc000404140 amd64 linux  254169910 254169910 {map[WorkDir:/var/lib/docker/overlay2/26b3f5d54c8982559cc1b5dce7eb149867ea6341aec5d0d665ff184f0db3722d/work MergedDir:/var/lib/docker/overlay2/26b3f5d54c8982559cc1b5dce7eb149867ea6341aec5d0d665ff184f0db3722d/merged UpperDir:/var/lib/docker/overlay2/26b3f5d54c8982559cc1b5dce7eb149867ea6341aec5d0d665ff184f0db3722d/diff] overlay2} {layers [sha256:108b1c56d076789d94323e2bcaa7eb926485f8fc841d6c08335f39412d94b71c] } {{0 0 <nil>}}}}" error="command 'tc' not found inside the /tryme (e61e81d48df93ffa613111f571f22a5ea8454be267003b3827ee5dec44261e3e) container" function="github.com/alexei-led/pumba/pkg/chaos/netem.(*DelayCommand).Run.func1" source="netem/delay.go:187"
ERRO[0000] failed to run chaos command                   app=pumba error="command 'tc' not found inside the /tryme (e61e81d48df93ffa613111f571f22a5ea8454be267003b3827ee5dec44261e3e) container" function=github.com/alexei-led/pumba/pkg/chaos.RunChaosCommand source="chaos/command.go:79"
FATA[0000] command 'tc' not found inside the /tryme (e61e81d48df93ffa613111f571f22a5ea8454be267003b3827ee5dec44261e3e) container  app=pumba function=main.main source="cmd/main.go:162"

I decided to ssh the running instance with docker exec -i -t e61e81d /bin/bash
Inside the docker instance, I typed

[root@e61e81d48df9 /]# tc
Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }
       tc [-force] -batch filename
where  OBJECT := { qdisc | class | filter | action | monitor | exec }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[aw] |
                    -o[neline] | -j[son] | -p[retty] | -c[olor]
                    -b[atch] [filename] | -n[etns] name |
                    -nm | -nam[es] | { -cf | -conf } path }

Any idea why pumba is not working?

Thanks

@diegolovison
Copy link
Author

Using --tc-image helped --tc-image gaiadocker/iproute2

@dmurat
Copy link

dmurat commented Sep 21, 2019

For checking if some command exists, pumba uses which command. So in addition to tc command, the image also need to have which command installed.

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

3 participants