Bug 718122 - backend exception when adding rhevm providerAcct when api down
Summary: backend exception when adding rhevm providerAcct when api down
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: aeolus-conductor
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
Assignee: Dave Johnson
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-01 04:14 UTC by Dave Johnson
Modified: 2012-05-15 21:41 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-15 21:41:55 UTC


Attachments (Terms of Use)
screenshot for comment 4 (90.51 KB, image/png)
2011-07-13 14:12 UTC, Dave Johnson
no flags Details
provider cannot be added (95.74 KB, image/png)
2011-10-21 14:58 UTC, Dave Johnson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0583 0 normal SHIPPED_LIVE new packages: aeolus-conductor 2012-05-15 22:31:59 UTC

Description Dave Johnson 2011-07-01 04:14:11 UTC
Description of problem:

With conductor configured for rhevm provider, attempt to add a rhevm provider account when the API is stopped.  Error in the UI (uninitialized constant Deltacloud::BackendError) and the following stacktrace in rails.log



Processing ProviderAccountsController#create (for 10.11.8.52 at 2011-07-01 00:04:12) [POST]
  Parameters: {"commit"=>"Save", "action"=>"create", "quota"=>{"maximum_running_instances"=>"unlimited"}, "controller"=>"provider_accounts", "__map"=>{"set_selected_provider"=>{"method"=>"GET", "url"=>"/conductor/provider_accounts/set_selected_provider"}}, "provider_account"=>{"label"=>"rhevm", "provider_id"=>"1", "credentials_hash"=>{"username"=>"rhevm\\administrator", "password"=>"[FILTERED]"}}}

DeltaCloud::API::BackendError (uninitialized constant Deltacloud::BackendError):
  /usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.1.0/lib/deltacloud.rb:294:in `handle_backend_error'
  /usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.1.0/lib/deltacloud.rb:262:in `request'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:218:in `call'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:218:in `process_result'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
  /usr/lib/ruby/1.8/net/http.rb:543:in `start'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
  /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient.rb:68:in `get'
  /usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.1.0/lib/deltacloud.rb:261:in `send'
  /usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.1.0/lib/deltacloud.rb:261:in `request'
  /usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.1.0/lib/deltacloud.rb:51:in `valid_credentials?'
  app/models/provider_account.rb:169:in `valid_credentials?'
  app/models/provider_account.rb:79:in `validate_credentials'
  app/controllers/provider_accounts_controller.rb:77:in `create'
  compass (0.10.4) lib/compass/app_integration/rails/actionpack2/action_controller.rb:7:in `process'
  haml (3.0.18) rails/./lib/sass/plugin/rack.rb:41:in `call'
  haml (3.0.18) rails/./lib/sass/plugin/rack.rb:41:in `call'
  thin (1.2.5) lib/thin/connection.rb:76:in `pre_process'
  thin (1.2.5) lib/thin/connection.rb:74:in `catch'
  thin (1.2.5) lib/thin/connection.rb:74:in `pre_process'
  thin (1.2.5) lib/thin/connection.rb:57:in `process'
  thin (1.2.5) lib/thin/connection.rb:42:in `receive_data'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
  thin (1.2.5) lib/thin/backends/base.rb:57:in `start'
  thin (1.2.5) lib/thin/server.rb:156:in `start'
  thin (1.2.5) lib/thin/controllers/controller.rb:80:in `start'
  thin (1.2.5) lib/thin/runner.rb:177:in `send'
  thin (1.2.5) lib/thin/runner.rb:177:in `run_command'
  thin (1.2.5) lib/thin/runner.rb:143:in `run!'
  thin (1.2.5) bin/thin:6
  /usr/bin/thin:19:in `load'
  /usr/bin/thin:19

Comment 1 Matt Wagner 2011-07-01 21:45:02 UTC
This actual error is fixed by upgrading to the 0.3.0 version of rubygems-deltacloud-client.

But a new error comes up if you upgrade and connect to something that's not even listening on the port:

Errno::ECONNREFUSED (Connection refused - connect(2)):
  /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
  /usr/lib/ruby/1.8/net/http.rb:560:in `open'
  /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
  /usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
  /usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
  /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
  /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
  /usr/lib/ruby/1.8/net/http.rb:542:in `start'


