Skip to content

Cannot delete namespaces #943

@AdamSendible

Description

@AdamSendible

Issue

When trying to delete a TemporalNamespace I often encounter issues where the operator gets stuck and fails to reconcile Temporal namespaces.

Logs

│ 2025-06-26T14:35:39Z    INFO    Starting reconciliation    {"controller": "temporalnamespace", "controllerGroup": "temporal.io", "controllerKind": "TemporalNamespace", "TemporalNamespace": {"name":"debugging │
│ ","namespace":"workers"}, "namespace": "workers", "name": "debugging", "reconcileID": "984db7f0-dc94-42d4-9c90-4f37195c34ce"}                                                                                   │
│ 2025-06-26T14:35:39Z    INFO    Deleting namespace    {"controller": "temporalnamespace", "controllerGroup": "temporal.io", "controllerKind": "TemporalNamespace", "TemporalNamespace": {"name":"debugging","na │
│ mespace":"workers"}, "namespace": "workers", "name": "debugging", "reconcileID": "984db7f0-dc94-42d4-9c90-4f37195c34ce"}                                                                                        │
│ 2025-06-26T14:35:39Z    DEBUG    Connecting to temporal cluster    {"controller": "temporalnamespace", "controllerGroup": "temporal.io", "controllerKind": "TemporalNamespace", "TemporalNamespace": {"name":"d │
│ ebugging","namespace":"workers"}, "namespace": "workers", "name": "debugging", "reconcileID": "984db7f0-dc94-42d4-9c90-4f37195c34ce", "address": "active-frontend.temporal:7233"}                               │
│ 2025-06-26T14:35:39Z    INFO    try to delete but not found    {"controller": "temporalnamespace", "controllerGroup": "temporal.io", "controllerKind": "TemporalNamespace", "TemporalNamespace": {"name":"debug │
│ ging","namespace":"workers"}, "namespace": "workers", "name": "debugging", "reconcileID": "984db7f0-dc94-42d4-9c90-4f37195c34ce", "namespace": "debugging"}                                                     │
│ 2025-06-26T14:35:39Z    ERROR    Reconciler error    {"controller": "temporalnamespace", "controllerGroup": "temporal.io", "controllerKind": "TemporalNamespace", "TemporalNamespace": {"name":"debugging","nam │
│ espace":"workers"}, "namespace": "workers", "name": "debugging", "reconcileID": "984db7f0-dc94-42d4-9c90-4f37195c34ce", "error": "unable to patch object: TemporalNamespace.temporal.io \"debugging\" is invali │
│ d: metadata.finalizers: Forbidden: no new finalizers can be added if the object is being deleted, found new finalizers []string{\"foregroundDeletion\"}", "errorCauses": [{"error": "unable to patch object: Te │
│ mporalNamespace.temporal.io \"debugging\" is invalid: metadata.finalizers: Forbidden: no new finalizers can be added if the object is being deleted, found new finalizers []string{\"foregroundDeletion\"}", "e │
│ rrorCauses": [{"error": "unable to patch object: TemporalNamespace.temporal.io \"debugging\" is invalid: metadata.finalizers: Forbidden: no new finalizers can be added if the object is being deleted, found n │
│ ew finalizers []string{\"foregroundDeletion\"}"}]}]}                                                                                                                                                            │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler                                                                                                                      │
│     /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316                                                                                                                │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem                                                                                                                   │
│     /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:263                                                                                                                │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2                                                                                                                         │
│     /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:224 

Current Workaround

To solve this I usually have to manually remove the finalizer from the TemporalNamespace object and also restart the operator itself as it gets stuck

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions