Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-141

Error 'role "keycloak" already exists' when re-install CRW

XMLWordPrintable

      There was an error of re-installing CRW on OCP with `--force-cleanup` parameter:

      [INFO]: Welcome to CodeReady Workspaces Installer 
      [INFO]: Found oc client in PATH 
      [INFO]: Checking if you are currently logged in... 
      [INFO]: Active session found. Your current context is: default/console-iokhrime-ocp-crew:8443/developer 
      [INFO]: Deleting CodeReady Workspaces related objects from namespace codeready-e2e-crw-https 
      pod "che-operator" deleted
      pod "codeready-79876c68f5-6scf9" deleted
      pod "keycloak-b547b9b77-8xh4f" deleted
      pod "postgres-97bdc58c4-l4pp8" deleted
      service "che-host" deleted
      service "keycloak" deleted
      service "postgres" deleted
      deployment.apps "codeready" deleted
      deployment.apps "keycloak" deleted
      deployment.apps "postgres" deleted
      route.route.openshift.io "codeready" deleted
      route.route.openshift.io "keycloak" deleted
      No resources found
      No resources found
      serviceaccount "che-operator" deleted
      configmap "che-operator" deleted
      configmap "che" deleted
      No resources found
      No resources found
      rolebinding.authorization.openshift.io "che-operator" deleted
      Error from server (NotFound): secrets "self-signed-cert" not found
      [INFO]: Creating installer service account 
      serviceaccount/che-operator created
      rolebinding.rbac.authorization.k8s.io/che-operator created
      [INFO]: You have chosen an option to enable Login With OpenShift. Granting cluster-admin privileges for apb service account 
      Warning: ServiceAccount 'che-operator' not found
      cluster role "cluster-admin" added: "che-operator"
      [INFO]: You have provided a path to a self-signed certificate. Passing cert to Operator.. 
      configmap/che-operator created
      configmap/che-operator patched
      Unable to use a TTY - container che-operator did not allocate one
      If you don't see a command prompt, try pressing enter.
      time="2019-02-13T17:31:40Z" level=info msg="postgres successfully deployed" 
      time="2019-02-13T17:31:40Z" level=info msg="Provisioning resources in pod postgres-97bdc58c4-8wn7c" 
      time="2019-02-13T17:31:40Z" level=error msg="Error exec'ing into pod command terminated with exit code 1: , command: [/bin/bash -c psql -c "CREATE USER keycloak WITH PASSWORD '8f2QnFhk5A'" && psql -c "CREATE DATABASE keycloak" && psql -c "GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak" && psql -c "ALTER USER pgche WITH SUPERUSER"]" 
      time="2019-02-13T17:31:40Z" level=fatal msg="ERROR:  role "keycloak" already exists
      " 
      pod codeready-e2e-crw-https/che-operator terminated (Error)
      [ERROR]: Failed to deploy CodeReady Workspaces. Inspect error log. 
      

      Root cause: User has unrecycled PVs locally. Somehow, PG PVC got bound to a PV with some files in it. and user were lucky to have the same permissions (same UID)

      Update from 14 February:
      The same failure had been happened on OSD https://console.engint.openshift.com/console/:

       
      ./deploy.sh -d --server-image=quay.io/crw/server-container:1.0-22 --operator-image=quay.io/crw/operator-container:1.0-16 -p=codeready-e2e-crw --force-cleanup
      [INFO]: Welcome to CodeReady Workspaces Installer 
      [INFO]: Found oc client in PATH 
      [INFO]: Checking if you are currently logged in... 
      [INFO]: Active session found. Your current context is: codeready-e2e-che/api-engint-openshift-com:443/dnochevn@redhat.com 
      [INFO]: Deleting CodeReady Workspaces related objects from namespace codeready-e2e-crw 
      pod "che-operator" deleted
      pod "codeready-755bd9d894-fbxcp" deleted
      pod "keycloak-b547b9b77-wrpv9" deleted
      pod "postgres-97bdc58c4-dxw6d" deleted
      service "che-host" deleted
      service "keycloak" deleted
      service "postgres" deleted
      deployment.apps "codeready" deleted
      deployment.apps "keycloak" deleted
      deployment.apps "postgres" deleted
      route.route.openshift.io "codeready" deleted
      route.route.openshift.io "keycloak" deleted
      Error from server (Forbidden): clusterserviceversions.operators.coreos.com is forbidden: User "dnochevn@redhat.com" cannot list clusterserviceversions.operators.coreos.com in the namespace "codeready-e2e-crw": no RBAC policy matched
      Error from server (Forbidden): catalogsources.operators.coreos.com is forbidden: User "dnochevn@redhat.com" cannot list catalogsources.operators.coreos.com in the namespace "codeready-e2e-crw": no RBAC policy matched
      Error from server (Forbidden): installplans.operators.coreos.com is forbidden: User "dnochevn@redhat.com" cannot list installplans.operators.coreos.com in the namespace "codeready-e2e-crw": no RBAC policy matched
      Error from server (Forbidden): subscriptions.operators.coreos.com is forbidden: User "dnochevn@redhat.com" cannot list subscriptions.operators.coreos.com in the namespace "codeready-e2e-crw": no RBAC policy matched
      No resources found
      No resources found
      serviceaccount "che-operator" deleted
      configmap "che-operator" deleted
      configmap "che" deleted
      No resources found
      No resources found
      rolebinding.authorization.openshift.io "che-operator" deleted
      Error from server (NotFound): secrets "self-signed-cert" not found
      [INFO]: Creating installer service account 
      serviceaccount/che-operator created
      rolebinding.rbac.authorization.k8s.io/che-operator created
      configmap/che-operator created
      configmap/che-operator patched
      Unable to use a TTY - container che-operator did not allocate one
      If you don't see a command prompt, try pressing enter.
      time="2019-02-14T01:36:59Z" level=info msg="Waiting for deployment postgres. Default timeout: 420 seconds" 
      time="2019-02-14T01:38:31Z" level=info msg="postgres successfully deployed" 
      time="2019-02-14T01:38:31Z" level=info msg="Provisioning resources in pod postgres-97bdc58c4-vzshj" 
      time="2019-02-14T01:38:31Z" level=error msg="Error exec'ing into pod command terminated with exit code 1: , command: [/bin/bash -c psql -c "CREATE USER keycloak WITH PASSWORD '8f2QnFhk5A'" && psql -c "CREATE DATABASE keycloak" && psql -c "GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak" && psql -c "ALTER USER pgche WITH SUPERUSER"]" 
      time="2019-02-14T01:38:31Z" level=fatal msg="ERROR:  role "keycloak" already exists
      " 
      pod codeready-e2e-crw/che-operator terminated (Error)
      [ERROR]: Failed to deploy CodeReady Workspaces. Inspect error log. 
      

              yivantso Eugene Ivantsov (Inactive)
              dnochevn Dmytro Nochevnov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: