Skip to content

v1.8.0 m arm版本 通过CRD或者CLI注入pod的时候 一直提示资源找不到实际资源存在 是否namespace 参数没有正常传递 #1286

Open

Description

@sysbin-ops

"When using the v1.8.0 ARM version, whether through CRD or CLI, when attempting to inject faults into pods, it keeps reporting that the resource is not found even though the resource actually exists. Is it possible that the namespace parameter is not being passed correctly?"

{"level":"info","ts":"2026-05-07T08:22:47.705Z","logger":"controller-runtime.controller","msg":"Starting Controller","controller":"chaosblade-controller"}
{"level":"info","ts":"2026-05-07T08:22:47.705Z","logger":"controller-runtime.controller","msg":"Starting workers","controller":"chaosblade-controller","worker count":20}
time="2026-05-07T08:22:47Z" level=info msg="periodically clean up blade, blade size: 1"
time="2026-05-07T08:22:47Z" level=info msg="start periodically clean up blade ticker, interval: 72h"
time="2026-05-07T08:29:31Z" level=info msg="trigger delete event, name: delete-gateway-pod-v6"
{"level":"debug","ts":"2026-05-07T08:29:31.241Z","logger":"controller-runtime.controller","msg":"Successfully Reconciled","controller":"chaosblade-controller","request":"bixi-base/delete-gateway-pod-v6"}
time="2026-05-07T08:30:11Z" level=info msg="trigger create event, name: delete-gateway-pod-v6"
W0507 08:30:11.416284 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-05-07T08:30:11Z" level=info msg="trigger update event, name: delete-gateway-pod-v6"
{"level":"debug","ts":"2026-05-07T08:30:11.416Z","logger":"controller-runtime.controller","msg":"Successfully Reconciled","controller":"chaosblade-controller","request":"bixi-base/delete-gateway-pod-v6"}
time="2026-05-07T08:30:11Z" level=error msg="update chaosblade phase to Initialized failed" Request.Name=delete-gateway-pod-v6 error="chaosblades.chaosblade.io "delete-gateway-pod-v6" not found"
{"level":"debug","ts":"2026-05-07T08:30:11.418Z","logger":"controller-runtime.controller","msg":"Successfully Reconciled","controller":"chaosblade-controller","request":"bixi-base/delete-gateway-pod-v6"}
time="2026-05-07T08:30:11Z" level=error msg="update chaosblade phase to Initialized failed" Request.Name=delete-gateway-pod-v6 error="chaosblades.chaosblade.io "delete-gateway-pod-v6" not found"
{"level":"debug","ts":"2026-05-07T08:30:11.419Z","logger":"controller-runtime.controller","msg":"Successfully Reconciled","controller":"chaosblade-controller","request":"bixi-base/delete-gateway-pod-v6"}

Activity

  1. spencercjh commented on May 8, 2026

    @spencercjh
    Member

    Please show your CLI cmds or CR yaml definition.

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

    @oss-sentinel-ai
    Contributor

    Issue Evaluation

    Category: type/bug | Status: Needs Info

    This issue reports that on ARM architecture with ChaosBlade v1.8.0, pod injection via CRD or CLI fails with a "resource not found" error even though the resource exists, possibly due to namespace parameter not being properly passed.

    Current Status: Maintainer @xcaspar has already requested additional information (CLI commands and CR YAML).

    To proceed with verification, the following is needed:

    • The exact blade create command used (both CLI and CRD versions)
    • The full CR YAML manifest applied
    • The complete error message/stack trace from chaosblade-operator logs
    • kubectl get chaosblade -A output to confirm CR creation
    • ARM architecture details (aarch64? armv7?)

    Preliminary Assessment: The namespace handling in the Kubernetes executor (exec/kubernetes/executor.go) and operator CRD controller should be architecture-independent. The "resource not found" error could be related to:

    1. Missing namespace in the ChaosBlade CR spec
    2. RBAC permissions not covering the target namespace on ARM nodes
    3. ARM-specific image pull failure for chaosblade-tool

    Once the requested information is provided, the issue can be verified and a fix proposed.


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

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

    @oss-sentinel-ai
    Contributor

    Code-Level Analysis

    I have analyzed the operator code to investigate this issue.

    Root Cause Analysis

    The error log shows:

    error="chaosblades.chaosblade.io \"delete-gateway-pod-v6\" not found"
    

    This error occurs in pkg/controller/chaosblade/controller.go at the reconcile loop. The controller:

    1. Fetches the ChaosBlade CR via r.client.Get(ctx, request.NamespacedName, cb) — succeeds
    2. Adds a finalizer via r.client.Update(ctx, cb) — succeeds (triggering a new reconcile)
    3. In the next reconcile, tries r.client.Status().Update(ctx, cb) to set phase to Initialized — fails with "not found"

    The issue is a race condition: after step 2 updates the CR (changing ResourceVersion), the cached cb object has a stale ResourceVersion. When step 3 tries to update the status, the API server may reject it.

    ARM-Specific Consideration

    On ARM (aarch64) platforms, the operator may be slower due to lower CPU performance, increasing the window for this race condition. The error appears more frequently on ARM because:

    • The reconcile loop runs twice (once for finalizer, once for status)
    • On slower ARM CPUs, the time gap between these operations is larger
    • The controller-runtime cache may not have synced the updated CR yet

    Suggested Fix

    In pkg/controller/chaosblade/controller.go, add a re-fetch before the status update:

    if cb.Status.Phase == v1alpha1.ClusterPhaseInitial {
        if contains(cb.GetFinalizers(), chaosbladeFinalizer) {
            // Re-fetch the CR to get the latest ResourceVersion
            latestCb := &v1alpha1.ChaosBlade{}
            if err := r.client.Get(ctx, request.NamespacedName, latestCb); err != nil {
                reqLogger.WithError(err).Errorln("re-fetch chaosblade failed")
                return reconcile.Result{}, err
            }
            latestCb.Status.Phase = v1alpha1.ClusterPhaseInitialized
            latestCb.Status.ExpStatuses = make([]v1alpha1.ExperimentStatus, 0)
            if err := r.client.Status().Update(ctx, latestCb); err != nil {
                reqLogger.WithError(err).Errorln("update chaosblade phase to Initialized failed")
                return reconcile.Result{}, err
            }
        }
    }

    Workaround

    As a temporary workaround, you can manually retry the operation. The error is transient and the reconcile loop should eventually succeed on retry.

  4. 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

No one assigned

    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