We should rescue this and do something more graceful.

Comment 2 Matt Wagner 2011-07-05 16:39:57 UTC
Patch on list: https://fedorahosted.org/pipermail/aeolus-devel/2011-July/002858.html

Will update when this is pushed.

Comment 3 Steve Linabery 2011-07-08 16:02:41 UTC
c0ecab5028a582d3b281578a75676de29363a105
in latest fp testing rpm

Comment 4 Dave Johnson 2011-07-13 14:07:43 UTC
This looks a lot better in the UI as now it displays a error message with the following text:

Account rhevm could not be added: uninitialized constant Deltacloud::BackendError 

But does this help the user diagnose the problem?  My concern is that this points to a conductor problem more than helping the user determine that the rhevm api is unreachable.

Comment 5 Dave Johnson 2011-07-13 14:12:01 UTC
Created attachment 512672 [details]
screenshot for comment 4

Comment 6 wes hayutin 2011-07-13 14:28:15 UTC
I agree w/ Dave.. I think the simple fix would be to change..

Deltacloud::BackendError

TO:

Deltacloud::BackendError, "Please make sure deltacloud is runnng for provider type $provider"

Comment 7 Matt Wagner 2011-07-15 17:32:02 UTC
Oh huh, so "uninitialized constant Deltacloud::BackendError" is actually an exception being thrown in Deltacloud. The bug happens to occur when it can't reach a backend provider. I'll look into this some more.

Comment 8 Matt Wagner 2011-07-15 18:01:11 UTC
I've opened https://issues.apache.org/jira/browse/DTACLOUD-60 for this.

Comment 9 Matt Wagner 2011-09-21 21:35:39 UTC
I lost track of this, but it sounds like it should have been fixed in Deltacloud back in July. Are you able to quickly re-test this to confirm?

Comment 10 Aziza Karol 2011-09-23 11:11:46 UTC
Hi Matt,

I tried adding rhevm providerAcct when api is down.

Following is the error message displayed on UI.

"Account aziza_rhev could not be added: Connection refused - connect(2)"

Is this the correct error message or it should be "Please make sure deltacloud is running for provider type $provider" ?

Thanks,
Aziza


[root@nec-em15 log]# rpm -qa | grep aeolus
aeolus-conductor-doc-0.4.0-0.20110921152740gitac47a38.fc15.noarch
aeolus-conductor-daemons-0.4.0-0.20110921152740gitac47a38.fc15.noarch
rubygem-aeolus-image-0.1.0-3.20110919115936gitd1d24b4.fc15.noarch
aeolus-configure-2.0.2-4.20110921102958gitcaa9608.fc15.noarch
aeolus-conductor-0.4.0-0.20110921152740gitac47a38.fc15.noarch
aeolus-all-0.4.0-0.20110921152740gitac47a38.fc15.noarch

Comment 11 wes hayutin 2011-09-28 16:37:15 UTC
making sure all the bugs are at the right version for future queries

Comment 13 Matt Wagner 2011-10-11 17:27:49 UTC
Fixed in:
commit c2453050541674e15a5bfce2123021c2baa8f5cc
Author: Matt Wagner <matt.wagner>
Date:   Thu Oct 6 14:22:17 2011 -0400

    humanize_error helper
    
    Resolves https://bugzilla.redhat.com/show_bug.cgi?id=718122


The error is now something to the effect of "Deltacloud is unreachable. Please verify that it is running." Once this patch makes its way into the testing repo, you should no longer see the "Connection refused - connect(2)" text.

Comment 14 Dave Johnson 2011-10-21 14:58:37 UTC
Created attachment 529520 [details]
provider cannot be added

Now the error message says provider cannot be added which works for me.

Comment 15 Dave Johnson 2011-10-21 14:59:44 UTC
comment 14 was with these rpms

aeolus-conductor-doc-0.5.0-0.20111020182515gitc639503.fc15.noarch
aeolus-conductor-0.5.0-0.20111020182515gitc639503.fc15.noarch
aeolus-conductor-daemons-0.5.0-0.20111020182515gitc639503.fc15.noarch

Comment 18 errata-xmlrpc 2012-05-15 21:41:55 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.

http://rhn.redhat.com/errata/RHEA-2012-0583.html


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