chaos-mesh / chaosd

A Chaos Engineering toolkit.
Apache License 2.0
132 stars 63 forks source link

PhysicalMachineChaos network-delay always failed, when I specify the device as eno1 #267

Open george-tj opened 1 month ago

george-tj commented 1 month ago

Chaosd Version: version.Info{GitVersion:"v1.4.0"

chaos-mesh. version. 2.6.1

network-delay.yaml

kind: PhysicalMachineChaos
apiVersion: chaos-mesh.org/v1alpha1
metadata:
  namespace: default
  name: 716-delaytest
  annotations:
    experiment.chaos-mesh.org/pause: 'true'
spec:
  action: network-delay
  address:
    - https://10.90.xx.xx:31768
  selector: {}
  mode: all
  uid: 24313fd9-bb12-43d1-bf7c-352e7c5febda
  network-delay:
    correlation: '1'
    device: eno1
    ip-protocol: all
    latency: 10ms

this is chaosd logs

Error #01: error.api.internal_server_error: error code: exit status 1, msg: Cannot find device "eth0"

2024-07-12T17:44:17.831+0800    INFO    chaosd/network.go:77    Set iptables chains     {"request": "chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUTipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"OUTPUT/0f86c_6de1a0ceef74c_\"  direction:OUTPUT  ipsets:\"chaos-0f86c27d-4061-43\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}  chains:{name:\"INPUT/69494_bd51fcc1249fa_\"  ipsets:\"chaos-694941c8-8aa6-4d\"  target:\"DROP\"}"}
2024-07-12T17:44:18.644+0800    INFO    chaosd/network.go:82    handling tc request     {"tcs": "tcs:{netem:{time:60000000}  protocol:\"all\"}  tcs:{netem:{time:10000  delay_corr:1}  protocol:\"all\"  device:\"eno1\"}"}
2024-07-12T17:44:18.645+0800    INFO    chaosd/network.go:194   get interfaces from net.Interfaces()    {"ifaces": ["lo", "eno1", "eno2","eno3", "eno4", "enp4s0f0", "enp4s0f1", "docker0", "cilium_net", "cilium_host", "lxc_health", "lxc83de1bafe8f7", "lxcf3ddf373bada", "lxcaca4c73bd34c", "lxcf195be21207b", "lxc5eb6b7528512", "lxc131f90ff0bd9", "lxca9b8af6e3554", "lxc679d3f83af0d", "lxc16543f6f65c7", "lxc3aed0b33320c", "lxcfdc870b5a756", "lxcba7aba5a9b9c", "lxc8f3bce4d4817", "lxcb46868fb4ad3", "lxce22edfa94ca7", "lxc301951db9fb9", "lxc59d658e894c4", "lxce94afce22afd", "lxc60aca64a7ca0", "lxcfb9cad4537ca", "lxc9cf7198b0ba8"]}
2024-07-12T17:44:18.688+0800    INFO    chaosdaemon/tc_server.go:184    adding prio     {"parent": 0}
2024-07-12T17:44:18.691+0800    ERROR   chaosd/network.go:194   error while adding prio {"error": "error code: exit status 1, msg: Cannotfind device \"eth0\"\n", "errorVerbose": "error code: exit status 1, msg: Cannot find device \"eth0\"\n\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon/util.EncodeOutputToError\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/util/util.go:118\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon.(*tcClient).addPrio\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/tc_server.go:369\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon.(*DaemonServer).setFilterTcs\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/tc_server.go:234\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon.(*DaemonServer).SetTcs\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/tc_server.go:184\ngithub.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).applyTC\n\t/__w/chaosd/chaosd/pkg/server/chaosd/network.go:194\ngithub.com/chaos-mesh/chaosd/pkg/server/chaosd.networkAttack.Attack\n\t/__w/chaosd/chaosd/pkg/server/chaosd/network.go:82\ngithub.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).ExecuteAttack\n\t/__w/chaosd/chaosd/pkg/server/chaosd/attack.go:105\ngithub.com/chaos-mesh/chaosd/pkg/server/httpserver.(*HttpServer).createNetworkAttack\n\t/__w/chaosd/chaosd/pkg/server/httpserver/server.go:174\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/chaos-mesh/chaosd/pkg/server/httpserver.authenticateClientCert.func1\n\t/__w/chaosd/chaosd/pkg/server/httpserver/auth.go:125\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/chaos-mesh/chaosd/pkg/server/utils.MWHandleErrors.func1\n\t/__w/chaosd/chaosd/pkg/server/utils/error.go:47\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572\nnet/http.serverHandler.ServeHTTP\n\t/__t/go/1.18.2/x64/src/net/http/server.go:2916\nnet/http.(*conn).serve\n\t/__t/go/1.18.2/x64/src/net/http/server.go:1966\nruntime.goexit\n\t/__t/go/1.18.2/x64/src/runtime/asm_amd64.s:1571"}
github.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).applyTC
        /__w/chaosd/chaosd/pkg/server/chaosd/network.go:194
github.com/chaos-mesh/chaosd/pkg/server/chaosd.networkAttack.Attack
        /__w/chaosd/chaosd/pkg/server/chaosd/network.go:82
github.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).ExecuteAttack
        /__w/chaosd/chaosd/pkg/server/chaosd/attack.go:105
github.com/chaos-mesh/chaosd/pkg/server/httpserver.(*HttpServer).createNetworkAttack
        /__w/chaosd/chaosd/pkg/server/httpserver/server.go:174
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/chaos-mesh/chaosd/pkg/server/httpserver.authenticateClientCert.func1
        /__w/chaosd/chaosd/pkg/server/httpserver/auth.go:125
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/chaos-mesh/chaosd/pkg/server/utils.MWHandleErrors.func1
        /__w/chaosd/chaosd/pkg/server/utils/error.go:47
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.LoggerWithConfig.func1
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616
github.com/gin-gonic/gin.(*Engine).ServeHTTP
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572
net/http.serverHandler.ServeHTTP
        /__t/go/1.18.2/x64/src/net/http/server.go:2916
net/http.(*conn).serve
        /__t/go/1.18.2/x64/src/net/http/server.go:1966
2024-07-12T17:44:18.692+0800    ERROR   chaosd/network.go:82    error while setting filter tc   {"error": "error code: exit status 1, msg: Cannot find device \"eth0\"\n", "errorVerbose": "error code: exit status 1, msg: Cannot find device \"eth0\"\n\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon/util.EncodeOutputToError\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/util/util.go:118\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon.(*tcClient).addPrio\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/tc_server.go:369\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon.(*DaemonServer).setFilterTcs\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/tc_server.go:234\ngithub.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon.(*DaemonServer).SetTcs\n\t/github/home/go/pkg/mod/github.com/chaos-mesh/chaos-mesh@v0.9.1-0.20220812140450-4bc7ef589c13/pkg/chaosdaemon/tc_server.go:184\ngithub.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).applyTC\n\t/__w/chaosd/chaosd/pkg/server/chaosd/network.go:194\ngithub.com/chaos-mesh/chaosd/pkg/server/chaosd.networkAttack.Attack\n\t/__w/chaosd/chaosd/pkg/server/chaosd/network.go:82\ngithub.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).ExecuteAttack\n\t/__w/chaosd/chaosd/pkg/server/chaosd/attack.go:105\ngithub.com/chaos-mesh/chaosd/pkg/server/httpserver.(*HttpServer).createNetworkAttack\n\t/__w/chaosd/chaosd/pkg/server/httpserver/server.go:174\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/chaos-mesh/chaosd/pkg/server/httpserver.authenticateClientCert.func1\n\t/__w/chaosd/chaosd/pkg/server/httpserver/auth.go:125\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/chaos-mesh/chaosd/pkg/server/utils.MWHandleErrors.func1\n\t/__w/chaosd/chaosd/pkg/server/utils/error.go:47\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t/github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572\nnet/http.serverHandler.ServeHTTP\n\t/__t/go/1.18.2/x64/src/net/http/server.go:2916\nnet/http.(*conn).serve\n\t/__t/go/1.18.2/x64/src/net/http/server.go:1966\nruntime.goexit\n\t/__t/go/1.18.2/x64/src/runtime/asm_amd64.s:1571"}
github.com/chaos-mesh/chaosd/pkg/server/chaosd.networkAttack.Attack
        /__w/chaosd/chaosd/pkg/server/chaosd/network.go:82
github.com/chaos-mesh/chaosd/pkg/server/chaosd.(*Server).ExecuteAttack
        /__w/chaosd/chaosd/pkg/server/chaosd/attack.go:105
github.com/chaos-mesh/chaosd/pkg/server/httpserver.(*HttpServer).createNetworkAttack
        /__w/chaosd/chaosd/pkg/server/httpserver/server.go:174
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/chaos-mesh/chaosd/pkg/server/httpserver.authenticateClientCert.func1
        /__w/chaosd/chaosd/pkg/server/httpserver/auth.go:125
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/chaos-mesh/chaosd/pkg/server/utils.MWHandleErrors.func1
        /__w/chaosd/chaosd/pkg/server/utils/error.go:47
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.LoggerWithConfig.func1
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240
github.com/gin-gonic/gin.(*Context).Next
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616
github.com/gin-gonic/gin.(*Engine).ServeHTTP
        /github/home/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572
net/http.serverHandler.ServeHTTP
        /__t/go/1.18.2/x64/src/net/http/server.go:2916
net/http.(*conn).serve
        /__t/go/1.18.2/x64/src/net/http/server.go:1966