canonical / pvcviewer-operator

Charm PVCViewer for visualizing PVC content
Apache License 2.0
2 stars 0 forks source link

unit goes to `BlockedStatus` with message #17

Open DnPlas opened 9 months ago

DnPlas commented 9 months ago

Bug Description

After deploying the CKF bundlelatest/edge version, the pvcviewer charm goes to Active and Idle, but then in the next update status, the unit goes to BlockedStatus.

The unit status is:

pvcviewer-operator/0*         blocked   idle       10.1.204.180                 [kubernetes:auth-and-crds] Not all resources found in cluster.  This may be transient if we haven't tried to deploy t...

To Reproduce

  1. juju deploy kubeflow --channel latest/edge --trust
  2. Wait for a couple of minutes

Environment

Relevant log output

unit-pvcviewer-operator-0: 13:41:07 INFO unit.pvcviewer-operator/0.juju-log HTTP Request: PATCH https://10.152.183.1/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/manager-rolebinding?force=true&fieldManager=lightkube "HTTP/1.1 422 Unprocessable Entity"
unit-pvcviewer-operator-0: 13:41:07 ERROR unit.pvcviewer-operator/0.juju-log execute_components caught unhandled exception when executing configure_charm for kubernetes:auth-and-crds
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/lightkube/core/generic_client.py", line 188, in raise_for_status
    resp.raise_for_status()
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/httpx/_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url 'https://10.152.183.1/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/manager-rolebinding?force=true&fieldManager=lightkube'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/charmed_kubeflow_chisme/components/kubernetes_component.py", line 49, in _configure_app_leader
    krh.apply()
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/charmed_kubeflow_chisme/kubernetes/_kubernetes_resource_handler.py", line 367, in apply
    raise e
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/charmed_kubeflow_chisme/kubernetes/_kubernetes_resource_handler.py", line 340, in apply
    apply_many(
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/charmed_kubeflow_chisme/lightkube/batch/_many.py", line 72, in apply_many
    returns[i] = client.apply(
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/lightkube/core/client.py", line 457, in apply
    return self.patch(type(obj), name, obj, namespace=namespace,
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/lightkube/core/client.py", line 325, in patch
    return self._client.request("patch", res=res, name=name, namespace=namespace, obj=obj,
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/lightkube/core/generic_client.py", line 245, in request
    return self.handle_response(method, resp, br)
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/lightkube/core/generic_client.py", line 196, in handle_response
    self.raise_for_status(resp)
  File "/var/lib/juju/agents/unit-pvcviewer-operator-0/charm/venv/lightkube/core/generic_client.py", line 190, in raise_for_status
    raise transform_exception(e)
lightkube.core.exceptions.ApiError: ClusterRoleBinding.rbac.authorization.k8s.io "manager-rolebinding" is invalid: roleRef: Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"ClusterRole", Name:"role"}: cannot change roleRef

Additional context

No response

misohu commented 9 months ago

The problem is that by default base 22.04 image is deployed wich has revision 1 which is missing this PR. The right revision is on base 20.04 which is not used by default. We asked chamcraft team to remove 22.04 versions. This will only happen when deploying

juju deploy pvcviewer-operator --channel=latest/edge --trust

Rest of the tracks looks good.