Null array

A Alexey Mironov 3 years 7 months ago
1 2 0

Hello,

some times I have rhoconnect error -

[22067][10:32:50.386 AM 2014-09-22] undefined method `to_array' for nil:NilClass/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/controller/clients_controller.rb:60:in `block in '

Rhoconnect source clients_controller.rb is:

 
get "/:client_id", \

                 
:deprecated_route => {:verb => :post, :url => ['/api/get_client_params', '/api/client/get_client_params']} do

   
Client.load(params[:client_id],{:source_name => '*'}).to_array.to_json

 
end

I think it is internal error by Null client_id value reason. Why did it happend?

Please Register or Login to post a reply

2 Replies

A Alexey Mironov

Full stack is:

[22077][10:38:57.272 AM 2014-09-22] undefined method `to_array' for nil:NilClass/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/controller/clients_controller.rb:60:in `block in '
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/server.rb:137:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/server.rb:137:in `block in execute_api_call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/server.rb:109:in `catch_all'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/server.rb:131:in `execute_api_call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/server.rb:280:in `block in api4'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/middleware/current_user.rb:14:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/middleware/current_app.rb:12:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/async-rack-0.5.1/lib/async_rack/async_callback.rb:114:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/async-rack-0.5.1/lib/async_rack/async_callback.rb:91:in `block in new'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/middleware/stats.rb:21:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/middleware/stats.rb:21:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/middleware/body_content_type_parser.rb:31:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/middleware/x_domain_session_wrapper.rb:25:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/static.rb:119:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/rhoconnect-4.0.4/lib/rhoconnect/async.rb:51:in `block in call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:1037:in `call'
/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:1037:in `block in spawn_threadpool'

K Kutir Mobility

Alexey,
Could you please trace the scenario of when it is happening or attach your source code to reproduce locally?

Visnupriya R
Kutir Mobility

CONTACT
Can’t find what you’re looking for?