The setup-instance command fails when operator subscriptions are unbound
The cpd-cli
manage
setup-instance command installs and upgrades IBM Cloud Pak foundational services and IBM Software Hub. The command fails if any of the operator
subscriptions are unbound.
Symptoms
The cpd-cli
manage
setup-instance command returns the following error:
[✘] Error ...: Timeout after 10 minutes waiting for operator <operator-name> to be upgraded
[ERROR] ... cmd.Run() failed with exit status 1
[ERROR] ... Command exception: The setup-instance command failed (exit status 1). You may find output and logs in the /tmp/work/cpd-cli-workspace/olm-utils-workspace/work directory.
[ERROR] .. RunPluginCommand:Execution error: exit status 1
Causes
cpd-cli
manage
setup-instance command fails because one or more of the
following operator subscriptions are not bound to a cluster service version (CSV):cpd-platform-operatoribm-iam-operatoribm-common-service-operatoribm-commonui-operatoribm-namespace-scope-operatoroperand-deployment-lifecycle-manager
Diagnosing the problem
- Confirm that the operator subscription exists.
Use the information returned by the
cpd-cli manage setup-instancecommand to determine which operator is affected.ibm-common-service-operatorsubscription-
oc get sub ibm-common-service-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} ibm-namespace-scope-operatorsubscription-
oc get sub ibm-namespace-scope-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} operand-deployment-lifecycle-managersubscription-
oc get sub operand-deployment-lifecycle-manager \ --namespace=${PROJECT_CPD_INST_OPERATORS}
- Confirm that you see the constraints not satisfiable error in the subscription
YAML.ibm-common-service-operatorsubscription-
oc get sub ibm-common-service-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o yaml ibm-namespace-scope-operatorsubscription-
oc get sub ibm-namespace-scope-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o yaml operand-deployment-lifecycle-managersubscription-
oc get sub operand-deployment-lifecycle-manager \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o yaml
Look for the following message:
message: 'constraints not satisfiable: subscription <subscription-name> requires opencloud-operators/operator-ns/v<N.N>/<subscription-name>.v<N.N.N>, subscription <subscription-name> exists, clusterserviceversion <subscription-name>.v<N.N.N> exists and is not referenced by a subscription, opencloud-operators/operator-ns/v<N.N>/<subscription-name>.v<N.N.N> and @existing/operator-ns//<subscription-name>.v<N.N.N> originate from package ibm-namespace-scope-operator' reason: ConstraintsNotSatisfiable - Check the value of the
status.installedCSVfield in the subscription:ibm-common-service-operatorsubscription-
oc get sub ibm-common-service-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o jsonpath='{.metadata.creationTimestamp}{"\t"}{.status.installedCSV}{"\n"}' ibm-namespace-scope-operatorsubscription-
oc get sub ibm-namespace-scope-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o jsonpath='{.metadata.creationTimestamp}{"\t"}{.status.installedCSV}{"\n"}' operand-deployment-lifecycle-managersubscription-
oc get sub operand-deployment-lifecycle-manager \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o jsonpath='{.metadata.creationTimestamp}{"\t"}{.status.installedCSV}{"\n"}'
- If the subscription is bound to a CSV, the response has the following
format:
<timestamp> <operator-name>.vN.N.NIf the subscription is bound, the
cpd-cli manage setup-instancecommand is failing for a different reason. Review thecpd-clilog files to determine the root cause. - If the subscription is unbound, the response has the following
format:
<timestamp>If the subscription is unbound, continue to Resolving the problem.
Resolving the problem
- If you have sufficient permissions to delete pods in the
openshift-operator-lifecycle-managerproject, restart thecatalog-operatorpod in theopenshift-operator-lifecycle-managerproject:oc delete $(oc get pods -l app=catalog-operator -o NAME --namespace=openshift-operator-lifecycle-manager) \ --namespace=openshift-operator-lifecycle-managerNote: If you don't have sufficient permissions to delete pods in theopenshift-operator-lifecycle-managerproject, go to step 3. - Check the value of the
status.installedCSVfield in the subscription:ibm-common-service-operatorsubscription-
oc get sub ibm-common-service-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o jsonpath='{.metadata.creationTimestamp}{"\t"}{.status.installedCSV}{"\n"}' ibm-namespace-scope-operatorsubscription-
oc get sub ibm-namespace-scope-operator \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o jsonpath='{.metadata.creationTimestamp}{"\t"}{.status.installedCSV}{"\n"}' operand-deployment-lifecycle-managersubscription-
oc get sub operand-deployment-lifecycle-manager \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ -o jsonpath='{.metadata.creationTimestamp}{"\t"}{.status.installedCSV}{"\n"}'
- If the subscription is bound to a CSV, the response has the following
format:
<timestamp> <operator-name>.vN.N.NIf the subscription is bound to a CSV, rerun the
cpd-cli manage setup-instancecommand. - If the subscription is unbound, the response has the following
format:
<timestamp>If the subscription is unbound, proceed to the next step.
- Get the name of the CSV:
ibm-common-service-operatorCSV-
oc get csv \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ | grep ibm-common-service-operator ibm-namespace-scope-operatorCSV-
oc get csv \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ | grep ibm-namespace-scope-operator operand-deployment-lifecycle-managerCSV-
oc get csv \ --namespace=${PROJECT_CPD_INST_OPERATORS} \ | grep operand-deployment-lifecycle-manager
- Delete the CSV returned in the preceding
step:
oc delete csv <csv-name> \ --namespace=${PROJECT_CPD_INST_OPERATORS}Operator Lifecycle Manager (OLM) re-creates the CSV and binds it to the subscription.
- Rerun the
cpd-cli manage setup-instancecommand.