You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "Marios Andreou (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/29 15:04:25 UTC

[jira] [Resolved] (DTACLOUD-173) Creating a blob using the format POST /api/buckets/:bucket_id - missing parameter verification

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

Marios Andreou resolved DTACLOUD-173.
-------------------------------------

    Resolution: Fixed
      Assignee: Ronelle Landy  (was: Marios Andreou)

pushed to master:

commit 8e01f062556092cd964e8545379db12b76a0c56d
Author: marios <ma...@redhat.com>
Date:   Mon Mar 26 14:23:09 2012 +0300

    FIXES DTACLOUD_173: Missing parameter validation for POST blob
    
    https://issues.apache.org/jira/browse/DTACLOUD-173


                
> Creating a blob using the format POST /api/buckets/:bucket_id - missing parameter verification
> ----------------------------------------------------------------------------------------------
>
>                 Key: DTACLOUD-173
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-173
>             Project: DeltaCloud
>          Issue Type: Bug
>          Components: Server
>         Environment:  - Deltacloud git commit version 7e372dfca79c02a799046287e5936129216b781b - branch 'master' of https://git-wip-us.apache.org/repos/asf/deltacloud
>  - ec2 provider
>  - Fedora 16, RHEL 6.2
>            Reporter: Ronelle Landy
>            Assignee: Ronelle Landy
>         Attachments: 0001-FIXES-DTACLOUD_173-Missing-parameter-validation-for-.patch
>
>
> When the parameter "blob_id" is missing from the POST command to create a blob, a 502 backend error (plus trace) is returned: "private method `gsub' called for nil:NilClass":
>  curl  -X POST --trace-ascii /home/rlandy/Temp/out  -F  'blob_data=@/home/rlandy/Temp/factory-build-5468912b-b707-4701-b919-c370ed2099ba-1330360364.96.png;type=image/png'  -F "meta_params=2" -F "meta_name1=author" -F "meta_value1=rlandy" -F  "meta_name2=version" -F "meta_value2=2.3" --user "username:password" "http://localhost:3009/api/buckets/bucket-rlandy2?format=xml"
>  
> <error status='502' url='/api/buckets/bucket-rlandy2?format=xml'>
>   <kind>backend_error</kind>
>   <backend driver='ec2' provider='default'>
>     <code>502</code>
>   </backend>
>   <message><![CDATA[private method `gsub' called for nil:NilClass]]></message>
>   <backtrace>
>     <![CDATA[/usr/lib/ruby/1.8/cgi.rb:342:in `escape'
>     /usr/lib/ruby/gems/1.8/gems/aws-2.5.6/lib/s3/s3_interface.rb:434:in `put'
>     /home/rlandy/workspace/deltacloud/server/lib/deltacloud/drivers/ec2/ec2_driver.rb:440:in `create_blob'
>     /home/rlandy/workspace/deltacloud/server/lib/deltacloud/base_driver/exceptions.rb:173:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/deltacloud/base_driver/exceptions.rb:173:in `safely'
>     /home/rlandy/workspace/deltacloud/server/lib/deltacloud/drivers/ec2/ec2_driver.rb:439:in `create_blob'
>     /home/rlandy/workspace/deltacloud/server/lib/deltacloud/server.rb:880
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rabbit.rb:125:in `instance_eval'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rabbit.rb:125:in `POST /api/buckets/:bucket'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:1211:in `call'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:1211:in `compile!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:772:in `[]'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:772:in `route!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:788:in `route_eval'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:772:in `route!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:821:in `process_route'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:819:in `catch'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:819:in `process_route'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:771:in `route!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:770:in `each'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:770:in `route!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:886:in `dispatch!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:706:in `call!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:871:in `invoke'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:871:in `catch'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:871:in `invoke'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:706:in `call!'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:692:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/commonlogger.rb:20:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_date.rb:31:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_accept.rb:152:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/path_traversal.rb:16:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/json_csrf.rb:17:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/base.rb:47:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/nulllogger.rb:9:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/head.rb:9:in `call'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/showexceptions.rb:21:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_driver_select.rb:45:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_matrix_params.rb:106:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_runtime.rb:36:in `call'
>     /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_etag.rb:41:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-accept-0.4.4/lib/rack/accept/context.rb:22:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/path_traversal.rb:16:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/json_csrf.rb:17:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/base.rb:47:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/logger.rb:15:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/commonlogger.rb:20:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/head.rb:9:in `call'
>     /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/methodoverride.rb:24:in `call'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:1334:in `call'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:1403:in `synchronize'
>     /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.1/lib/sinatra/base.rb:1334:in `call'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:80:in `pre_process'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:78: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.3.1/lib/thin/connection.rb:50:in `process'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:38: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.3.1/lib/thin/backends/base.rb:61:in `start'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/runner.rb:185:in `send'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
>     /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
>     ./bin/deltacloudd:239]]>
>   </backtrace>
>   <request>
>     <param name='captures'>Deltacloud::ExceptionHandler::ProviderError</param>
>     <param name='meta_name1'>author</param>
>     <param name='meta_name2'>version</param>
>     <param name='blob_data'>
>        typeimage/pngheadContent-Disposition: form-data; name="blob_data";  filename="factory-build-5468912b-b707-4701-b919-c370ed2099ba-1330360364.96.png"
>       Content-Type: image/png
>         filenamefactory-build-5468912b-b707-4701-b919-c370ed2099ba-1330360364.96.pngnameblob_datatempfile#<File:0x7f3579ba5e18>
>     </param>
>     <param name='meta_params'>2</param>
>     <param name='format'>xml</param>
>     <param name='meta_value1'>rlandy</param>
>     <param name='meta_value2'>2.3</param>
>   </request>
> </error>
> As a comparison, for  other collections, missing required parameters throw relevant error messages like: Deltacloud::ExceptionHandler::ProviderError - MissingParameter:  The request must contain the parameter KeyName

--
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