Bug 1532972
| Summary: | [APB] Deprovision failed via the `apb run` command | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Jian Zhang <jiazha> |
| Component: | Service Broker | Assignee: | David Zager <dzager> |
| Status: | CLOSED ERRATA | QA Contact: | Jian Zhang <jiazha> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.9.0 | CC: | aos-bugs, chezhang, dzager, jiazha |
| 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-03-28 14:18:26 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
Jian Zhang
2018-01-10 06:53:23 UTC
The apb tool version:
[root@localhost mediawiki-apb]# rpm -qa | grep apb
apb-1.1.5-1.20180117190645.el7.centos.noarch
Follow the above steps 1-5, and the APB running well. Like below:
[root@host-172-16-120-121 ~]# oc get pods -n jian
NAME READY STATUS RESTARTS AGE
apb-run-mediawiki-apbkxsmb 1/1 Running 0 44m
And then, execute the "deprovison" action, like:
[root@localhost mediawiki-apb]# apb run --project jian --tag registry.access.redhat.com/openshift3/mediawiki-123:latest --dockerfile Dockerfile-latest --action deprovision
Finished writing dockerfile.
Building APB using tag: [registry.access.redhat.com/openshift3/mediawiki-123:latest]
Successfully built APB image: registry.access.redhat.com/openshift3/mediawiki-123:latest
mediawiki_db_schema(required)[default: mediawiki]:
mediawiki_site_name(required)[default: MediaWiki]:
mediawiki_site_lang(required)[default: en]:
mediawiki_admin_user(required)[default: admin]:
mediawiki_admin_pass(required): test
Creating project jian
Project jian already exists
Creating service account in jian
Service account apb-run-mediawiki-apb already exists
Creating role binding for apb-run-mediawiki-apb in jian
Role binding apb-run-mediawiki-apb already exists
Creating pod with image registry.access.redhat.com/openshift3/mediawiki-123:latest in jian
Created Pod
APB run started
^CTraceback (most recent call last):
File "/usr/bin/apb", line 9, in <module>
load_entry_point('apb==1.1.5', 'console_scripts', 'apb')()
File "/usr/lib/python2.7/site-packages/apb/cli.py", line 532, in main
u'cmdrun_{}'.format(args.subcommand))(**vars(args))
File "/usr/lib/python2.7/site-packages/apb/engine.py", line 1294, in cmdrun_run
pod_completed = watch_pod(name, namespace)
File "/usr/lib/python2.7/site-packages/apb/engine.py", line 687, in watch_pod
sleep(WATCH_POD_SLEEP)
KeyboardInterrupt
Deprovision failed and it created a new APBs running actually!
[root@host-172-16-120-121 ~]# oc get pods -n jian
NAME READY STATUS RESTARTS AGE
apb-run-mediawiki-apbkxsmb 1/1 Running 0 46m
apb-run-mediawiki-apbtxsqd 1/1 Running 0 48s
Looking at your output there are two things that I see that seem strange. 1) looks like you hit ^C which would exit the program. 2) 2 APB pods are running. Did you run deprovision action before provision pod completed? Both of these would give unexpected behavior. Could you explain more about what you are doing? 1) Are you waiting for provision to finish before moving to deprovision action? 2) Are you allowing the process to complete, I don't see an exception being thrown but maybe I'm missing something. David, Answers as below: 1) Because did not get any response after a long time, so I hit ^C to interrupt it. 2) Yes, I did the deprovision action after provision completed. Now, I used the latest version 1.1.6 to retest it. [root@localhost postgresql-apb]# rpm -qa | grep apb apb-1.1.6-1.20180123164703.el7.centos.noarch Details as below: 1, Provision an APB. [root@localhost postgresql-apb]# apb run --project jian3 --tag registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 --dockerfile Dockerfile-latest Finished writing dockerfile. Building APB using tag: [registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9] Successfully built APB image: registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 Select plan [dev, prod]: ERROR: Please enter valid plan Select plan [dev, prod]: ERROR: Please enter valid plan Select plan [dev, prod]: ERROR: Please enter valid plan Select plan [dev, prod]: dev postgresql_database(required)[default: admin]: postgresql_user(required)[default: admin]: postgresql_password(required): test postgresql_version(required)[default: 9.6]: Creating project jian3 Created project Creating service account in jian3 Created service account Creating role binding for apb-run-postgresql-apb in jian3 Created Role Binding Creating pod with image registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 in jian3 Created Pod APB run started APB run complete: Succeeded [root@host-172-16-120-21 ~]# oc get pods -n jian3 NAME READY STATUS RESTARTS AGE apb-run-postgresql-apbkbnvw 0/1 Completed 0 1m postgresql-9.6-dev-7c4cd6ff4d-6kkvn 1/1 Running 0 1m 2, Deprovision it. [root@localhost postgresql-apb]# apb run --project jian3 --tag registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 --dockerfile Dockerfile-latest --action deprovision Finished writing dockerfile. Building APB using tag: [registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9] Successfully built APB image: registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 Select plan [dev, prod]: dev postgresql_database(required)[default: admin]: postgresql_user(required)[default: admin]: postgresql_password(required): test postgresql_version(required)[default: 9.6]: Creating project jian3 Project jian3 already exists Creating service account in jian3 Service account apb-run-postgresql-apb already exists Creating role binding for apb-run-postgresql-apb in jian3 Role binding apb-run-postgresql-apb already exists Creating pod with image registry.access.stage.redhat.com/openshift3/postgresql-apb:v3.9 in jian3 Created Pod APB run started APB run complete: Succeeded [root@host-172-16-120-21 ~]# oc get pods -n jian3 NAME READY STATUS RESTARTS AGE apb-run-postgresql-apbkbnvw 0/1 Completed 0 4m apb-run-postgresql-apbs2mht 0/1 Completed 0 2m 3, Delete these deploy pods. [root@host-172-16-120-21 ~]# oc delete pods --all -n jian3 pod "apb-run-postgresql-apbkbnvw" deleted pod "apb-run-postgresql-apbs2mht" deleted [root@host-172-16-120-21 ~]# oc get all -n jian3 No resources found. Overall, it looks good to me. But, I think it will be better if we add the action info into the name of these deploy pods. It will more readable. Maybe we need to open a new bug for this. How do you think? I think that creating a new bug to track the apb naming on `apb run` is a good idea, please do create that. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0489 |