You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "Ronelle Landy (Closed) (JIRA)" <ji...@apache.org> on 2012/03/09 21:26:59 UTC

[jira] [Closed] (DTACLOUD-149) Deltacloud Deltacloud::ExceptionHandler::BackendError is thrown instead of Unauthorized when validating provider credentials

     [ https://issues.apache.org/jira/browse/DTACLOUD-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ronelle Landy closed DTACLOUD-149.
----------------------------------


Closing this issue. Verified that Deltacloud ruby client throws the correct 401 error message for accessing rhvem server with invalid creds:

 rake spec API_PROVIDER=rhevm API_PORT=4001
/usr/bin/ruby -S rspec specs/launchclient_spec.rb --format nested --color

launch test
  should allow creation of new instances (FAILED - 1)

Failures:

  1) launch test should allow creation of new instances
     Failure/Error: instance = client.create_instance( '359123e1-d343-40be-ae1d-df180cdf65ef',
     DeltaCloud::HTTPError::Unauthorized:
       401
       
       DeltaCloud::HTTPError::ClientError: Authentication required for this request or invalid credentials provided.
     # ./lib/errors.rb:77:in `on'
     # ./lib/errors.rb:106:in `client_error'
     # ./lib/errors.rb:72:in `instance_eval'
     # ./lib/errors.rb:72:in `initialize'
     # ./lib/errors.rb:103:in `new'
     # ./lib/errors.rb:103:in `client_error'
     # ./lib/deltacloud.rb:359:in `response_error'
     # ./lib/deltacloud.rb:391:in `request'
     # ./lib/deltacloud.rb:390:in `send'
     # ./lib/deltacloud.rb:390:in `request'
     # ./lib/deltacloud.rb:316:in `method_missing'
     # ./specs/launchclient_spec.rb:27
     # ./lib/deltacloud.rb:82:in `initialize'
     # ./lib/deltacloud.rb:41:in `new'
     # ./lib/deltacloud.rb:41:in `new'
     # ./specs/launchclient_spec.rb:26

Finished in 0.5532 seconds
1 example, 1 failure

Failed examples:

rspec ./specs/launchclient_spec.rb:25 # launch test should allow creation of new instances
rake aborted!
/usr/bin/ruby -S rspec specs/launchclient_spec.rb --format nested --color failed


                
> Deltacloud Deltacloud::ExceptionHandler::BackendError is thrown instead of Unauthorized when validating provider credentials
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DTACLOUD-149
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-149
>             Project: DeltaCloud
>          Issue Type: Bug
>         Environment: commit: 0d31929171175de459e2dbde9d13cae611f3efa3
>            Reporter: Martyn Taylor
>            Assignee: Michal Fojtik
>
> Deltacloud Server throws a 500 instead of a 401 error when wrong credentials are provider tot he valid_credentials method.  This causes the client to raise a ServerError exception instead of Unauthorised.
> /usr/bin/deltacloudd[9969]: [NO HANDLED] Deltacloud::ExceptionHandler::BackendError: Unhandled exception or status code (401 Unauthorized)
> /usr/lib/ruby/gems/1.8/gems/rbovirt-0.0.7/lib/rbovirt.rb:273:in `handle_fault'
> /usr/lib/ruby/gems/1.8/gems/rbovirt-0.0.7/lib/rbovirt.rb:177:in `datacenter'
> /usr/lib/ruby/gems/1.8/gems/rbovirt-0.0.7/lib/rbovirt.rb:165:in `current_datacenter'
> /usr/lib/ruby/gems/1.8/gems/rbovirt-0.0.7/lib/rbovirt.rb:145:in `clusters'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/deltacloud/drivers/rhevm/rhevm_driver.rb:82:in `realms'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/deltacloud/base_driver/exceptions.rb:173:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/deltacloud/base_driver/exceptions.rb:173:in `safely'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/deltacloud/drivers/rhevm/rhevm_driver.rb:81:in `realms'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/deltacloud/drivers/rhevm/rhevm_driver.rb:197:in `valid_credentials?'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/deltacloud/server.rb:110:in `GET /api/?'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:1151:in `call'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:1151:in `compile!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:724:in `instance_eval'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:724:in `route_eval'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:708:in `route!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:758:in `process_route'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:755:in `catch'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:755:in `process_route'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:707:in `route!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:706:in `each'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:706:in `route!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:843:in `dispatch!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:644:in `call!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:808:in `instance_eval'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:808:in `invoke'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:808:in `catch'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:808:in `invoke'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:644:in `call!'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:629:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_syslog.rb:48:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_date.rb:31:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_accept.rb:149:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_driver_select.rb:45:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_matrix_params.rb:106:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_runtime.rb:36:in `call'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/lib/sinatra/rack_etag.rb:41:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-accept-0.4.3/lib/rack/accept/context.rb:22:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272:in `call'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:1303:in `synchronize'
> /usr/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272:in `call'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:84:in `pre_process'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in `call'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in `spawn_threadpool'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1057:in `initialize'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1057:in `new'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1057:in `spawn_threadpool'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1049:in `defer'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:54:in `process'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
> /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/controllers/controller.rb:86:in `start'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `send'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `run_command'
> /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
> /usr/lib/ruby/gems/1.8/gems/deltacloud-core-0.5.0/bin/deltacloudd:239
> /usr/bin/deltacloudd:19:in `load'
> /usr/bin/deltacloudd:19

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira