Bug 1029412 - Met exception when creating domain without any nodes.
Met exception when creating domain without any nodes.
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Kubernetes (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Abhishek Gupta
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 06:11 EST by Liang Xia
Modified: 2015-05-14 20:22 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-23 22:29:47 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 Liang Xia 2013-11-12 06:11:35 EST
Description of problem:
Met exception when creating domain without any nodes.

Version-Release number of selected component (if applicable):
devenv_4022
rhc 1.17.2

How reproducible:
always

Steps to Reproduce:
1.Stop mcollective service in instance
2.Clear broker cache
3.Run rhc setup in broker
4.Check development.log

Actual results:
Step 3,
# rhc setup -l a
OpenShift Client Tools (RHC) Setup Wizard
This wizard will help you upload your SSH keys, set your application namespace, and check that other programs like Git are properly installed.
Using a to login to localhost
Password: *
OpenShift can create and store a token on disk which allows to you to access the server without using your password. The key is stored in your home
directory and should be kept secret.  You can delete the key at any time by running 'rhc logout'.
Generate a token now? (yes|no) yes
Generating an authorization token for this client ... lasts about 1 month
Saving configuration to /root/.openshift/express.conf ... done
Your public SSH key must be uploaded to the OpenShift server to access code.  Upload now? (yes|no) yes
Since you do not have any keys associated with your OpenShift account, your new key will be uploaded as the 'default' key.
Uploading key 'default' ... done
Checking for git ... found git version 1.8.2.1
Checking common problems .. done
Checking for a domain ... none
Applications are grouped into domains - each domain has a unique name (called a namespace) that becomes part of your public application URL. You may create
your first domain here or leave it blank and use 'rhc create-domain' later. You will not be able to create an application without completing this step.
Please enter a namespace (letters and numbers only) |<none>|: a
Unable to complete the requested operation due to: No nodes available. If the problem persists please contact Red Hat support. 
Reference ID: bbf39a3ebdb35fee18d6f8c22a6e7c3b

Step 4,
ESC[0;37m2013-11-12 05:30:43.200ESC[0m [ESC[31mERRORESC[0m] Got Node Unavailable Exception (pid:2450)
ESC[0;37m2013-11-12 05:30:43.200ESC[0m [ESC[31mERRORESC[0m] Reference ID: bbf39a3ebdb35fee18d6f8c22a6e7c3b - No nodes available
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.17.1/lib/openshift/mcollective_application_container_proxy.rb:99:in `fi
nd_one_impl'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/lib/openshift/application_container_proxy.rb:26:in `find_one'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cartridge_cache.rb:12:in `block in cartridges'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cache_helper.rb:24:in `get_cached'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cartridge_cache.rb:11:in `cartridges'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cartridge_cache.rb:37:in `block in find_cartridge_by_category'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cache_helper.rb:24:in `get_cached'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cartridge_cache.rb:37:in `find_cartridge_by_category'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/cartridge_cache.rb:32:in `cartridge_names'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/rest_models/rest_domain15.rb:41:in `initialize'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/rest_model_helper.rb:23:in `new'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/helpers/rest_model_helper.rb:23:in `get_rest_domain'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/app/controllers/domains_controller.rb:73:in `create'
  /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
  /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
  /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:470:in `block in _run__1908677006158387272__process_action__3
330787666360305385__callbacks'
  /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_435'
  /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.17.3/lib/openshift/controller/action_log.rb:80:in `set_logged_request'
  /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_435'
  /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:403:in `_run__1908677006158387272__process_action__3330787666
360305385__callbacks'

Expected results:
No exception.
rhc setup successfully.

Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=888550
Comment 1 Abhishek Gupta 2013-11-12 13:20:53 EST
This is expected. 

The REST call to create the domain returns the domain and associated links. One of the link is for "ADD_APPLICATION". This link lists the cartridges that can be specified to create the application. To fetch the cartridges, a call is made to the node (any one node). Since there are no nodes, this call fails and hence the exception. 

The domain is created at this point, its just that the response encountered this exception.

If this is indeed a valid use-case, then to avoid this exception and still be able to create a domain without having any nodes, you have two options:

1. Create the domain using the REST API and specify the "nolinks" parameter as true.
2. Create the domain using the oo-admin-ctl-domain admin tool.
Comment 2 Abhishek Gupta 2013-11-12 13:24:19 EST
Note to QE: I believe this has always been the case. If you agree with the explanation in comment #1, please remove the regression tag as well.
Comment 3 Liang Xia 2013-11-12 21:33:53 EST
Tried the two options in comment #1, the two options works.

# oo-admin-ctl-domain  -c create -l d -n d
Successfully created domain.

# curl -s -k -H "Accept:application/xml" -u ee:a https://localhost/broker/rest/domains -d name=ee -d nolinks=true -X POST
<?xml version="1.0" encoding="UTF-8"?>
  <status>created</status>
  <type>domain</type>
  <messages>
    <message>
      <severity>info</severity>
      <text>Created domain with name ee</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>

# curl -s -k -H "Accept:application/xml" -u ff:a https://localhost/broker/rest/domains -d name=ff -d nolinks=false -X POST
<?xml version="1.0" encoding="UTF-8"?>
  <status>service_unavailable</status>
  <type nil="true"></type>
  <messages>
    <message>
      <severity>error</severity>
      <text>Unable to complete the requested operation due to: No nodes available. If the problem persists please contact Red Hat support. 
Reference ID: 80b8ba72fd3d65607b53f3a1e6ff4699</text>
      <exit-code>140</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>

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