Skip to content

add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory #1267

Open

Description

@Yotainming

Issue Description

Type: bug report

Describe what happened (or what feature you want)

create cpu fullload to k8s pod

Describe what you expected to happen

create cpu fullload success

How to reproduce it (as minimally and precisely as possible)

./blade create k8s pod-cpu load --names etcd-0 --namespace default
{"code":54000,"success":false,"error":"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory","result":{"uid":"037fdc19967aa684","success":false,"error":"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory","statuses":[{"state":"Error","error":"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory","success":false,"kind":"pod","identifier":"default/pekphis562303/etcd-0/etcd/66c9bbe20a40/docker"}]}}

kubectl logs -f chaosblade-operator-6fd88cdf54-m94rc -n chaosblade
time="2026-01-12T06:30:20Z" level=info msg="trigger create event, name: 037fdc19967aa684"
time="2026-01-12T06:30:20Z" level=debug msg="creating obj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208188 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase: ExpStatuses:[]}}"
time="2026-01-12T06:30:20Z" level=info msg="trigger update event, name: 037fdc19967aa684"
W0112 06:30:20.310145       1 warnings.go:70] metadata.finalizers: "finalizer.chaosblade.io": prefer a domain-qualified finalizer name to avoid accidental conflicts with other finalizer writers
time="2026-01-12T06:30:20Z" level=debug msg="updating oldObj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208188 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase: ExpStatuses:[]}}"
time="2026-01-12T06:30:20Z" level=debug msg="updating newObj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208189 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[finalizer.chaosblade.io] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:metadata\":{\"f:finalizers\":{\".\":{},\"v:\\\"finalizer.chaosblade.io\\\"\":{}}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase: ExpStatuses:[]}}"
time="2026-01-12T06:30:20Z" level=info msg="trigger update event, name: 037fdc19967aa684"
time="2026-01-12T06:30:20Z" level=debug msg="updating oldObj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208189 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[finalizer.chaosblade.io] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:metadata\":{\"f:finalizers\":{\".\":{},\"v:\\\"finalizer.chaosblade.io\\\"\":{}}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase: ExpStatuses:[]}}"
time="2026-01-12T06:30:20Z" level=debug msg="updating newObj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208190 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[finalizer.chaosblade.io] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:metadata\":{\"f:finalizers\":{\".\":{},\"v:\\\"finalizer.chaosblade.io\\\"\":{}}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:status\":{\".\":{},\"f:expStatuses\":{},\"f:phase\":{}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase:Initialized ExpStatuses:[]}}"
time="2026-01-12T06:30:20Z" level=info msg="start to create experiment" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=debug msg="namespace: default, labels: , names: etcd-0" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="get pods by names etcd-0, len is 1" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="creating pod experiment, pod count is 1" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="set container list: [{Id: ContainerRuntime:docker ContainerId:66c9bbe20a40 ContainerName:etcd PodName:etcd-0 NodeName:pekphis562303 Namespace:default}]" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="start to execute: &{Target:cpu Scope:pod ActionName:fullload ActionFlags:map[cgroup-root:/host-sys/fs/cgroup chaosblade-deploy-mode: chaosblade-download-url: chaosblade-path: climb-time: cpu-count: cpu-index: cpu-list: cpu-percent: endpoint: evict-count: evict-group: evict-percent: labels: names:etcd-0 namespace:default timeout: uid:] ActionPrograms:[] ActionCategories:[] ActionProcessHang:false}" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="experiment identifiers: [{{ docker 66c9bbe20a40 etcd etcd-0 pekphis562303 default} /opt/chaosblade/blade create cri cpu fullload  --cgroup-root=/host-sys/fs/cgroup --container-id 66c9bbe20a40 --container-runtime docker  0 chaosblade-tool-8wn88 chaosblade chaosblade-tool}]" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="execute identifier: {ContainerObjectMeta:{Id: ContainerRuntime:docker ContainerId:66c9bbe20a40 ContainerName:etcd PodName:etcd-0 NodeName:pekphis562303 Namespace:default} Command:/opt/chaosblade/blade create cri cpu fullload  --cgroup-root=/host-sys/fs/cgroup --container-id 66c9bbe20a40 --container-runtime docker Error: Code:0 ChaosBladePodName:chaosblade-tool-8wn88 ChaosBladeNamespace:chaosblade ChaosBladeContainerName:chaosblade-tool}" experiment=037fdc19967aa684
time="2026-01-12T06:30:20Z" level=info msg="Exec command in pod" command="[/opt/chaosblade/blade create cri cpu fullload  --cgroup-root=/host-sys/fs/cgroup --container-id 66c9bbe20a40 --container-runtime docker]" container=chaosblade-tool podName=chaosblade-tool-8wn88 podNamespace=chaosblade
time="2026-01-12T06:30:21Z" level=info msg="get err message" command="[/opt/chaosblade/blade create cri cpu fullload  --cgroup-root=/host-sys/fs/cgroup --container-id 66c9bbe20a40 --container-runtime docker]" container=chaosblade-tool err="{\"code\":63063,\"success\":false,\"error\":\"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory\"}" out= podName=chaosblade-tool-8wn88 podNamespace=chaosblade
time="2026-01-12T06:30:21Z" level=error msg="`pods/exec`: k8s exec failed, err: {\"code\":63063,\"success\":false,\"error\":\"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory\"}\n" location=github.com/chaosblade-io/chaosblade-operator/exec/model.execCommands.func1 uid=
time="2026-01-12T06:30:21Z" level=info msg="success: false, statuses: [{Id: State:Error Code:63063 Error:add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory Success:false Kind:pod Identifier:default/pekphis562303/etcd-0/etcd/66c9bbe20a40/docker}]" experiment=037fdc19967aa684
W0112 06:30:21.547492       1 warnings.go:70] unknown field "status.expStatuses[0].resStatuses[0].code"
time="2026-01-12T06:30:21Z" level=info msg="trigger update event, name: 037fdc19967aa684"
time="2026-01-12T06:30:21Z" level=debug msg="updating oldObj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208190 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[finalizer.chaosblade.io] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:metadata\":{\"f:finalizers\":{\".\":{},\"v:\\\"finalizer.chaosblade.io\\\"\":{}}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:status\":{\".\":{},\"f:expStatuses\":{},\"f:phase\":{}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase:Initialized ExpStatuses:[]}}"
time="2026-01-12T06:30:21Z" level=debug msg="updating newObj: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:037fdc19967aa684 GenerateName: Namespace: SelfLink: UID:64426b6e-8153-475c-9de2-22fefbc7e293 ResourceVersion:208195 Generation:1 CreationTimestamp:2026-01-12 06:30:20 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[finalizer.chaosblade.io] ClusterName: ManagedFields:[{Manager:blade Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:experiments\":{}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:20 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:metadata\":{\"f:finalizers\":{\".\":{},\"v:\\\"finalizer.chaosblade.io\\\"\":{}}}}} {Manager:chaosblade-operator Operation:Update APIVersion:chaosblade.io/v1alpha1 Time:2026-01-12 06:30:21 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:status\":{\".\":{},\"f:expStatuses\":{},\"f:phase\":{}}}}]} Spec:{Experiments:[{Scope:pod Target:cpu Action:fullload Desc:created by blade command Matchers:[{Name:endpoint Value:[]} {Name:names Value:[etcd-0]} {Name:cgroup-root Value:[/host-sys/fs/cgroup]} {Name:chaosblade-download-url Value:[]} {Name:cpu-list Value:[]} {Name:chaosblade-deploy-mode Value:[]} {Name:evict-group Value:[]} {Name:evict-percent Value:[]} {Name:namespace Value:[default]} {Name:cpu-index Value:[]} {Name:climb-time Value:[]} {Name:cpu-count Value:[]} {Name:cpu-percent Value:[]} {Name:evict-count Value:[]} {Name:labels Value:[]} {Name:timeout Value:[]} {Name:chaosblade-path Value:[]} {Name:uid Value:[]}]}]} Status:{Phase:Error ExpStatuses:[{Scope:pod Target:cpu Action:fullload Success:false State:Error Error:see resStatus for the error details ResStatuses:[{Id: State:Error Code:0 Error:add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory Success:false Kind:pod Identifier:default/pekphis562303/etcd-0/etcd/66c9bbe20a40/docker}]}]}}"

