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

command 'tc' failed in /TargetContainer #215

Closed
steppangit opened this issue Jan 7, 2022 · 2 comments
Closed

command 'tc' failed in /TargetContainer #215

steppangit opened this issue Jan 7, 2022 · 2 comments

Comments

@steppangit
Copy link

Running pumba directyl in ubuntu 20.04.

  • tc is installed via iproute2 inside the TargetContainer.
  • which is installed inside TargetContainer.
  • docker exec -it TargetContainer which tc shows correct path.
  • User in TargetContainer is root
  • tried --cap-add=ALL to TargetContainer, doesn't help
  • sudo pumba doesn't help

Do you have any idea what I am missing?

Error Message is:
sudo pumba -l info netem --duration 15s delay --time 5000 TargetContainer
INFO[0000] Running netem command '[delay 5000ms 10ms 20.00]' on container c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2 for 15s app=pumba function=github.com/alexei-led/pumba/pkg/container.dockerClient.NetemContainer source=container/client.go:220
INFO[0000] start netem for container app=pumba dryrun=false function=github.com/alexei-led/pumba/pkg/container.dockerClient.startNetemContainer id=c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2 iface=eth0 name=/TargetContainer netem=delay 5000ms 10ms 20.00 source=container/client.go:276 tcimage=
ERRO[0003] command exited with error app=pumba exit=2 function=github.com/alexei-led/pumba/pkg/container.dockerClient.execOnContainer source=container/client.go:551
ERRO[0003] command 'tc' failed in /TargetContainer (c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2) container; run it in manually to debug app=pumba function=github.com/alexei-led/pumba/pkg/container.dockerClient.NetemContainer source=container/client.go:227
ERRO[0003] failed to start netem for container app=pumba error=command 'tc' failed in /TargetContainer (c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2) container; run it in manually to debug function=github.com/alexei-led/pumba/pkg/chaos/netem.runNetem source=netem/netem.go:26
ERRO[0003] failed to delay network for container app=pumba error=command 'tc' failed in /TargetContainer (c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2) container; run it in manually to debug function=github.com/alexei-led/pumba/pkg/chaos/netem.(*DelayCommand).Run source=netem/delay.go:178
ERRO[0003] failed to run chaos command app=pumba error=command 'tc' failed in /TargetContainer (c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2) container; run it in manually to debug function=github.com/alexei-led/pumba/pkg/chaos.RunChaosCommand source=chaos/command.go:79
FATA[0003] command 'tc' failed in /TargetContainer (c0d333418a6e15508d6a3a89d6872079a0a2277b19a7451fdaaf4633a50114b2) container; run it in manually to debug app=pumba function=main.main source=cmd/main.go:201

@steppangit
Copy link
Author

#159 which has been closed without a solution seems to be a similar issue.
Unfortunately I can't find any solutions.
TC does not work even with tc-image and commands from your own readme.
Could this be related to the host docker api running on windows?

@steppangit
Copy link
Author

steppangit commented Jan 24, 2022

I found out that this is purely a windows issue.
WSL 2 currently does not support tc with sch_netem.
If you really need to get this going with windows you need to compile and provide a custom kernel for WSL 2.
Works right away with Linux as a host.

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