New to rails. I'm getting the dreaded "syntax error, unexpected $end, expecting keyword_end"
but when I run it through
ruby -wc sessionscontroller.rb
it says "Syntax OK". What am I missing?
Here is the code:
class SessionsController < ApplicationController
def create
auth = request.env["omniauth.auth"]
user = User.find_by_provider_and_uid(auth["provider"], auth["uid"]) ||
User.create_with_omniauth(auth)
session[:user_id] = user.id
redirect_to root_url, :notice => "Signed in!"
end
end
This is copypasta direct from a railscast, and I am confused why it does not work. Thanks!
EDIT 2: Exact message:
SyntaxError in SessionsController#create
C:/Users/xxx/Sites/test.yyyy/app/models/user.rb:8: syntax error, unexpected $end, expecting keyword_end
Rails.root: C:/Users/xxx/Sites/test.yyyy
Application Trace | Framework Trace | Full Trace
app/controllers/sessions_controller.rb:4:in `create'
EDIT: The stack trace:
activesupport (3.1.1) lib/active_support/dependencies.rb:456:in `load'
activesupport (3.1.1) lib/active_support/dependencies.rb:456:in `block in load_file'
activesupport (3.1.1) lib/active_support/dependencies.rb:640:in `new_constants_in'
activesupport (3.1.1) lib/active_support/dependencies.rb:455:in `load_file'
activesupport (3.1.1) lib/active_support/dependencies.rb:342:in `require_or_load'
activesupport (3.1.1) lib/active_support/dependencies.rb:489:in `load_missing_constant'
activesupport (3.1.1) lib/active_support/dependencies.rb:181:in `block in const_missing'
activesupport (3.1.1) lib/active_support/dependencies.rb:179:in `each'
activesupport (3.1.1) lib/active_support/dependencies.rb:179:in `const_missing'
activesupport (3.1.1) lib/active_support/inflector/methods.rb:124:in `block in constantize'
activesupport (3.1.1) lib/active_support/inflector/methods.rb:123:in `each'
activesupport (3.1.1) lib/active_support/inflector/methods.rb:123:in `constantize'
activesupport (3.1.1) lib/active_support/dependencies.rb:528:in `block in initialize'
activesupport (3.1.1) lib/active_support/dependencies.rb:550:in `yield'
activesupport (3.1.1) lib/active_support/dependencies.rb:550:in `default'
activesupport (3.1.1) lib/active_support/dependencies.rb:550:in `[]'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:61:in `controller_reference'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:46:in `controller'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:25:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in `call'
omniauth (1.0.1) lib/omniauth/strategy.rb:366:in `call_app!'
omniauth (1.0.1) lib/omniauth/strategy.rb:330:in `callback_phase'
omniauth-oauth (1.0.0) lib/omniauth/strategies/oauth.rb:57:in `callback_phase'
omniauth (1.0.1) lib/omniauth/strategy.rb:204:in `callback_call'
omniauth (1.0.1) lib/omniauth/strategy.rb:166:in `call!'
omniauth (1.0.1) lib/omniauth/strategy.rb:148:in `call'
omniauth (1.0.1) lib/omniauth/builder.rb:34:in `call'
sass (3.1.10) lib/sass/plugin/rack.rb:54:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.5) lib/rack/etag.rb:23:in `call'
rack (1.3.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.1) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.5) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
C:/Users/dps42/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
C:/Users/dps42/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
C:/Users/dps42/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Related
I'm getting the following error when trying to use the delete method in a Ruby on Rails application.
BSON::InvalidObjectId in ServicesController#destroy
I'm using Rails 3.1.1 and MongoDB v2.4.15
Below is the Delete link in question.
%li= link_to 'Delete', #service, :method => :delete, :confirm => "Are you sure you want to delete this service?"
Here is the log error:
Started DELETE "/services/appeals" for 127.0.0.1 at 2016-12-21 11:08:42 -0500
Creating scope :orderable_scope. Overwriting existing method Service.orderable_scope.
Processing by ServicesController#destroy as HTML
Parameters: {"authenticity_token"=>"xxx", "id"=>"appeals"}
Completed 500 Internal Server Error in 11ms
BSON::InvalidObjectId (illegal ObjectId format: appeals):
When deleting items in other collections it works fine. I'm able to use the "services" edit link without errors. Below is the working Delete link and logs for deleting an attorney.
Working Link
%li= link_to "Delete", #attorney, :method => :delete, :confirm => "Are you sure you want to delete this attorney?"
Working Log
Started DELETE "/attorneys/first-last" for 127.0.0.1 at 2016-12-21 10:37:07 -0500
Creating scope :orderable_scope. Overwriting existing method Attorney.orderable_scope.Processing by AttorneysController#destroy as HTMLParameters: {"authenticity_token"=>"xxx", "id"=>"first-last"}
MONGODB x_development['system.namespaces'].find({})
MONGODB x_development['attorneys'].find({:slug=>"first-last"}).limit(-1).sort([[:_id, :asc]])
MONGODB x_development['system.namespaces'].find({})
MONGODB x_development['users'].find({:_id=>BSON::ObjectId('585a9dbc737da97cbd000006')}).limit(-1).sort([[:_id, :asc]])
Creating scope :orderable_scope. Overwriting existing method Service.orderable_scope.
MONGODB x_development['system.namespaces'].find({})
Redirected to http://0.0.0.0:3000/attorneys
Completed 302 Found in 69ms`
It's another developers application that I'm trying to get working correctly again. I'm not very experienced with Ruby, Rails, or MongoDB.
UPDATE
Below is the Full Trace
bson (1.4.0) lib/bson/types/object_id.rb:126:in `from_string'
mongoid (2.4.12) lib/mongoid/fields/internal/object_id.rb:38:in `serialize'
mongoid (2.4.12) lib/mongoid/criterion/optional.rb:97:in `for_ids'
mongoid (2.4.12) lib/mongoid/criteria.rb:310:in `search'
mongoid (2.4.12) lib/mongoid/criterion/inclusion.rb:125:in `find'
mongoid (2.4.12) lib/mongoid/finders.rb:84:in `find'
inherited_resources (1.3.1) lib/inherited_resources/base_helpers.rb:44:in `resource'
cancan (1.6.7) lib/cancan/inherited_resource.rb:11:in `load_resource_instance'
cancan (1.6.7) lib/cancan/controller_resource.rb:32:in `load_resource'
cancan (1.6.7) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource'
cancan (1.6.7) lib/cancan/controller_resource.rb:10:in `block in add_before_filter'
activesupport (3.1.1) lib/active_support/callbacks.rb:439:in `_run__3707406960644643515__process_action__1333295842175195574__callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.1.1) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.1.1) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.1.1) lib/active_support/notifications.rb:53:in `block in instrument'
activesupport (3.1.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.1) lib/active_support/notifications.rb:53:in `instrument'
actionpack (3.1.1) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.1.1) lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
actionpack (3.1.1) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.1.1) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.1) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.1) lib/action_controller/metal.rb:236:in `block in action'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:29:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:131:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in `call'
mongoid (2.4.12) lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'
mongoid (2.4.12) lib/mongoid.rb:133:in `unit_of_work'
mongoid (2.4.12) lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.6) lib/rack/etag.rb:23:in `call'
rack (1.3.6) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.6) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.6) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.6) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.6) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.6) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.6) lib/rack/lock.rb:15:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.6) lib/rack/handler/webrick.rb:59:in `service'
/Users/Home/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/Home/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/Home/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Anyone have any ideas? Any help would be greatly appreciated.
I found that the issue is in my services_controller
There was a line before_filter :load_service_by_slug, :only => [:edit, :update, :move_up, :move_down]
I had to add :destroy to that line.
I'm not a ruby on rails developer so this might be a menial fix. The friend I'm working on with this project is currently unavailable and was hoping someone could help me resolve this issue that sprang up randomly after reboot my VM. No changes to any files, it was just working and after reboot it wasn't. Tried googling to no avail.
Here is the full post from the console:
SyntaxError - syntax error, unexpected '%'
...er layout:'application', text:%q(<ng-include src="'/drinks/e...
... ^
/home/sirtastic/projects/tipsy-web/app/controllers/drinks_controller.rb:67: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
...ation', text:%q(<ng-include src="'/drinks/edit.html'"></ng-i...
... ^
/home/sirtastic/projects/tipsy-web/app/controllers/drinks_controller.rb:67: syntax error, unexpected '<'
...ude src="'/drinks/edit.html'"></ng-include>)
... ^
/home/sirtastic/projects/tipsy-web/app/controllers/drinks_controller.rb:67: unterminated regexp meets end of file:
app/controllers/drinks_controller.rb:67:in `'
activesupport (4.2.0) lib/active_support/dependencies.rb:457:in `block in load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:647:in `new_constants_in'
activesupport (4.2.0) lib/active_support/dependencies.rb:456:in `load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:354:in `require_or_load'
activesupport (4.2.0) lib/active_support/dependencies.rb:494:in `load_missing_constant'
activesupport (4.2.0) lib/active_support/dependencies.rb:184:in `const_missing'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:261:in `block in constantize'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:259:in `constantize'
activesupport (4.2.0) lib/active_support/dependencies.rb:566:in `get'
activesupport (4.2.0) lib/active_support/dependencies.rb:597:in `constantize'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:69:in `controller_reference'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:59:in `controller'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:38:in `serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164: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'
rack (1.6.1) lib/rack/etag.rb:24:in `call'
rack (1.6.1) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.1) lib/rack/head.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
activerecord (4.2.0) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) 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.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.1.2) lib/web_console/middleware.rb:37:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.1) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.1) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.1) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
rack (1.6.1) lib/rack/lock.rb:17:in `call'
rack (1.6.1) lib/rack/content_length.rb:15:in `call'
rack (1.6.1) lib/rack/handler/webrick.rb:89:in `service'
/usr/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Started POST "/__better_errors/6570466af1f32e70/variables" for 127.0.0.1 at 2016-01-24 16:12:23 -0800
Line 67 in drinks_controller.rb:
render layout:'application', text:%q(<ng-include src="'/drinks/edit.html'"></ng-include>)
Lets say I haven't defined any method for a particular action in the rails Controller (like for /users there is no method, and it will directly load up the template). Is there a way I can modify the Logger (I'm using ActiveSupport::BufferedLogger) to emit a log whenever a template is loaded?
EDIT: The reason why I ask this is that I am refactoring the code and an exception is being raised from the template code. Due to that there is no stack trace available and I am not able to figure out where exactly the error is being raised from (more importantly, I don't know which template is being loaded).
EDIT2:
activesupport (3.1.1) lib/active_support/whiny_nil.rb:48:in `method_missing'
cancan (1.6.8) lib/cancan/model_adapters/active_record_adapter.rb:69:in `tableized_conditions'
activesupport (3.1.1) lib/active_support/dependencies.rb:456:in `inject'
cancan (1.6.8) lib/cancan/model_adapters/active_record_adapter.rb:67:in `each'
cancan (1.6.8) lib/cancan/model_adapters/active_record_adapter.rb:67:in `inject'
cancan (1.6.8) lib/cancan/model_adapters/active_record_adapter.rb:67:in `tableized_conditions'
cancan (1.6.8) lib/cancan/model_adapters/active_record_adapter.rb:57:in `conditions'
cancan (1.6.8) lib/cancan/model_adapters/active_record_adapter.rb:94:in `database_records'
cancan (1.6.8) lib/cancan/model_additions.rb:23:in `accessible_by'
cancan (1.6.8) lib/cancan/controller_resource.rb:81:in `load_collection'
cancan (1.6.8) lib/cancan/controller_resource.rb:34:in `load_resource'
cancan (1.6.8) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource'
cancan (1.6.8) lib/cancan/controller_resource.rb:10:in `send'
cancan (1.6.8) lib/cancan/controller_resource.rb:10:in `_callback_before_1418'
activesupport (3.1.1) lib/active_support/callbacks.rb:448:in `_run__482750358__process_action__686174538__callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:386:in `send'
activesupport (3.1.1) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.1.1) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.1.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.1.1) lib/active_support/notifications.rb:53:in `instrument'
activesupport (3.1.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.1) lib/active_support/notifications.rb:53:in `instrument'
actionpack (3.1.1) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.1.1) lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
activerecord (3.1.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.1.1) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.1.1) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.1) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.1) lib/action_controller/metal.rb:236:in `action'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:29:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in `call'
sass (3.2.1) lib/sass/./sass/plugin/rack.rb:54:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.6) lib/rack/etag.rb:23:in `call'
rack (1.3.6) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.6) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.6) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.1) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.6) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.6) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.6) lib/rack/runtime.rb:17:in `call'
rack (1.3.6) lib/rack/lock.rb:15:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/railtie/configurable.rb:30:in `send'
railties (3.1.1) lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb:171:in `send'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb:171:in `handle_spawn_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/utils.rb:470:in `safe_fork'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:180:in `start'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/var/lib/passenger-standalone/3.0.17-x86-ruby1.8.7-linux-gcc4.4.6-1002/support/helper-scripts/passenger-spawn-server:99
I have a rails app that is is using cancan permission and i am trying to block others users from editing another user's dashboard. This has worked for other models but not this one.
profile.rb
belongs_to :dashboard
Dashboard.rb
has_many :profiles
Dashboard_controller
before_filter :authenticate_user!
load_and_authorize_resource :through => :current_profile
Ability.rb
can :manage, Dashboard, :profile => { :user_id => user.id }
When I go to view my dashboard rails gives me the error
undefined method `dashboards'
Any ideas how I can overcome this error?
Full trace
activemodel (3.1.3) lib/active_model/attribute_methods.rb:385:in `method_missing'
activerecord (3.1.3) lib/active_record/attribute_methods.rb:60:in `method_missing'
cancan (1.6.7) lib/cancan/controller_resource.rb:174:in `resource_base'
cancan (1.6.7) lib/cancan/controller_resource.rb:77:in `load_collection?'
cancan (1.6.7) lib/cancan/controller_resource.rb:33:in `load_resource'
cancan (1.6.7) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource'
cancan (1.6.7) lib/cancan/controller_resource.rb:10:in `block in add_before_filter'
activesupport (3.1.3) lib/active_support/callbacks.rb:439:in `_run__4465164984821190291__process_action__669795061578511304__callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `block in instrument'
activesupport (3.1.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `instrument'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
activerecord (3.1.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.1.3) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.1.3) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.3) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.3) lib/action_controller/metal.rb:236:in `block in action'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:29:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:532:in `call'
warden (1.1.0) lib/warden/manager.rb:35:in `block in call'
warden (1.1.0) lib/warden/manager.rb:34:in `catch'
warden (1.1.0) lib/warden/manager.rb:34:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.6) lib/rack/etag.rb:23:in `call'
rack (1.3.6) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/flash.rb:247:in `call'
rack (1.3.6) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.6) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.3) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.3) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.6) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.6) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.6) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.6) lib/rack/lock.rb:15:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.3) lib/rails/engine.rb:456:in `call'
rack (1.3.6) lib/rack/content_length.rb:14:in `call'
railties (3.1.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.6) lib/rack/handler/webrick.rb:59:in `service'
/Users/mac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/mac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/mac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
When you use load_authorize_resource Cancan assumes a plural resource (ie that a profile has many dashboards). According to the docs adding :singleton => true turns this off
I get a very opaque error with the following code:
client = OAuth2::Client.new(
"#{FACEBOOK_CONFIG['application_id']}", "#{FACEBOOK_CONFIG['secret_key']}",
:site => 'https://graph.facebook.com'
)
token = OAuth2::AccessToken.new(client, fb_token)
token.get('/me')
when I execute token.get('/me'), I get the following output:
OAuth2::Error Exception: OAuth2::Error
This code works fine with v0.4.1 but fails with v0.5.0
Here is the stack trace:
OAuth2::Error
Rails.root: /Users/myname/Sites/mysite
Application Trace | Framework Trace | Full Trace
oauth2 (0.5.0) lib/oauth2/client.rb:107:in `request'
oauth2 (0.5.0) lib/oauth2/access_token.rb:98:in `request'
oauth2 (0.5.0) lib/oauth2/access_token.rb:105:in `get'
app/models/facebook_session.rb:430:in `get_fb_me'
app/models/facebook_session.rb:45:in `get_fb_user_id'
app/models/facebook_session.rb:258:in `authenticate'
app/controllers/devise/registrations_controller.rb:42:in `create'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:151:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.3) lib/active_support/callbacks.rb:470:in `_run__664618575269127242__process_action__2116611615142804558__callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in `run_callbacks'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in `process'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:in `process'
actionpack (3.0.3) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.3) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:82:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in `call'
warden (0.10.7) lib/warden/manager.rb:35:in `block in call'
warden (0.10.7) lib/warden/manager.rb:34:in `catch'
warden (0.10.7) lib/warden/manager.rb:34:in `call'
haml (3.0.25) lib/sass/plugin/rack.rb:41:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in `call'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
railties (3.0.3) lib/rails/rack/debugger.rb:21:in `call'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/handler/webrick.rb:52:in `service'
/Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
I've only used Omniauth recently but it looks like your trace is saying you have something like this in your oauth_helper:
def try_access_token
begin
..
rescue OAuth2::AccessDenied
end
end
If that's the case, try changing OAuth2::AccessDenied to OAuth2::Error. Oauth2::Error provides a .code attribute that you can check to determine if it's an access denied response.
4.1 docs: http://rubydoc.info/gems/oauth2/0.4.1/frames
5.0+ docs: http://rubydoc.info/gems/oauth2/0.5.0/frames
I have the same problem.
Looking at the gem code, it's because the Facebook answer is an HTTP code of 400..599.
when 400..599
e = Error.new(response)
raise e if opts[:raise_errors] || options[:raise_errors]
Sadly, the communication between my server to facebook is using HTTPS, therefore, I haven't been able to intercept the problematic request yet.
UPDATE
I got a 400 error from Facebook :
OAuth "Facebook Platform" "invalid_request" "An active access token must be used to query information about the current user."
UPDATE 2
Interesting discussion here : Facebook access_token invalid?
I ended up rolling oauth2 back to 0.4.1 and my FB login and querying works.