Bug 1360170

Summary: oc v3.3.0.* client is not compatible with openshift 3.1 env
Product: OpenShift Container Platform Reporter: XiuJuan Wang <xiuwang>
Component: ocAssignee: David Eads <deads>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.0CC: aos-bugs, bparees, ccoleman, jokerman, mmccomas, tdawson, xiuwang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-27 09:41:41 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:
Attachments:
Description Flags
ruby-hello.yaml none

Description XiuJuan Wang 2016-07-26 07:14:56 UTC
Description of problem:
oc v3.3.0.* client is not compatible with openshift 3.1 env

Version-Release number of selected component (if applicable):
client: oc v3.3.0.10
master: openshift v3.1.1.6-64-g80b61da

How reproducible:
always

Steps to Reproduce:
1.Get resources
2.Create a new app
3.

Actual results:
1.
$oc get is -n openshift  
the server doesn't have a resource type "imagestreams"
$oc  get  project
the server doesn't have a resource type "project"
$oc project
Using project "xiuwang1" on server "https://<master>:8443".

2.
$oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git 
--> Found Docker image 6762bce (3 days old) from Docker Hub for "centos/ruby-22-centos7"

    Ruby 2.2 
    -------- 
    Platform for building and running Ruby 2.2 applications

    Tags: builder, ruby, ruby22

    * An image stream will be created as "ruby-22-centos7:latest" that will track the source image
    * A source build using source code from https://github.com/openshift/ruby-ex.git will be created
      * The resulting image will be pushed to image stream "ruby-ex:latest"
      * Every time "ruby-22-centos7:latest" changes a new build will be triggered
    * This image will be deployed in deployment config "ruby-ex"
    * Port 8080/tcp will be load balanced by service "ruby-ex"
      * Other containers can access this service through the hostname "ruby-ex"

--> Creating resources with label app=ruby-ex ...
    error: unable to recognize /__internal, Kind=ImageStream: no matches for /, Kind=ImageStream
    error: unable to recognize /__internal, Kind=ImageStream: no matches for /, Kind=ImageStream
    error: unable to recognize /__internal, Kind=BuildConfig: no matches for /, Kind=BuildConfig
    error: unable to recognize /__internal, Kind=DeploymentConfig: no matches for /, Kind=DeploymentConfig
    error: unable to recognize /__internal, Kind=Service: no matches for /, Kind=Service
--> Failed

$oc new-app -f chain-build-origin.json 
<dyan> error: unable to load template file "chain-build-origin.json": unable to recognize "chain-build-origin.json": no matches for /, Kind=Template

Expected results:
The basic cmd functions should work.

Additional info:

Comment 1 Ben Parees 2016-07-26 20:40:35 UTC
can you share the contents of chain-build-origin.json?

and also run new-app with "-o yaml > somefile.yaml" and then "oc create -f somefile.yaml" and share
1) somefile.yaml
2) the output from create

Comment 2 XiuJuan Wang 2016-07-27 01:53:49 UTC
Not only the chain-build-origin.json file, seem 'new-app' with all json/yaml are broken.

1.
$.oc  new-app https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/rails-postgresql.json 
error: unable to load template file "https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/rails-postgresql.json": unable to recognize "https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/rails-postgresql.json": no matches for /, Kind=Template
error: no match for "https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/rails-postgresql.json"

The 'oc new-app' command will match arguments to the following types:

  1. Images tagged into image streams in the current project or the 'openshift' project
     - if you don't specify a tag, we'll add ':latest'
  2. Images in the Docker Hub, on remote registries, or on the local Docker engine
  3. Templates in the current project or the 'openshift' project
  4. Git repository URLs or local paths that point to Git repositories

--allow-missing-images can be used to point to an image that does not exist yet.

See 'oc new-app -h' for examples.

2.
$oc create  -f  https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/dancer-mysql.json 
unable to recognize "https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/dancer-mysql.json": no matches for /, Kind=Template

3.Will paste the ruby-hello.yaml in the attachment
$oc new-app https://github.com/openshift/ruby-hello-world.git  -o yaml  > ruby-hello.yaml
$oc  create -f  ruby-hello.yaml 
unable to recognize /__internal, Kind=ImageStream: no matches for /, Kind=ImageStream

Comment 3 XiuJuan Wang 2016-07-27 01:55:13 UTC
Created attachment 1184480 [details]
ruby-hello.yaml

Comment 4 Ben Parees 2016-07-27 14:48:23 UTC
I was able to reproduce this:

/tmp/openshift version
openshift v3.1.1.6-64-g80b61da
kubernetes v1.1.0-origin-1107-g4c8e6f4
etcd 2.1.2


