Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1544186

Summary: APB update failed for the second time
Product: OpenShift Container Platform Reporter: Zihan Tang <zitang>
Component: Service BrokerAssignee: Jason Montleon <jmontleo>
Status: CLOSED CURRENTRELEASE QA Contact: Zihan Tang <zitang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.9.0CC: aos-bugs, chezhang, jiazha, jmontleo, zitang
Target Milestone: ---   
Target Release: 3.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-14 13:25:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zihan Tang 2018-02-11 07:12:02 UTC
Description of problem:
When update sql apb : postgresql , mariaDb  or mysql, the first time update of the serviceintance will succeed, but when update for the second time, the update will pending on "
TASK [rhscl-postgresql-apb : Copy over db backup]". 
But if I update fist time succeed , then rollout the asb , I can update serviceintance succeessfully,

Version-Release number of selected component (if applicable):
ASB : 1.1.10
APB : downstream v3.9

How reproducible:
100%

Steps to Reproduce:
1.Provision Postgresql dev plan, v9.6  in UI
2.Update the instance from v9.6 dev  to v9.5 prod
3. After step 2 succeed, update the instance  to 9.6 dev or others,

Actual results:
Step 3 failed.

[root@host-172-16-120-76 ~]# oc get pod 
NAME                          READY     STATUS    RESTARTS   AGE
postgresql-9.5-prod-1-ccd5x   1/1       Running   0          12m
postgresql-9.6-dev-1-jtxf4    1/1       Running   0          7m

Serviceinstance Event
Events:
  Type     Reason                       Age                From                                Message
  ----     ------                       ----               ----                                -------
  Warning  ErrorWithParameters          34m                service-catalog-controller-manager  failed to prepare parameters nil: secrets "rh-postgresql-apb-parametersioenj" not found
  Normal   Provisioning                 34m                service-catalog-controller-manager  The instance is being provisioned asynchronously
  Normal   ProvisionedSuccessfully      33m                service-catalog-controller-manager  The instance was provisioned successfully
  Normal   InstanceUpdatedSuccessfully  13m (x2 over 32m)  service-catalog-controller-manager  The instance was updated successfully
  Normal   UpdatingInstance             10m (x3 over 33m)  service-catalog-controller-manager  The instance is being updated asynchronously


ASB log:
[2018-02-11T06:31:35.047Z] [DEBUG] - Update received the following Request.PlanID: [9783fc2e859f9179833a7dd003baa841]
[2018-02-11T06:31:35.048Z] [DEBUG] - Validating plan transition from: prod, to: dev
[2018-02-11T06:31:35.048Z] [DEBUG] - Plan transition valid!
[2018-02-11T06:31:35.048Z] [DEBUG] - Validating update parameters...
[2018-02-11T06:31:35.048Z] [DEBUG] - Request Params: map[postgresql_version:9.6]
[2018-02-11T06:31:35.048Z] [DEBUG] - Previous Params: map[_apb_service_instance_id:d6e868b1-0d93-4559-b280-621e26f5c3d5 postgresql_database:admin postgresql_password:dddd postgresql_user:admin postgresql_version:9.5 _apb_plan_id:prod _apb_service_class_id:d5915e05b253df421efe6e41fb6a66ba]
[2018-02-11T06:31:35.048Z] [DEBUG] - Changed Params: map[postgresql_version:9.6]
[2018-02-11T06:31:35.048Z] [DEBUG] - Validated Params: map[postgresql_version:9.6]
[2018-02-11T06:31:35.049Z] [DEBUG] - Initiating update with the inputs:
[2018-02-11T06:31:35.049Z] [DEBUG] - fromPlanName: [prod]
[2018-02-11T06:31:35.049Z] [DEBUG] - toPlanName: [dev]
[2018-02-11T06:31:35.049Z] [DEBUG] - PreviousValues: [ {PlanID: ServiceID: OrganizationID: SpaceID:} ]
[2018-02-11T06:31:35.049Z] [DEBUG] - ServiceInstance Parameters: [map[postgresql_password:dddd postgresql_user:admin postgresql_version:9.6 _apb_plan_id:dev _apb_service_class_id:d5915e05b253df421efe6e41fb6a66ba _apb_service_instance_id:d6e868b1-0d93-4559-b280-621e26f5c3d5 postgresql_database:admin]]
[2018-02-11T06:31:35.049Z] [INFO] - ASYNC update in progress
[2018-02-11T06:31:35.049Z] [NOTICE] - ============================================================
[2018-02-11T06:31:35.049Z] [NOTICE] -                        UPDATING                             
[2018-02-11T06:31:35.049Z] [NOTICE] - ============================================================
[2018-02-11T06:31:35.049Z] [NOTICE] - Spec.ID: d5915e05b253df421efe6e41fb6a66ba
[2018-02-11T06:31:35.049Z] [NOTICE] - Spec.Name: rh-postgresql-apb
[2018-02-11T06:31:35.049Z] [NOTICE] - Spec.Image: registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9
[2018-02-11T06:31:35.049Z] [NOTICE] - Spec.Description: SCL PostgreSQL apb implementation
[2018-02-11T06:31:35.049Z] [NOTICE] - ============================================================
[2018-02-11T06:31:35.049Z] [INFO] - Checking if namespace new-post-prod exists.
10.129.0.5 - - [11/Feb/2018:06:31:35 +0000] "PATCH /ansible-service-broker/v2/service_instances/d6e868b1-0d93-4559-b280-621e26f5c3d5?accepts_incomplete=true HTTP/1.1" 202 58
[2018-02-11T06:31:35.067Z] [DEBUG] - ExecutingApb:
[2018-02-11T06:31:35.067Z] [DEBUG] - name:[ rh-postgresql-apb ]
[2018-02-11T06:31:35.067Z] [DEBUG] - image:[ registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 ]
[2018-02-11T06:31:35.067Z] [DEBUG] - action:[ update ]
[2018-02-11T06:31:35.067Z] [DEBUG] - pullPolicy:[ IfNotPresent ]
[2018-02-11T06:31:35.067Z] [DEBUG] - role:[ edit ]
[2018-02-11T06:31:35.067Z] [DEBUG] - No proxy env vars found to be configured.
[2018-02-11T06:31:35.156Z] [DEBUG] - service_id: d5915e05b253df421efe6e41fb6a66ba
[2018-02-11T06:31:35.156Z] [DEBUG] - plan_id: 9783fc2e859f9179833a7dd003baa841
[2018-02-11T06:31:35.156Z] [DEBUG] - operation:  be805dd5-b62f-4573-addb-b5eab0879c2f
[2018-02-11T06:31:35.157Z] [DEBUG] - state: in progress


Update sandbox 
[root@host-172-16-120-76 ~]# oc project rh-postgresql-apb-upda-wlql8
Now using project "rh-postgresql-apb-upda-wlql8" on server "https://172.16.120.76:8443".
[root@host-172-16-120-76 ~]# oc get pod 
NAME                                       READY     STATUS    RESTARTS   AGE
apb-990c7837-d8c2-4f21-a417-b3de264a4451   1/1       Running   0          1m
[root@host-172-16-120-76 ~]# oc logs -f apb-990c7837-d8c2-4f21-a417-b3de264a4451 
+ [[ update --extra-vars {"_apb_plan_id":"dev","_apb_service_class_id":"d5915e05b253df421efe6e41fb6a66ba","_apb_service_instance_id":"d6e868b1-0d93-4559-b280-621e26f5c3d5","cluster":"openshift","namespace":"new-post-prod","postgresql_database":"admin","postgresql_password":"dddd","postgresql_user":"admin","postgresql_version":"9.6"} == *\s\2\i\/\a\s\s\e\m\b\l\e* ]]
+ ACTION=update
+ shift
+ playbooks=/opt/apb/actions
+ CREDS=/var/tmp/bind-creds
+ TEST_RESULT=/var/tmp/test-result
+ whoami
+ '[' -w /etc/passwd ']'
++ id -u
+ echo 'apb:x:1000300000:0:apb user:/opt/apb:/sbin/nologin'
+ set +x
+ [[ -e /opt/apb/actions/update.yaml ]]
+ ANSIBLE_ROLES_PATH=/etc/ansible/roles:/opt/ansible/roles
+ ansible-playbook /opt/apb/actions/update.yaml --extra-vars '{"_apb_plan_id":"dev","_apb_service_class_id":"d5915e05b253df421efe6e41fb6a66ba","_apb_service_instance_id":"d6e868b1-0d93-4559-b280-621e26f5c3d5","cluster":"openshift","namespace":"new-post-prod","postgresql_database":"admin","postgresql_password":"dddd","postgresql_user":"admin","postgresql_version":"9.6"}'

PLAY [Deploy rhscl-postgresql-apb to "openshift"] ******************************

TASK [ansible.kubernetes-modules : Install latest openshift client] ************
skipping: [localhost]

TASK [ansibleplaybookbundle.asb-modules : debug] *******************************
skipping: [localhost]

TASK [rhscl-postgresql-apb : Find pod we need to update] ***********************
changed: [localhost]

TASK [rhscl-postgresql-apb : Find dc we will clean up] *************************
changed: [localhost]

TASK [rhscl-postgresql-apb : Find deployment we will clean up] *****************
skipping: [localhost]

TASK [rhscl-postgresql-apb : Backup source database] ***************************
changed: [localhost]

TASK [rhscl-postgresql-apb : Copy over db backup] ******************************
changed: [localhost]

TASK [rhscl-postgresql-apb : set service state to present] *********************
changed: [localhost]

TASK [rhscl-postgresql-apb : include_tasks] ************************************
included: /opt/ansible/roles/rhscl-postgresql-apb/tasks/dev.yml for localhost

TASK [rhscl-postgresql-apb : set development deployment config state to present] ***
skipping: [localhost]

TASK [rhscl-postgresql-apb : set development deployment config state to present] ***
changed: [localhost]

TASK [rhscl-postgresql-apb : include_tasks] ************************************
skipping: [localhost]

TASK [rhscl-postgresql-apb : Wait for postgres to come up] *********************
ok: [localhost]

TASK [rhscl-postgresql-apb : Find pod we need to restore] **********************
changed: [localhost]

TASK [rhscl-postgresql-apb : Copy over db backup] ******************************



Expected results:
Update succeed


Additional info:

Comment 1 Jason Montleon 2018-02-13 17:40:26 UTC
I did this today in the environment you set up for me to reproduce 1535931
 without issue. You should be able to see the that indicated within the logs.

I went from mariadb 10.1 dev to 10.2 dev to 10.2 prod. 

Can you provide me with access to an environment where you are able to reproduce this?

Comment 2 Jason Montleon 2018-02-13 18:13:35 UTC
"Prior to 5.7 it wasn't possible to use InnoDB storage engine for system tables."

I currently don't see a way to affect which engine is used on the 5.7 container.

Comment 3 Zihan Tang 2018-02-14 02:15:24 UTC
The env which produce bug is deleted. I can't reproduce the bug in today's environment . I think this is likely to be fixed in the latest build.

Comment 4 Jason Montleon 2018-02-14 13:25:45 UTC
I closed the bug. If it pops up and we have an environment we can reproduce this in feel free to reopen it and I can investigate some more.

Comment 5 Jian Zhang 2018-02-23 08:50:46 UTC
Jason,

I encounter a similar issue with updating plan. Updating the APB(for example, PostgreSQL) plan failed from the dev to prod version. 
And, I finally found it works only if enable the develop mode of the ASB. So, is it reasonable? And, do we have docs to point out this?

Comment 6 Jason Montleon 2018-03-19 12:46:06 UTC
jiazha is it still the case that this is only working in developer mode? I would expect it to work in a non-developer configuration as well.

Comment 7 Jian Zhang 2018-03-20 01:58:49 UTC
Jason,

No, I confirm this issue does not matter with the developer mode. Sorry for the bothering. But, this issue occurs occasionally.