Bug 1130381 - 'server list' show "don't have any servers configured" when has no express.conf file under .openshift
Summary: 'server list' show "don't have any servers configured" when has no express.co...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-15 05:11 UTC by XiuJuan Wang
Modified: 2015-05-15 02:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-10 00:50:34 UTC


Attachments (Terms of Use)

Description XiuJuan Wang 2014-08-15 05:11:15 UTC
Description of problem:
Add multiple servers,set one as default.Delete express.conf under .openshift. server.yml is still existing.
Do 'server list',show "You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server."Do domain show operation,will login to PROD server always.

RHC will check express.conf firstly.
# rhc server list  -d
DEBUG: Using config file /root/.openshift/express.conf
You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server.
Version-Release number of selected component (if applicable):
rhc-1.29.5

How reproducible:
always

Steps to Reproduce:
1.Add some servers, set one as default.
2.Do server list
3.Delele express.conf
4.Do 'rhc server list'
5.Do 'rhc Domain show'

Actual results:
step2.Could list servers
# rhc server list 
Server 'int' (in use)
---------------------
  Hostname:        int.openshift.redhat.com
  Login:           xiuwang+m@redhat.com
  Use Auth Tokens: true
  Insecure:        false

Server 'stg'
------------
  Hostname:        stg.openshift.redhat.com
  Login:           xiuwang@redhat.com
  Use Auth Tokens: true
  Insecure:        false

setp4.
# rhc server list 
You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server.

step5.Actually, have set int as default server.but domain show will login PROD.
# rhc domain show  
You have not yet configured the OpenShift client tools. Please run 'rhc setup'.
Login to openshift.redhat.com: 

Expected results:
Could use the correct server.

Additional info:

Comment 1 Fabiano Franz 2014-08-18 21:40:56 UTC
Looks live this one is fixed by the same fix in bug 1126388:

https://github.com/openshift/rhc/pull/642

'rhc servers' will still list the ones present in servers.yml and online (prod) will be displayed as the default (in use).

Please test.

Comment 2 XiuJuan Wang 2014-08-19 03:14:40 UTC
Check with rhc-1.29.6 build from devenv_4096
1.When openshift.redhat.com not configured and no express.conf existing,still show warning.

# rhc server list 
Server 'int'
------------
  Hostname:        int.openshift.redhat.com
  Login:           XXXXXX
  Use Auth Tokens: true
  Insecure:        false

Server 'stg' (in use)
---------------------
  Hostname:        stg.openshift.redhat.com
  Login:           XXXXXXXXXXX
  Use Auth Tokens: true
  Insecure:        false

You have 2 servers configured. Use 'rhc server use <hostname|nickname>' to switch between them.
# rm express.conf 
# rhc server list 
You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server.

Comment 3 XiuJuan Wang 2014-08-19 03:21:48 UTC
Correct comment 2
Check this bug with rhc-1.29.6 build from devenv_5089.

Comment 4 Fabiano Franz 2014-08-19 17:31:08 UTC
That's the expected behavior. 

When you have multiple servers on servers.yml the express.conf file is used to define which of them is the default one (in use). If you don't have the default one declared on express.conf (or no express.conf at all) then the online server is supposed to be the default one.

Not having express.conf (makes online the default) *and* not having online configured in servers.yml means you don't have a proper servers configuration and should run rhc setup to fix it.

Comment 5 XiuJuan Wang 2014-08-20 03:09:04 UTC
(In reply to Fabiano Franz from comment #4)

Move bug to verified.
Fabiano, Thanks!


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