kubectl exec -it chaosblade-tool-8wn88 -n chaosblade bash
cat logs/chaosblade.log
time="2026-01-12 06:30:21.13654668 UTC" level=warning msg="cgroup path does not exist: /kubepods-burstable.slice/kubepods-burstable-poda91e6913_ec33_478f_a1b7_7e06fd239097.slice/docker-66c9bbe20a402b7742ca1fed0ee197080326ccb06aa70b65e004c57e93651f94.scope, trying to create" location="/home/runner/go/pkg/mod/github.com/chaosblade-io/chaosblade-exec-cri@v1.8.0/exec/executor_common_linux.go:192" uid=e13234197d0b2c89
time="2026-01-12 06:30:21.136713711 UTC" level=warning msg="NewManager failed with path /../../../kubepods-burstable.slice/kubepods-burstable-poda91e6913_ec33_478f_a1b7_7e06fd239097.slice/docker-66c9bbe20a402b7742ca1fed0ee197080326ccb06aa70b65e004c57e93651f94.scope, trying root path as fallback" location="/home/runner/go/pkg/mod/github.com/chaosblade-io/chaosblade-exec-cri@v1.8.0/exec/executor_common_linux.go:219" uid=e13234197d0b2c89
time="2026-01-12 06:30:21.136738937 UTC" level=info msg="Successfully created cgroup manager with root path as fallback" location="/home/runner/go/pkg/mod/github.com/chaosblade-io/chaosblade-exec-cri@v1.8.0/exec/executor_common_linux.go:224" uid=e13234197d0b2c89

