Uploaded image for project: 'DeltaCloud'
  1. DeltaCloud
  2. DTACLOUD-164

json output from creating an ec2 instance contains errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Server
    • None
    • deltacloud git commit: 4a3fc20bb532296dfaea0c7c23eb09c3c7190f7c
      ec2

    Description

      Using format=json, following text + is returned: (log shows: NoMethodError - undefined method `to_hash' for nil:NilClass)

      curl -X POST -F "image_id=ami-8cc035e5" -F "hwp_id=c1.medium" -F "realm_id=us-east-1c" --user "username:password" "http://localhost:3009/api/instances?format=json"

      <tr>
      <td>rack.errors</td>
      <td class="code"><div>#<Object:0x7fa05419f220></div></td>
      </tr>

      <tr>
      <td>rack.input</td>
      <td class="code"><div>#<StringIO:0x7fa051260248></div></td>
      </tr>

      <tr>
      <td>rack.logger</td>
      <td class="code"><div>#<Rack::NullLogger:0x7fa052c29e68 @app=#<Rack::Protection::FrameOptions:0x7fa052c2a250 @options={:status=>403, :frame_options=>:sameorigin, :message=>"Forbidden", :encryptor=>Digest::SHA1, :except=>[:escaped_params, :session_hijacking, :remote_token], :session_key=>"rack.session", :xss_mode=>:block, :allow_empty_referrer=>true, :reaction=>:default_reaction, :logging=>true}, @app=#<Rack::Protection::IPSpoofing:0x7fa052c2a7f0 @options={:status=>403, :message=>"Forbidden", :encryptor=>Digest::SHA1, :except=>[:escaped_params, :session_hijacking, :remote_token], :session_key=>"rack.session", :allow_empty_referrer=>true, :reaction=>:default_reaction, :logging=>true}, @app=#<Rack::Protection::JsonCsrf:0x7fa052c2ab88 @options={:status=>403, :message=>"Forbidden", :encryptor=>Digest::SHA1, :except=>[:escaped_params, :session_hijacking, :remote_token], :session_key=>"rack.session", :allow_empty_referrer=>true, :reaction=>:default_reaction, :logging=>true}, @app=#<Rack::Protection::PathTraversal:0x7fa052c2b1a0 @options={:status=>403, :message=>"Forbidden", :encryptor=>Digest::SHA1, :except=>[:escaped_params, :session_hijacking, :remote_token], :session_key=>"rack.session", :allow_empty_referrer=>true, :reaction=>:default_reaction, :logging=>true}, @app=#<Rack::Protection::XSSHeader:0x7fa052c2c0a0 @options={:status=>403, :encryptor=>Digest::SHA1, :message=>"Forbidden", :except=>[:escaped_params, :session_hijacking, :remote_token], :session_key=>"rack.session", :xss_mode=>:block, :allow_empty_referrer=>true, :logging=>true, :reaction=>:default_reaction}, @app=#<Rack::MediaType:0x7fa052d37a30 @default_layout=:layout, @template_cache=#<Tilt::Cache:0x7fa052d37828 @cache={}>, @app=#<Rack::Date:0x7fa052d3fb68 @app=#<Rack::CommonLogger:0x7fa052d3fcf8 @app=#<Sinatra::Application:0x7fa052d403d8 @default_layout=:layout, @template_cache=#<Tilt::Cache:0x7fa052d40180 @cache={}>, @app=nil>, @logger=nil>>>>>>>>></div></td>
      </tr>

      <tr>
      <td>rack.multiprocess</td>
      <td class="code"><div>false</div></td>
      </tr>

      <tr>
      <td>rack.multithread</td>
      <td class="code"><div>true</div></td>
      </tr>

      <tr>
      <td>rack.request.cookie_hash</td>
      <td class="code"><div>{}</div></td>
      </tr>

      <tr>
      <td>rack.request.form_hash</td>
      <td class="code"><div>

      {"image_id"=>"ami-8cc035e5", "hwp_id"=>"c1.medium", "realm_id"=>"us-east-1c"}

      </div></td>
      </tr>

      <tr>
      <td>rack.request.form_input</td>
      <td class="code"><div>#<StringIO:0x7fa051260248></div></td>
      </tr>

      <tr>
      <td>rack.request.query_hash</td>
      <td class="code"><div>

      {"format"=>"json"}

      </div></td>
      </tr>

      <tr>
      <td>rack.request.query_string</td>
      <td class="code"><div>format=json</div></td>
      </tr>

      <tr>
      <td>rack.run_once</td>
      <td class="code"><div>false</div></td>
      </tr>

      <tr>
      <td>rack.url_scheme</td>
      <td class="code"><div>http</div></td>
      </tr>

      <tr>
      <td>rack.version</td>
      <td class="code"><div>[1, 0]</div></td>
      </tr>

      <tr>
      <td>sinatra.error</td>
      <td class="code"><div>#<NoMethodError: undefined method `to_hash' for nil:NilClass></div></td>
      </tr>

      </table>
      <div class="clear"></div>
      </div> <!-- /RACK ENV -->

      <p id="explanation">You're seeing this error because you have
      enabled the <code>show_exceptions</code> setting.</p>
      </div> <!-- /WRAP -->
      </body>
      </html>

      DC log output shows:

      I, 2012-03-21T08:43:09.227586 #20097 INFO – : New Aws::Ec2 using per_thread-connection mode
      I, 2012-03-21T08:43:09.238450 #20097 INFO – : Launching instance of image ami-8cc035e5 for AKIAJCBB265A57CGKR2Q, key: , groups:
      I, 2012-03-21T08:43:09.239199 #20097 INFO – : Opening new HTTPS connection to ec2.us-east-1.amazonaws.com:443
      NoMethodError - undefined method `to_hash' for nil:NilClass:
      /home/rlandy/workspace/deltacloud/server/lib/deltacloud/helpers/conversion_helper.rb:29:in `convert_to_json'
      /home/rlandy/workspace/deltacloud/server/lib/deltacloud/server.rb:498
      /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_accept.rb:89:in `call'
      /home/rlandy/workspace/deltacloud/server/lib/sinatra/rack_accept.rb:89:in `respond_to'
      /home/rlandy/workspace/deltacloud/server/lib/deltacloud/server.rb:492
      /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/instances'
      /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
      127.0.0.1 - - [21/Mar/2012 08:43:10] "POST /api/instances?format=json HTTP/1.1" 500 185386 0.9620

      Attachments

        Activity

          People

            rlandy Ronelle Landy
            rlandy Ronelle Landy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: