Bug 867708 - [US2853]Server returned error code if using rhc client whose API version is older than Server
[US2853]Server returned error code if using rhc client whose API version is o...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Hiro Asari
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-18 03:04 EDT by joycezhang
Modified: 2015-05-14 20:52 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:49:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description joycezhang 2012-10-18 03:04:58 EDT
Description of problem:
If rhc client supported API version is lower than server, the function can't work well with error code retured.

#rhc app show -a php6
Password: *

WARNING: API version mismatch. This client supports 0.9 
but server at ec2-23-22-74-102.compute-1.amazonaws.com supports .
Server returned error code with no output: 406

Version-Release number of selected component (if applicable):
devenv_2341
git clone latest rhc client and rake package on devenv_2341( Which already contains changes for US2853 )

How reproducible:
always

Steps to Reproduce:
1.Check server API version:
# curl -k -H "Accept: application/xml" --user "jinzhang+1:redhat"  https://ec2-184-72-198-36.compute-1.amazonaws.com/broker/rest/domains

2.Modify the client supported version lower than server API version in step1 from the file below:

/usr/local/share/gems/gems/rhc-0.99.7/lib/rhc/rest/client.rb

Change CLIENT_API_VERSIONS = [1.0, 1.1, 1.2]  to CLIENT_API_VERSIONS = [0.9] 

3. Try to use some rhc commands
  
Actual results:
Error code returned.

Expected results:
Warning message is shown to ask user upgrade latest rhc client:
WARNING: API version is lower. This client supports 1.9
but server at ec2-23-20-167-201.compute-1.amazonaws.com supports 1.0, 1.1, 1.2.
Please upgrade your rhc client and try again.

Additional info:
Comment 1 mzimen 2012-10-18 07:50:50 EDT
I want to add minor issues which belongs to this, that if my client supports ONLY 1.9, the client doesn't see what versions are supported by server:


WARNING: API version mismatch. This client supports 1.9 
but server at ec2-50-16-177-19.compute-1.amazonaws.com supports .
Server returned error code with no output: 406


AND


If my client supports ONLY lowest version of server's supported:
  client's version list = [ 1.0 ]
  server's version list = [ 1.0, 1.1, 1.2 ]

I assume that client should notify, that the client itself needs to be upgraded.
Comment 2 Hiro Asari 2012-10-18 10:56:54 EDT
Clayton and I discussed this, and came to the following conclusions:

1. If the client does not support the latest version supported by the server, we will inform the user.

2. If the client's maximum version is less than the server's minimum version (we expect this to be an extremely unlikely situation; we intend to support old API version as long as we can), we warn, but do not force an update.
Comment 3 Hiro Asari 2012-10-18 11:11:39 EDT
Pull request for the proposed behavior: https://github.com/openshift/rhc/pull/188
Comment 4 Hiro Asari 2012-10-19 19:16:10 EDT
The pull request has been merged.
Comment 5 Xiaoli Tian 2012-10-22 00:36:24 EDT
Move it to ON_QA to verify.
Comment 6 joycezhang 2012-10-22 01:12:13 EDT
Verfied it on devenv_2360 with rhc-0.99.10.gem. Here's the results:

1. Modify client supported version lower than server API version in step1 from the file below:

Change CLIENT_API_VERSIONS = [1.0, 1.1, 1.2]  to CLIENT_API_VERSIONS = [0.9] 

Results:It's fixed as Warning message is shown as below:
WARNING: API version mismatch. This client supports 0.9 butserver at ec2-50-16-89-43.compute-1.amazonaws.com supports 1.0, 1.1, 1.2.
The client version may be outdated; please consider updating 'rhc'. We will
continue, but you may encounter problems.

2. Change to support only lowest version of server's supported as : CLIENT_API_VERSIONS=[1.0]

Results: No warning message shown. We expect to see a warning message to ask user update rhc to latest version.

So assign it back as item 2 is not fixed, and lower the priority to low as it's not block the US testing.
Comment 7 Hiro Asari 2012-10-23 11:42:23 EDT
Item 2, opened as https://bugzilla.redhat.com/show_bug.cgi?id=867706 is not related to US2853.
Comment 8 joycezhang 2012-10-24 03:39:28 EDT
Move to ON_QA as Item2 is not related to US2853.
Comment 9 joycezhang 2012-10-24 03:47:42 EDT
Mark it as Verified as it's fixed.

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