/tmp/oc version
oc v3.3.0.10-dirty
kubernetes v1.3.0+57fb9ac
features: Basic-Auth


$ /tmp/oc get is -n openshift --loglevel=5
F0727 10:47:19.966155   21685 helpers.go:108] the server doesn't have a resource type "imagestreams"
tmp$ /tmp/oc get is -n openshift --loglevel=8
I0727 10:47:27.946405   21711 loader.go:330] Config loaded from file /home/bparees/.kube/config
I0727 10:47:27.947191   21711 round_trippers.go:296] GET https://localhost:8443/oapi
I0727 10:47:27.947214   21711 round_trippers.go:303] Request Headers:
I0727 10:47:27.947226   21711 round_trippers.go:306]     Authorization: Bearer X_AciW9FVO4EMHPh60sgnOxTA6WTB09f0-NaSWbrIJU
I0727 10:47:27.947243   21711 round_trippers.go:306]     Accept: application/json, */*
I0727 10:47:27.947256   21711 round_trippers.go:306]     User-Agent: oc/v3.3.0.10 (linux/amd64) openshift/c419cc7
I0727 10:47:27.959921   21711 round_trippers.go:321] Response Status: 200 OK in 12 milliseconds
I0727 10:47:27.959950   21711 round_trippers.go:324] Response Headers:
I0727 10:47:27.959969   21711 round_trippers.go:327]     Cache-Control: no-store
I0727 10:47:27.959985   21711 round_trippers.go:327]     Content-Type: application/json
I0727 10:47:27.959996   21711 round_trippers.go:327]     Date: Wed, 27 Jul 2016 14:47:27 GMT
I0727 10:47:27.960002   21711 round_trippers.go:327]     Content-Length: 32
I0727 10:47:27.960061   21711 request.go:891] Response Body: {
  "versions": [
    "v1"
  ]
}
I0727 10:47:27.960400   21711 cached_discovery.go:80] returning cached discovery info from /home/bparees/.kube/localhost_8443/servergroups.json
I0727 10:47:27.960517   21711 cached_discovery.go:38] returning cached discovery info from /home/bparees/.kube/localhost_8443/extensions/v1beta1/serverresources.json
I0727 10:47:27.960741   21711 cached_discovery.go:38] returning cached discovery info from /home/bparees/.kube/localhost_8443/v1/serverresources.json
I0727 10:47:27.960954   21711 cached_discovery.go:80] returning cached discovery info from /home/bparees/.kube/localhost_8443/servergroups.json
I0727 10:47:27.961039   21711 cached_discovery.go:38] returning cached discovery info from /home/bparees/.kube/localhost_8443/extensions/v1beta1/serverresources.json
I0727 10:47:27.961248   21711 cached_discovery.go:38] returning cached discovery info from /home/bparees/.kube/localhost_8443/v1/serverresources.json
F0727 10:47:27.961402   21711 helpers.go:108] the server doesn't have a resource type "imagestreams"

Comment 5 Ben Parees 2016-07-27 15:01:22 UTC
David is looking into this, will let him reassign as needed.

Comment 6 David Eads 2016-07-29 12:43:59 UTC
Opened https://github.com/openshift/origin/pull/10058.  It is coarse grained, but it uses legacy behavior to deal with legacy servers.

Comment 7 XiuJuan Wang 2016-08-05 09:11:03 UTC
The 'oc version' has something wrong when use oc 3.3.* against ocp 3.1 env.

#openshift version
openshift v3.1.1.6-64-g80b61da
kubernetes v1.1.0-origin-1107-g4c8e6f4
etcd 2.1.2


# oc version --loglevel=5
oc v3.3.0.14
kubernetes v1.3.0+57fb9ac
features: Basic-Auth GSSAPI Kerberos SPNEGO
I0805 17:08:49.203262   12838 helpers.go:171] server response object: [{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "User \"xiuwang\" cannot \"get\" on \"/version/openshift\"",
  "reason": "Forbidden",
  "details": {},
  "code": 403
}]
F0805 17:08:49.203395   12838 helpers.go:108] Error from server: User "xiuwang" cannot "get" on "/version/openshift"

Comment 8 XiuJuan Wang 2016-08-05 09:29:17 UTC
Since https://bugzilla.redhat.com/show_bug.cgi?id=1353355#c4 has track the issue in comment #7, 
And other basic oc cmds work well when use oc 3.3.* against ocp 3.1 env. Move this bug to verified.

Comment 10 errata-xmlrpc 2016-09-27 09:41:41 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-2016:1933