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

Joseph J. VLcek updated DTACLOUD-457:
-------------------------------------

    Attachment: 0001-DTACLOUD-457-RHEVm-Passing-an-invalid-instance-ID-to.patch

Posted attached patch for review as also tracked in:

http://tracker.deltacloud.org/set/304
                
> RHEVm, Passing an invalid instance ID to start instance results in traceback 
> with 500. 
> ---------------------------------------------------------------------------------------
>
>                 Key: DTACLOUD-457
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-457
>             Project: DeltaCloud
>          Issue Type: Bug
>         Environment: RHEVm3.1
>            Reporter: Joseph J. VLcek
>            Assignee: Joseph J. VLcek
>         Attachments: 
> 0001-DTACLOUD-457-RHEVm-Passing-an-invalid-instance-ID-to.patch
>
>
> When starting an instance on RHEVm and passing an invalid instance ID to
> POST "start" generates the following traceback with 500.
> Instead of 500 404 or 403 should be returned.
> % curl   -X POST   --user "${CREDS}"
> "http://localhost:3001/api/instances/${INSTANCE_ID}/start?format=xml";
> <?xml version='1.0' encoding='utf-8' ?>
> <error status='500'
> url='/api/instances/INVALID INSTANCE ID/start'>
>   <kind>backend_error</kind>
>   <backend driver='rhevm'
> provider='PROVIDER'>
>     <code>500</code>
>   </backend>
>   <message><![CDATA[undefined method `state' for nil:NilClass]]></message>
> <backtrace><![CDATA[<REPO>/GIT/DELTACLOUD_OVIRT/deltacloud/server/lib/deltacloud/helpers/deltacloud_helper.rb:147:in
> `instance_action'
> <REPO>/GIT/DELTACLOUD_OVIRT/deltacloud/server/lib/deltacloud/collections/instances.rb:93:in
> `block (3 levels) in <class:Instances>'
> <LOCAL 
> GEMS>/.gem/ruby/1.9.1/gems/sinatra-rabbit-1.1.3/lib/sinatra/rabbit/base.rb:396:in
> `instance_eval'
> <LOCAL 
> GEMS>/.gem/ruby/1.9.1/gems/sinatra-rabbit-1.1.3/lib/sinatra/rabbit/base.rb:396:in
> `block in control'
> <LOCAL GEMS>/.gem/ruby/1.9.1/gems/sinatra-1.3.4/lib/sinatra/base.rb:1293:in
> `call'
> <LOCAL GEMS>/.gem/ruby/1.9.1/gems/sinatra-1.3.4/lib/sinatra/base.rb:1293:in
> `block in compile!'
> ...
> Comments from mfojtik: on IRC
> I think the problem is here: original_instance = driver.instance(credentials, 
> :id => params[:id])
> this call return 'nil' and that will make the instance_actions_for helper die
> secondary bug is that we should report 404 in that case not 500
> POST /api/instances/unknown-instance/start should return 404 or 403 (forbiden)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to