Rails logger middleware error - ruby-on-rails

In a controller, in I have defined a method which looks something like this:
def blah
begin
# do something
# works fine till here, no issues
# breaks in the next line, (while rendering json??)
render json: { status: 1 }
rescue StandardError => e
# code never reaches here(??)
# log exception
end
end
Even the begin-rescue block is unable to catch this error.
What really stumps me is that there is not a single line from the codebase in the stacktrace. Any pointers?
Full stacktrace:
undefined method `logger' for ["{\"status\":1}"]:Array
activesupport (4.0.13) lib/active_support/configurable.rb, line 112
107 options = names.extract_options!
108
109 names.each do |name|
110 raise NameError.new('invalid config attribute name') unless name =~ /^[_A-Za-z]\w*$/
111
> 112 reader, reader_line = "def #{name}; config.#{name}; end", __LINE__
113 writer, writer_line = "def #{name}=(value); config.#{name} = value; end", __LINE__
114
115 singleton_class.class_eval reader, __FILE__, reader_line
116 singleton_class.class_eval writer, __FILE__, writer_line
117
App backtrace
Full backtrace
- activesupport (4.0.13) lib/active_support/configurable.rb:112:in `logger'
- geokit-rails (2.0.1) lib/geokit-rails/geocoder_control.rb:15:in `set_geokit_domain'
- activesupport (4.0.13) lib/active_support/callbacks.rb:397:in `_run__489562034147364391__process_action__callbacks'
- activesupport (4.0.13) lib/active_support/callbacks.rb:80:in `run_callbacks'
- actionpack (4.0.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
- actionpack (4.0.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
- actionpack (4.0.13) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
- activesupport (4.0.13) lib/active_support/notifications.rb:159:in `block in instrument'
- activesupport (4.0.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
- activesupport (4.0.13) lib/active_support/notifications.rb:159:in `instrument'
- actionpack (4.0.13) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
- actionpack (4.0.13) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
- activerecord (4.0.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
- actionpack (4.0.13) lib/abstract_controller/base.rb:136:in `process'
- actionpack (4.0.13) lib/abstract_controller/rendering.rb:44:in `process'
- actionpack (4.0.13) lib/action_controller/metal.rb:195:in `dispatch'
- actionpack (4.0.13) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
- actionpack (4.0.13) lib/action_controller/metal.rb:231:in `block in action'
- actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
- actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:50:in `call'
- actionpack (4.0.13) lib/action_dispatch/journey/router.rb:71:in `block in call'
- actionpack (4.0.13) lib/action_dispatch/journey/router.rb:59:in `call'
- actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:676:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack-pjax (0.8.0) lib/rack/pjax.rb:12:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
- omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- exception_notification (4.1.1) lib/exception_notification/rack.rb:32:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
- warden (1.2.3) lib/warden/manager.rb:34:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/etag.rb:23:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/conditionalget.rb:25:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/head.rb:11:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- remotipart (1.3.0) lib/remotipart/middleware.rb:32:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/flash.rb:241:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
- rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/cookies.rb:486:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- activerecord (4.0.13) lib/active_record/query_cache.rb:36:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- activerecord (4.0.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- activerecord (4.0.13) lib/active_record/migration.rb:373:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
- activesupport (4.0.13) lib/active_support/callbacks.rb:373:in `_run__2519945963821911877__call__callbacks'
- activesupport (4.0.13) lib/active_support/callbacks.rb:80:in `run_callbacks'
- actionpack (4.0.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/reloader.rb:64:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- bugsnag (4.2.1) lib/bugsnag/rack.rb:33:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- better_errors (2.0.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
- better_errors (2.0.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
- better_errors (2.0.0) lib/better_errors/middleware.rb:57:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- railties (4.0.13) lib/rails/rack/logger.rb:38:in `call_app'
- railties (4.0.13) lib/rails/rack/logger.rb:22:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- request_store (1.2.0) lib/request_store/middleware.rb:8:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/request_id.rb:21:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/runtime.rb:17:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- activesupport (4.0.13) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/lock.rb:17:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- actionpack (4.0.13) lib/action_dispatch/middleware/static.rb:84:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- railties (4.0.13) lib/rails/engine.rb:511:in `call'
- railties (4.0.13) lib/rails/application.rb:97:in `call'
- newrelic_rpm (3.16.2.321) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
- rack (1.5.5) lib/rack/lock.rb:17:in `call'
- rack (1.5.5) lib/rack/content_length.rb:14:in `call'
rack (1.5.5) lib/rack/handler/webrick.rb:60:in `service'
- /{path-to-ruby}/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
- /{path-to-ruby}/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
- /{path-to-ruby}/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

So...
The issue was resolved after I changed the method name.
The method was named config, since the API endpoint needed to have this name. I changed the method name to app_config, and it started working. Not sure why this happened, but it has been working as expected since then.

One possible cause could be better_errors.
If an error is raised in a rescue block, its cause would be the original error. better_errors displays that cause instead, meaning the backtrace will not be in the rescue block. This gives you the illusion that it is never rescued.
See https://github.com/BetterErrors/better_errors/pull/459 for more details

Related

Request.uri is empty for routes to handle?

I'm having this weird issue, where, as far as I can tell, Request isn't set, for some reason.
None of the trace is from my app, only gems, and I can't seem to figure this out. I've tried disabling gems, including newrelic, without luck.
From what I can see here, there's nothing uncommon, that would unset the Request.new env call from lib/action_dispatch/routing/redirection.rb in call?
Also worth mentioning, that this is triggered on any call, on any URL I could call from my browser, leading me to believe it has nothing to do with the code, but some gems, or my setup.
Info
Running Ruby 2.2.3
Rails 4.2.4
OS X
Stacktrace
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:17:in `rescue in split'
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:14:in `split'
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
actionpack (4.2.4) lib/action_dispatch/routing/redirection.rb:26:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/redirection.rb:21:in `call'
actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack-attack (4.4.1) lib/rack/attack.rb:107:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
http_accept_language (2.0.5) lib/http_accept_language/middleware.rb:14:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rails_event_store (0.11.0) lib/rails_event_store/middleware.rb:14:in `_call'
rails_event_store (0.11.0) lib/rails_event_store/middleware.rb:9:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
ahoy_matey (1.4.2) lib/ahoy/engine.rb:22:in `call_with_quiet_ahoy'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
request_store (1.3.1) lib/request_store/middleware.rb:9:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/***/.rvm/gems/ruby-2.2.3/bundler/gems/font_assets-457dcfddc431/lib/font_assets/middleware.rb:29:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
puma (2.16.0) lib/puma/server.rb:557:in `handle_request'
puma (2.16.0) lib/puma/server.rb:404:in `process_client'
puma (2.16.0) lib/puma/server.rb:270:in `block in run'
puma (2.16.0) lib/puma/thread_pool.rb:106:in `call'
puma (2.16.0) lib/puma/thread_pool.rb:106:in `block in spawn_thread'

undefined method `build' for Doorkeeper::Request::Assertion:Class

Currently, I'm building an application that can login via fb/g+ using doorkeeper and doorkeeper-grant_assertion. Previously, everything is okay but just a sudden I encounter this problem which is unfamiliar to me and even I already google it still can't find someone who had encounter this problem.
class Oauth::TokensController < Doorkeeper::TokensController
def create
response = authorize_response
self.headers.merge! response.headers
self.response_body =
if response.status == :ok
json_success( response )
else
json_fail( response )
end
end
end
UPDATE
- doorkeeper (3.0.1) lib/doorkeeper/server.rb:16:in `token_request'
- doorkeeper (3.0.1) app/controllers/doorkeeper/tokens_controller.rb:38:in `strategy'
- doorkeeper (3.0.1) app/controllers/doorkeeper/tokens_controller.rb:42:in `authorize_response'
- app/controllers/oauth/tokens_controller.rb:4:in `create'
- actionpack (4.2.5.1) lib/abstract_controller/base.rb:198:in `process_action'
- actionpack (4.2.5.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
- activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `block in instrument'
- activesupport (4.2.5.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
- activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `instrument'
- actionpack (4.2.5.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
- actionpack (4.2.5.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
- actionpack (4.2.5.1) lib/abstract_controller/base.rb:137:in `process'
- actionpack (4.2.5.1) lib/action_controller/metal.rb:196:in `dispatch'
- actionpack (4.2.5.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
- actionpack (4.2.5.1) lib/action_controller/metal.rb:237:in `block in action'
- actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
- actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'
- actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'
- actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:30:in `serve'
- actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:815:in `call'
- omniauth (1.3.1) lib/omniauth/strategy.rb:186:in `call!'
- omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
- omniauth (1.3.1) lib/omniauth/strategy.rb:186:in `call!'
- omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
- rack-attack (4.4.1) lib/rack/attack.rb:107:in `call'
- warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
- warden (1.2.6) lib/warden/manager.rb:34:in `call'
- rack (1.6.4) lib/rack/etag.rb:24:in `call'
- rack (1.6.4) lib/rack/conditionalget.rb:38:in `call'
- rack (1.6.4) lib/rack/head.rb:13:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
- rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
- rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
- activerecord (4.2.5.1) lib/active_record/query_cache.rb:36:in `call'
- activerecord (4.2.5.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
- activerecord (4.2.5.1) lib/active_record/migration.rb:377:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
- activesupport (4.2.5.1) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
- activesupport (4.2.5.1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
- activesupport (4.2.5.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
- railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
- railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `block in call'
- activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
- activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:26:in `tagged'
- activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `tagged'
- railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `call'
- quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
- request_store (1.3.0) lib/request_store/middleware.rb:9:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
- rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
- rack (1.6.4) lib/rack/runtime.rb:18:in `call'
- activesupport (4.2.5.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
- rack (1.6.4) lib/rack/lock.rb:17:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/static.rb:116:in `call'
- rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
- rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
- railties (4.2.5.1) lib/rails/engine.rb:518:in `call'
- railties (4.2.5.1) lib/rails/application.rb:165:in `call'
- rack (1.6.4) lib/rack/content_length.rb:15:in `call'
- thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
- thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
- thin (1.5.1) lib/thin/connection.rb:54:in `process'
- thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
- eventmachine (1.0.9.1) lib/eventmachine.rb:193:in `run'
- thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
- thin (1.5.1) lib/thin/server.rb:159:in `start'
- rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
- rack (1.6.4) lib/rack/server.rb:286:in `start'
- railties (4.2.5.1) lib/rails/commands/server.rb:80:in `start'
- railties (4.2.5.1) lib/rails/commands/commands_tasks.rb:80:in `block in server'
- railties (4.2.5.1) lib/rails/commands/commands_tasks.rb:75:in `server'
- railties (4.2.5.1) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
- railties (4.2.5.1) lib/rails/commands.rb:17:in `
Thanks.

Circular Dependency issue using Ruby on Rails Gem

I am currently use a rails starter kit for a project which can be found here.This allows for a simple login, home page, monitoring, etc. This starter kit uses rails 4.1.8 and ruby 2.1.3.
I am currently now trying to get the a dashboard gem to work called dashing rails. It's compatible with rails 4.0 and ruby 2.0.
I allowed authorization to my localhost by adding the appropriate path for it. I am able to get the page to show, however when I load the page it comes out incomplete but sometimes it's different. Below is a picture with the buzzwords and convergence incomplete. They should have more information in them. This package using active support and requires redis server. It also requires multiple threads.
Yes I did try the curl command.
The problem I believe has to do with some dependency issue, as stated by the log, but I am new to rails so any help with trying to resolve this issue or the cause would be greatly appreciated. Thank you!
Here is the error file
RuntimeError (Circular dependency detected while autoloading constant Dashing::WidgetsController):
activesupport (4.1.8) lib/active_support/dependencies.rb:478:in `load_missing_constant'
activesupport (4.1.8) lib/active_support/dependencies.rb:180:in `const_missing'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:240:in `const_get'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:240:in `block in constantize'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `each'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `inject'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `constantize'
activesupport (4.1.8) lib/active_support/dependencies.rb:552:in `get'
activesupport (4.1.8) lib/active_support/dependencies.rb:583:in `constantize'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:78:in `controller_reference'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:68:in `controller'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:46:in `call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in `call'
railties (4.1.8) lib/rails/engine.rb:514:in `call'
railties (4.1.8) lib/rails/railtie.rb:194:in `public_send'
railties (4.1.8) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack-pjax (0.8.0) lib/rack/pjax.rb:12:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/builder.rb:59:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/flash.rb:254:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/migration.rb:380:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.8) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (3.2.1) lib/airbrake/rails/middleware.rb:13:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.8) lib/rails/rack/logger.rb:22:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (3.2.1) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (3.2.1) lib/airbrake/user_informer.rb:12:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.8) lib/rails/engine.rb:514:in `call'
railties (4.1.8) lib/rails/application.rb:144:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.10.2) lib/puma/server.rb:492:in `handle_request'
puma (2.10.2) lib/puma/server.rb:363:in `process_client'
puma (2.10.2) lib/puma/server.rb:254:in `block in run'
puma (2.10.2) lib/puma/thread_pool.rb:101:in `call'
puma (2.10.2) lib/puma/thread_pool.rb:101:in `block in spawn_thread'

Rails 3 to 4 wrong number of arguments error for empty hash argument

I'm having a problem updating params after I switched to strong params. I'm getting a wrong number of arguments error, here's the trace:
Started PATCH "/profiles/rails/about_me" for 127.0.0.1 at 2014-09-23 12:14:19 -0700
Processing by UsersController#about_me as
Parameters: {"utf8"=>"✓", "user"=>{"about_me"=>"testt"}, "commit"=>"Update Biography", "id"=>"rails"}
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."deleted" = 'f' AND "users"."id" = 10 ORDER BY "users"."id" ASC LIMIT 1
(0.2ms) SELECT COUNT(*) FROM "terms" INNER JOIN "terms_users" ON "terms"."id" = "terms_users"."term_id" WHERE "terms_users"."user_id" = $1 AND "terms"."name" = 'application' [["user_id", 10]]
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."deleted" = 'f' AND "users"."slug" = 'rails' ORDER BY "users"."id" ASC LIMIT 1
Completed 500 Internal Server Error in 14ms
127.0.0.1 POST /profiles/rails/about_me 500 Internal Server Error UsersController#about_me JS 13.8 (DB 0.0, View 0.0) {"utf8"=>"✓", "user"=>{"about_me"=>"testt"}, "commit"=>"Update Biography", "id"=>"rails"} {}
** [Airbrake] Notice was not sent due to configuration:
Environment Monitored? false
API key set? true
ArgumentError - wrong number of arguments (2 for 1):
app/models/user.rb:347:in `update_profile'
app/controllers/users_controller.rb:173:in `shared_update'
app/controllers/users_controller.rb:72:in `about_me'
actionpack (4.1.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.6) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.6) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.6) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
config/initializers/log_formatter.rb:22:in `block (2 levels) in <top (required)>'
activesupport (4.1.6) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.6) lib/active_support/notifications.rb:159:in `instrument'
config/initializers/log_formatter.rb:21:in `block in <top (required)>'
actionpack (4.1.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.6) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.6) lib/action_view/rendering.rb:30:in `process'
rack-mini-profiler (0.9.2) lib/mini_profiler/profiling_methods.rb:108:in `block in profile_method'
actionpack (4.1.6) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.6) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.6) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:678:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
apipie-rails (0.2.6) lib/apipie/static_dispatcher.rb:65:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
bullet (4.13.2) lib/bullet/rack.rb:12:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
apipie-rails (0.2.6) lib/apipie/extractor/recorder.rb:97:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/error_collector.rb:50:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/agent_hooks.rb:26:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:35:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/flash.rb:254:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.6) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.6) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (4.1.0) lib/airbrake/rails/middleware.rb:13:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
better_errors (2.0.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.0.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.0.0) lib/better_errors/middleware.rb:57:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.6) lib/rails/rack/logger.rb:20:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activesupport (4.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/static.rb:64:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
heroku-deflater (0.5.3) lib/heroku-deflater/skip_binary.rb:19:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/deflater.rb:25:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
heroku-deflater (0.5.3) lib/heroku-deflater/serve_zipped_assets.rb:50:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (4.1.0) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (4.1.0) lib/airbrake/user_informer.rb:12:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack-mini-profiler (0.9.2) lib/mini_profiler/profiler.rb:300:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.6) lib/rails/engine.rb:514:in `call'
railties (4.1.6) lib/rails/application.rb:144:in `call'
railties (4.1.6) lib/rails/railtie.rb:194:in `method_missing'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.2) lib/thin/connection.rb:53:in `process'
thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
thin (1.6.2) lib/thin/server.rb:162:in `start'
rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.1.6) lib/rails/commands/server.rb:69:in `start'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.6) lib/rails/commands.rb:17:in `<top (required)>'
script/rails:6:in `<main>'
User.rb:347:update_profile:
def update_profile(attributes, options = {})
return false if attributes.nil?
previous_avatar = !has_default_avatar?
assign_attributes(attributes, options)
if valid?
if about_me_changed? || attributes[:avatar]
uploaded_avatar = (attributes[:avatar].nil?)? false : true
BadgesStrategies::Profile.assign_based_on(self, about_me: [about_me_was, about_me], avatar: [previous_avatar, uploaded_avatar])
end
end
save
end
UsersController:shared_update:
def shared_update
params[:user].delete(:password) if params[:user] && params[:user][:password].blank?
params[:user].delete(:password_confirmation) if params[:user] && params[:user][:password].blank? and params[:user][:password_confirmation].blank?
email_changed = params[:user] && params[:user][:email] && #user.email != params[:user][:email]
if #user.update_profile(user_params)
sign_in #user, bypass: true
if email_changed
if #user.pending_reconfirmation?
flash[:notice] = "Success! Please check '#{params[:user][:email]}' for instructions to complete the update process."
else
flash[:notice] = "Successfully changed to '#{params[:user][:email]}'"
end
else
flash[:notice] = "Your profile is successfully updated"
end
else
flash[:alert] = (params[:user].nil? )? "ERROR: No user information sent for update" : "ERROR: #{#user.errors.full_messages.to_sentence}"
end
end
UsersController:about_me:
def about_me
shared_update
render partial: 'users/about_me', locals: { user: #user }
end
Could somebody look through this and tell me what exactly is going wrong? Is it a syntax error in Rails 4?
If user.rb line 347 is this line:
assign_attributes(attributes, options)
Then there's your problem. ActiveRecord#assign_attributes appears to only take one argument in Rails 4.
See docs here
Rails 3's API for the method did allow an options hash. See docs here.
In rails 3, the options seems to have handled access control allowing to configure who was able to do mass assignment. In rails 4 with strong params, that responsibility has shifted to the param hash itself.
The rails 4 docs state:
If the passed hash responds to permitted? method and the return value of this method is false an ActiveModel::ForbiddenAttributesError exception is raised.
In conclusion, when you get a message telling you that you aren't passing the right arguments to a method, the first thing you do should be to look up that method in the documentation and see how you are supposed to use it.
I had no idea when I read this question what the answer was. I just found the method that you were passing two arguments into you your code, and then looked up the docs and the answer was pretty clear.

Rescue an ActionController::BadRequest

I am running a rails app and I have a simple show action, where the code is something like the following:
#post = Post.find(params[:id])
So if you go to posts/1 for example you will see the post if there is one.
I can catch invalid params[:id] or invalid params but I noticed something strange. Somebody tried to pass me yesterday something like the following:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED%E5;
And I am getting an ActionController bad request exception. When I am visiting the url /posts/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED%E5; I see a blank page instead of the typical 404 I have in a similar error. I also noticed that with the param it doesn't get into posts controller show action, either to application controller (I've tried to rescue it from there as well). I suppose it is a rack exception from some gem I have and I don't know how to rescue it.
Here is my whole error response:
Started GET "/blog/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED" for 192.168.1.105 at 2014-03-18 09:45:42 +0200
ActionController::BadRequest (ActionController::BadRequest):
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:37:in `block in call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:33:in `each'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:33:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
bullet (4.7.1) lib/bullet/rack.rb:12:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__44017112__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (1.1.0) lib/better_errors/middleware.rb:58:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.7.1) lib/puma/server.rb:486:in `handle_request'
puma (2.7.1) lib/puma/server.rb:357:in `process_client'
puma (2.7.1) lib/puma/server.rb:250:in `block in run'
puma (2.7.1) lib/puma/thread_pool.rb:92:in `call'
puma (2.7.1) lib/puma/thread_pool.rb:92:in `block in spawn_thread'
Any idea how can I rescue this one with a 404 and avoid the blank page?
OK I found that if you pass something like %ED it is a 400 bad request so I just created a 400 static page and I've added the following in my exception notification:
Myapp::Application.config.middleware.use ExceptionNotification::Rack,
:ignore_exceptions => ['ActionController::BadRequest'] + ExceptionNotifier.ignored_exceptions,
:ignore_crawlers => %w{Googlebot bingbot},
:email => {
:email_prefix => "[Myapp.com Exception Notifier] ",
:sender_address => %{"myapp.com" <info#myapp.com>},
:exception_recipients => %w{myemail#myapp.com}
}

Resources