Tell us your environment

cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

docker info | grep Cgroup
 Cgroup Driver: systemd
 Cgroup Version: 2

stat -fc %T /sys/fs/cgroup/
cgroup2fs

find /sys/fs/cgroup -name "cgroup.controllers"
/sys/fs/cgroup/cgroup.controllers

blade version
ChaosBlade Version Information:
==============================
Version:     1.8.0
Git Tag:     v1.8.0
Git Commit:  7dd785f
Git Branch:  HEAD
Build Time:  Mon Oct 20 03:37:24 UTC 2025
Release:     Yes (Production)
==============================

kubectl version
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.3", GitCommit:"9e644106593f3f4aa98f8a84b23db5fa378900bd", GitTreeState:"clean", BuildDate:"2023-03-15T13:40:17Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"31", GitVersion:"v1.31.4", GitCommit:"a78aa47129b8539636eb86a9d00e31b2720fe06b", GitTreeState:"clean", BuildDate:"2024-12-10T11:37:27Z", GoVersion:"go1.22.9", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.26) and server (1.31) exceeds the supported minor version skew of +/-1

Anything else we need to know?

if i create cpu fillload to container directly on host, appears finish with success...

./blade create cri cpu fullload  --cgroup-root=/sys/fs/cgroup --container-id 66c9bbe20a40 --container-runtime docker --debug
{"code":200,"success":true,"result":"0ea6d5973167e691"}

