Eventing: Deletion of Subscription hangs forever when the subscription status.Ready is not True

Created on 25 Mar 2021  路  2Comments  路  Source: knative/eventing

Describe the bug
When a Subscription is not in a Ready status (e.g Reason: ChannelReferenceFailed, SubscriberResolveFailed) ,
kubectl delete subscription {subscription name} just hangs there after subscription.messaging.knative.dev "subscription name" deleted message printed. The subscription still exist.

Expected behavior
A Subscription should be able to be deleted even if the referenced resources don't exist.

To Reproduce
kubectl apply:

apiVersion: messaging.knative.dev/v1
kind: Subscription
metadata:
  namespace: parallel-demo
  name: even-filter-subscription
spec:
  channel:
    apiVersion: messaging.knative.dev/v1alpha1
    kind: Channel
    name: even-filter-channel
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: even-filter

Story:

  • I found an usage of channel.messaging.knative.dev/v1alpha1 in an event source example, after I applied the subscription above, I found out that
    channel.messaging.knative.dev/v1alpha1 is not available for my knative version(It says "error: unable to recognize "test.yaml": no matches for kind "Channel" in version "messaging.knative.dev/v1alpha1" while I try to apply).
  • Since I can't modify the spec.channel.apiVersion & spec.channel.kind attribute:
admission webhook "validation.webhook.eventing.knative.dev" denied the request: validation failed: Immutable fields changed (-old +new): spec
{v1.SubscriptionSpec}.Channel.Kind: 
        -: "Channel"
        +: "InMemoryChannel"
{v1.SubscriptionSpec}.Channel.APIVersion:
        -: "messaging.knative.dev/v1alpha1"
        +: "messaging.knative.dev/v1"
  • I decide to delete this subscription and create a new one but I just hung there after kubectl delete command.

    Knative release version
    0.21.0
    Additional context
    Is there any work around before this issue is solved to delete the subscription?

kinbug

All 2 comments

Is there any work around before this issue is solved to delete the subscription?

Judging from the issue description, I guess something is broken in the finalizer... I think you can force the removal of the subscription removing the finalizer. This guide explains how to do that for a namespace, but you can apply the same guide to the broken subscription: https://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e

Can you post the log of eventing-controller? it might help us to diagnose and fix the issue

Can you post the log of eventing-controller? it might help us to diagnose and fix the issue

@slinkydeveloper Do you mean the log when I try to delete the Subscription? I don't see any new log generated in eventing-controller pod after kubectl delete. (only warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition after a few minutes which doesn't look relative to it)

Was this page helpful?
0 / 5 - 0 ratings