traas-stack / chaosmeta

A chaos engineering platform for supporting the complete fault drill lifecycle.
https://chaosmeta.gitbook.io/chaosmeta-cn
Apache License 2.0
318 stars 55 forks source link

Unable to inject memory faults when using minimalist container image (such as distroless or scratch) #94

Closed cycwll closed 10 months ago

cycwll commented 10 months ago

Error occurred: inject memory faults proportionally when using minimalist container image (such as distroless and scratch)

chaosmetad log:

./chaosmetad inject mem fill --percent=30 --mode=ram --timeout 180s --container-runtime containerd --container-id 0737e2e63ccd4c0df86b3b5a4c287c5732d9f2b92d0d1ecba390a8e5c4ae174e --log-level debug
DEBU[2023-10-17 14:38:06] get containerd client                        
DEBU[2023-10-17 14:38:06] new containerd client, ns: k8s.io, socket: /run/containerd/containerd.sock 
INFO[2023-10-17 14:38:06] uid: 202310171438066116                      
INFO[2023-10-17 14:38:06] args: {"percent":30,"mode":"ram"}            
DEBU[2023-10-17 14:38:06] get containerd client                        
DEBU[2023-10-17 14:38:06] container exec cmd: [/bin/bash -c /root/chaosmeta-github/chaosmeta/chaosmetad/tools/chaosmeta_execns -t 1083599  -m -c "grep -m1 MemTotal /proc/meminfo | sed 's/[^0-9]*//g'"] 
DEBU[2023-10-17 14:38:07] container exec result: exit code: 0, output: , err: <nil> 
ERRO[2023-10-17 14:38:07] inject error: calculateFillKBytes error: get total mem error: get total mem[] error: strconv.ParseFloat: parsing "": invalid syntax