Activity

  1. xcaspar commented on Jan 12, 2026

    @xcaspar
    Member

    The issue might be due to a missing /proc directory mapping. If the chaosblade-tool Pod doesn't mount /proc on the host machine, it can't find the corresponding cgroup path using the container ID. You can modify the chaosblade-tool daemonset as follows:

    volumeMounts:
      - name: host-proc
        mountPath: /host-proc
        readOnly: true
    volumes:
      - name: host-proc
        hostPath:
          path: /proc
    

    The above is a speculation based on the error message. Please provide feedback on the modified execution result.

  2. self-assigned this
    on Jan 12, 2026
  3. Yotainming commented on Jan 12, 2026

    @Yotainming
    Author

    error message still the same:

    ./blade create k8s pod-cpu load --names etcd-0 --namespace default --kubeconfig=/data/jenkins/workspace/DSTest/latest/DataSystemTest/conf/config
    {"code":54000,"success":false,"error":"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory","result":{"uid":"48359faaaa4e1b89","success":false,"error":"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory","statuses":[{"state":"Error","error":"add process to cgroups V2 failed, write /host-sys/fs/cgroup/cgroup.procs: no such file or directory","success":false,"kind":"pod","identifier":"default/pekphis562303/etcd-0/etcd/66c9bbe20a40/docker"}]}}
    
    kubectl describe pod chaosblade-tool-p4gnf -n chaosblade bash
    
    ...
    
        Mounts:
          /etc/containerd from containerd-etc (rw)
          /etc/docker from docker-etc (rw)
          /etc/hosts from hosts (rw)
          /host-proc from proc (ro)
          /host-sys from sys (rw)
          /opt/chaosblade/chaosblade.dat from chaosblade-db-volume (rw)
          /run/containerd from containerd (rw)
          /var/lib/containerd from containerd-lib (rw)
          /var/lib/docker from docker-lib (rw)
          /var/log/audit from audit (rw)
          /var/run/docker.sock from docker-socket (rw)
          /var/run/netns from netns (rw)
          /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-twf5h (ro)
    Conditions:
      Type                        Status
      PodReadyToStartContainers   True
      Initialized                 True
      Ready                       True
      ContainersReady             True
      PodScheduled                True
    Volumes:
      docker-socket:
        Type:          HostPath (bare host directory volume)
        Path:          /var/run/docker.sock
        HostPathType:
      chaosblade-db-volume:
        Type:          HostPath (bare host directory volume)
        Path:          /var/run/chaosblade.dat
        HostPathType:  FileOrCreate
      hosts:
        Type:          HostPath (bare host directory volume)
        Path:          /etc/hosts
        HostPathType:
      docker-lib:
        Type:          HostPath (bare host directory volume)
        Path:          /var/lib/docker
        HostPathType:
      docker-etc:
        Type:          HostPath (bare host directory volume)
        Path:          /etc/docker
        HostPathType:
      audit:
        Type:          HostPath (bare host directory volume)
        Path:          /var/log/audit
        HostPathType:
      containerd:
        Type:          HostPath (bare host directory volume)
        Path:          /run/containerd
        HostPathType:
      containerd-lib:
        Type:          HostPath (bare host directory volume)
        Path:          /var/lib/containerd
        HostPathType:
      containerd-etc:
        Type:          HostPath (bare host directory volume)
        Path:          /etc/containerd
        HostPathType:
      netns:
        Type:          HostPath (bare host directory volume)
        Path:          /var/run/netns
        HostPathType:
      sys:
        Type:          HostPath (bare host directory volume)
        Path:          /sys
        HostPathType:
      proc:
        Type:          HostPath (bare host directory volume)
        Path:          /proc
        HostPathType:
    
    ...

    i also check difference between container and host in log:

    time="2026-01-12 06:54:16.485758056 UTC" level=debug msg="full cgroup path: /kubepods-burstable.slice/kubepods-burstable-poda91e6913_ec33_478f_a1b7_7e06fd239097.slice/docker-66c9bbe20a402b7742ca1fed0ee197080326ccb06aa70b65e004c57e93651f94.scope" location="/home/runner/go/pkg/mod/github.com/chaosblade-io/chaosblade-exec-cri@v1.8.0/exec/executor_common_linux.go:189" uid=70432a326b57a1b1

    time="2026-01-12 16:08:26.005217955 CST" level=debug msg="full cgroup path: /sys/fs/cgroup/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-poda91e6913_ec33_478f_a1b7_7e06fd239097.slice/docker-66c9bbe20a402b7742ca1fed0ee197080326ccb06aa70b65e004c57e93651f94.scope" location="/home/runner/go/pkg/mod/github.com/chaosblade-io/chaosblade-exec-cri@v1.8.0/exec/executor_common_linux.go:189" uid=0ea6d5973167e691

    code at https://github.com/chaosblade-io/chaosblade-exec-cri/blob/main/exec/executor_common_linux.go#L205, maybe we need to deal with difference between container and host env?

  4. oss-sentinel-ai commented on Jun 4, 2026

    @oss-sentinel-ai
    Contributor

    Issue Evaluation

    Category: type/bug | Status: Needs Investigation | Severity: Medium

    The issue reports that pod-cpu load fails on K8s pods with error: write /host-sys/fs/cgroup/cgroup.procs: no such file or directory. This occurs when using ChaosBlade with cgroups V2 (unified hierarchy).

    Analysis:

    • The error indicates the code is looking for /host-sys/fs/cgroup/cgroup.procs at the root cgroup level, which doesn't exist in cgroups V2 unified hierarchy
    • In cgroups V2, the root cgroup does NOT have cgroup.procs - processes must be in leaf cgroups
    • The container's cgroup path needs to be resolved correctly: /sys/fs/cgroup/<container-cgroup-path>/cgroup.procs
    • @xcaspar's suggestion to mount /proc was attempted but did not resolve the issue

    Likely Root Cause: The cgroup path resolution in chaosblade-exec-os does not correctly handle cgroups V2 when:

    1. The container runtime uses systemd cgroup driver (cgroup path includes .slice hierarchy)
    2. The code attempts to write to the root cgroup instead of the container's leaf cgroup

    To fully diagnose, please provide:

    • Container runtime and version (containerd/docker/cri-o)
    • K8s version and node OS
    • Output of cat /proc/1/cgroup inside the target pod
    • Output of mount | grep cgroup on the node
    • Whether the cluster uses systemd cgroup driver

    Automated evaluation by oss-taishan-ai - ChaosBlade Community Bot

  5. oss-sentinel-ai commented on Jun 8, 2026

    @oss-sentinel-ai
    Contributor

    Code-Level Analysis

    I have analyzed the cgroup v2 handling in the codebase.

    Root Cause

    The error write /host-sys/fs/cgroup/cgroup.procs: no such file or directory occurs during CPU fullload experiment on a cgroup v2 node.

    From the operator logs, the CR matchers show:

    - name: cgroup-root
      value: [/host-sys/fs/cgroup]

    The chaosblade-tool DaemonSet (from deploy/helm/chaosblade-operator/templates/daemonset.yaml) mounts:

    volumeMounts:
      - mountPath: /host-sys
        name: sys
    volumes:
      - hostPath:
          path: /sys
        name: sys

    So /host-sys/fs/cgroup maps to the host's /sys/fs/cgroup.

    Why It Fails on cgroup v2

    On cgroup v2 systems, the unified hierarchy at /sys/fs/cgroup has a different structure than cgroup v1:

    1. Root cgroup.procs may not be writable: In many cgroup v2 configurations (especially with systemd as the init system), the root cgroup's cgroup.procs is managed by systemd and writing to it directly fails.

    2. Process must be in a child cgroup: cgroup v2 requires processes to be in a proper child cgroup, not the root. The code needs to create/find a child cgroup (e.g., /sys/fs/cgroup/chaosblade/) and write the PID there.

    3. The cgroup-root path: The default /host-sys/fs/cgroup points to the root of the cgroup v2 hierarchy. The code should instead use a child cgroup path like /host-sys/fs/cgroup/chaosblade or the cgroup of the target container.

    Fix

    Option A: Use the target container's cgroup

    Instead of writing to the root cgroup.procs, the code should detect the target container's cgroup path and use that:

    # Get the container's cgroup from /proc/<pid>/cgroup
    cat /proc/<pid>/cgroup
    # On cgroup v2, this returns: 0::/kubepods/pod<pod-uid>/<container-id>
    # Use this path under /host-sys/fs/cgroup/

    Option B: Create a dedicated chaosblade cgroup

    # Create a child cgroup for chaosblade experiments
    mkdir -p /host-sys/fs/cgroup/chaosblade
    # Write the process PID to this child cgroup
    echo <pid> > /host-sys/fs/cgroup/chaosblade/cgroup.procs

    Option C: Auto-detect cgroup version and adjust behavior

    The chaosblade-exec-os code already has cgroup v2 detection in pkg/automaxprocs/cgroups/. The CPU experiment should use this detection to determine the correct cgroup path:

    cgroupPath, err := cgroups.FindCGroupV2Path(ctx, pid, cgroupRoot)
    if err == nil && cgroupPath != "" {
        // Use cgroup v2 path
    } else {
        // Fall back to cgroup v1
    }

    Workaround

    For users hitting this issue:

    1. Check if your node uses cgroup v2: stat -fc %T /sys/fs/cgroup should return cgroup2fs
    2. Try specifying a more specific cgroup path:
      blade create k8s pod-cpu load --names etcd-0 --namespace default --cgroup-root /host-sys/fs/cgroup/kubepods
    3. Or use a different experiment target that does not require cgroup manipulation (e.g., pod-network experiments).
  6. woyaonidish commented on Jun 8, 2026

    @woyaonidish
    Contributor

    /approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions