Bug 1610255 - oc new-app and oc delete return error when interact with service-catalog
Summary: oc new-app and oc delete return error when interact with service-catalog
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: 3.11.0
Assignee: Juan Vallejo
QA Contact: Zihan Tang
URL:
Whiteboard:
: 1612048 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-31 10:08 UTC by Zihan Tang
Modified: 2018-10-11 07:23 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-11 07:22:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 0 None None None 2018-10-11 07:23:06 UTC

Description Zihan Tang 2018-07-31 10:08:56 UTC
Description of problem:
1. using oc new-app -f to create serviceinstance, it report error: 
no kind "ServiceInstance" is registered for version "servicecatalog.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:29"
2. using oc delete serviceinstance , it report error: 
Error from server (BadRequest): the server rejected our request for an unknown reason

but service-catalog do not return errors and the operations are success.

Version-Release number of selected component (if applicable):
oc v3.11.0-0.10.0
service-catalog: v3.11.0-0.10.0;Upstream:v0.1.25

How reproducible:
always

Steps to Reproduce:
1.# oc new-project test2
2. # oc new-app --file=https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/svc-catalog/serviceinstance-template.yaml --param=INSTANCE_NAME\=dh-postgresql-apb --param=CLASS_EXTERNAL_NAME\=dh-postgresql-apb --param=PLAN_EXTERNAL_NAME\=dev --param=SECRET_NAME\=dh-postgresql-apb-parameters --param=INSTANCE_NAMESPACE\=test2

after this step, serviceinstance already created.

3. create secret for serviceinstance
# oc new-app --file=https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/svc-catalog/serviceinstance-parameters-template.yaml --param=SECRET_NAME\=dh-postgresql-apb-parameters --param=INSTANCE_NAME\=dh-postgresql-apb --param=PARAMETERS\=\{\"postgresql_database\":\"admin\",\"postgresql_user\":\"admin\",\"postgresql_version\":\"9.5\",\"postgresql_password\":\"test\"\} --param=UID\=44bb8718-94a7-11e8-9b7f-0a580a800008

after create secret, this serviceinstance is provisioned successfully.

4. delete serviceinstance, deprovison sucessfully 
# oc delete serviceinstance dh-postgresql-apb

Actual results:
step 2: 
--> Deploying template "test2/serviceinstance-template" for "https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/svc-catalog/serviceinstance-template.yaml" to project test2

     serviceinstance-template
     ---------
     serviceinstance-template

     * With parameters:
        * INSTANCE_NAME=dh-postgresql-apb
        * INSTANCE_NAMESPACE=test2
        * CLASS_EXTERNAL_NAME=dh-postgresql-apb
        * PLAN_EXTERNAL_NAME=dev
        * SECRET_NAME=dh-postgresql-apb-parameters

--> Creating resources ...
    serviceinstance.servicecatalog.k8s.io "dh-postgresql-apb" created
--> Success
error: no kind "ServiceInstance" is registered for version "servicecatalog.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:29"

step4:
# oc delete serviceinstance dh-postgresql-apb
serviceinstance.servicecatalog.k8s.io "dh-postgresql-apb" deleted
Error from server (BadRequest): the server rejected our request for an unknown reason

Expected results:
oc new-app and oc delete should succeed .

Additional info:
using oc v3.10 client in this env, the 2 commands succeed

serviceinstance : 
# oc describe serviceinstance
Name:         dh-postgresql-apb
Namespace:    test2
Labels:       app=serviceinstance-template
Annotations:  openshift.io/generated-by=OpenShiftNewApp
API Version:  servicecatalog.k8s.io/v1beta1
Kind:         ServiceInstance
Metadata:
  Creation Timestamp:  2018-07-31T09:51:16Z
  Finalizers:
    kubernetes-incubator/service-catalog
  Generation:        1
  Resource Version:  58672
  Self Link:         /apis/servicecatalog.k8s.io/v1beta1/namespaces/test2/serviceinstances/dh-postgresql-apb
  UID:               44bb8718-94a7-11e8-9b7f-0a580a800008
Spec:
  Cluster Service Class External Name:  dh-postgresql-apb
  Cluster Service Class Ref:
    Name:                              1dda1477cace09730bd8ed7a6505607e
  Cluster Service Plan External Name:  dev
  Cluster Service Plan Ref:
    Name:       7f4a5e35e4af2beb70076e72fab0b7ff
  External ID:  44bb85e9-94a7-11e8-9b7f-0a580a800008
  Parameters From:
    Secret Key Ref:
      Key:          parameters
      Name:         dh-postgresql-apb-parameters
  Update Requests:  0
  User Info:
    Groups:
      system:masters
      system:cluster-admins
      system:authenticated
    UID:       
    Username:  system:admin
Status:
  Async Op In Progress:  false
  Conditions:
    Last Transition Time:  2018-07-31T09:53:11Z
    Message:               The instance was provisioned successfully
    Reason:                ProvisionedSuccessfully
    Status:                True
    Type:                  Ready
  Deprovision Status:      Required
  External Properties:
    Cluster Service Plan External ID:    7f4a5e35e4af2beb70076e72fab0b7ff
    Cluster Service Plan External Name:  dev
    Parameter Checksum:                  bba9c67f1db091fb6736dda435b38eb2c9e0838dd9abe090922212a66047033e
    Parameters:
      Postgresql _ Database:  <redacted>
      Postgresql _ Password:  <redacted>
      Postgresql _ User:      <redacted>
      Postgresql _ Version:   <redacted>
    User Info:
      Groups:
        system:masters
        system:cluster-admins
        system:authenticated
      UID:                        
      Username:                   system:admin
  Observed Generation:            1
  Orphan Mitigation In Progress:  false
  Provision Status:               Provisioned
  Reconciled Generation:          1
Events:
  Type     Reason                   Age               From                                Message
  ----     ------                   ----              ----                                -------
  Warning  ErrorWithParameters      2m (x14 over 3m)  service-catalog-controller-manager  failed to prepare parameters nil: secrets "dh-postgresql-apb-parameters" not found
  Normal   Provisioning             1m                service-catalog-controller-manager  The instance is being provisioned asynchronously
  Normal   Provisioning             1m (x3 over 1m)   service-catalog-controller-manager  The instance is being provisioned asynchronously (action started)
  Normal   Provisioning             1m                service-catalog-controller-manager  The instance is being provisioned asynchronously (0%: Starting)
  Normal   ProvisionedSuccessfully  1m                service-catalog-controller-manager  The instance was provisioned successfully

Comment 1 Juan Vallejo 2018-08-01 01:39:51 UTC
Zihan, despite the error message seen when deleting the resource, does the resource actually get deleted?

This looks related to recent scheme changes in the cli, will investigate

Comment 2 Zihan Tang 2018-08-01 02:22:13 UTC
(In reply to Juan Vallejo from comment #1)
> Zihan, despite the error message seen when deleting the resource, does the
> resource actually get deleted?
Yes , the resource is deleted successfully.

Comment 3 Jay Boyd 2018-08-03 20:43:19 UTC
I had this issue reported separately as https://bugzilla.redhat.com/show_bug.cgi?id=1611691.  There is a bug in upstream Service Catalog that causes the error with get -w.   It appears to me that in OpenShift 3.11 the delete was modified to do a get -w as part of the delete command.   

I think this BZ can be marked as a duplicate of 1611691.

Comment 4 Juan Vallejo 2018-08-03 20:50:39 UTC
Thanks Jay, delete does do a watch now, as part of its updated behavior to wait for a resource to be finalized by default.

As for the error message being seen in the `new-app` command, this is caused by the ServiceInstance's GroupVersionKind not being registered in the scheme that new-app is using to decode any objects that it creates.

We could probably leave this bugzilla open to track a fix for that particular error.

Comment 5 Zhang Cheng 2018-08-06 02:48:58 UTC
We hope this issue that "ServiceInstance's GroupVersionKind not being registered in the scheme" can be fixed ASAP. Form QE side, it's blocking most of automation TCs execution.

I'm increasing the priority to "High" and keep severity to "Low". Thanks.

Comment 6 Michal Fojtik 2018-08-06 11:39:16 UTC
*** Bug 1612048 has been marked as a duplicate of this bug. ***

Comment 7 Juan Vallejo 2018-08-06 14:48:04 UTC
Origin PR: https://github.com/openshift/origin/pull/20537

Comment 8 Zhang Cheng 2018-08-08 03:08:32 UTC
Changing status to Modified since ose not ready for test https://github.com/openshift/ose/blob/master/pkg/oc/cli/newapp/newapp.go

Comment 9 Zihan Tang 2018-08-13 06:28:44 UTC
ose image is ready, change it to ON_QA

Comment 10 Zihan Tang 2018-08-13 06:30:47 UTC
Verified, 
oc new-app command succeed without error.
# oc new-app --file=template.yaml --param=INSTANCE_NAME\=brew-postgresql-apb --param=CLASS_EXTERNAL_NAME\=brew-postgresql-apb --param=PLAN_EXTERNAL_NAME\=dev --param=SECRET_NAME\=brew-postgresql-apb-parameters --param=INSTANCE_NAMESPACE\=test2
warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories.
--> Deploying template "post/serviceinstance-template" for "template.yaml" to project post

     serviceinstance-template
     ---------
     serviceinstance-template

     * With parameters:
        * INSTANCE_NAME=brew-postgresql-apb
        * INSTANCE_NAMESPACE=test2
        * CLASS_EXTERNAL_NAME=brew-postgresql-apb
        * PLAN_EXTERNAL_NAME=dev
        * SECRET_NAME=brew-postgresql-apb-parameters

--> Creating resources ...
    serviceinstance.servicecatalog.k8s.io "brew-postgresql-apb" created
--> Success
    Run 'oc status' to view your app.

oc delete serviceinstance still return error, will using bug 1611691 to trace.

Comment 12 errata-xmlrpc 2018-10-11 07:22:47 UTC
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:2652


Note You need to log in before you can comment on or make changes to this bug.