Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails on live stream seems to expires with error on server #13873

Open
u007 opened this issue Jan 29, 2014 · 9 comments
Open

rails on live stream seems to expires with error on server #13873

u007 opened this issue Jan 29, 2014 · 9 comments

Comments

@u007
Copy link

u007 commented Jan 29, 2014

ive rescue_from right at the very top of application_controller,
and i'am still getting this error when my browser session expired after long inactivity.
it does not occur if i clear my browser cache.
the exception is handled properly if my browser cache is cleared by force.

rescue_from CanCan::AccessDenied do |exception|
    ....
end

#and this before action is below rescue:
before_action :invalidate_simultaneous_user_session, :unless => Proc.new {|c| c.controller_name == 'sessions' }
include ActionController::Live

error:

NoMethodError (undefined method `call' for nil:NilClass):
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/live.rb:67:in `call_on_error'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/live.rb:137:in `rescue in block in process'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/live.rb:146:in `block in process'



ArgumentError (uncaught throw :warden):
  /home/mysite/vendor/bundle/ruby/2.0.0/bundler/gems/devise-6d2992189cee/lib/devise/hooks/timeoutable.rb:21:in `throw'
  /home/mysite/vendor/bundle/ruby/2.0.0/bundler/gems/devise-6d2992189cee/lib/devise/hooks/timeoutable.rb:21:in `block in <top (required)>'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/hooks.rb:14:in `call'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/hooks.rb:14:in `block in _run_callbacks'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/hooks.rb:9:in `each'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/hooks.rb:9:in `_run_callbacks'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:53:in `_run_callbacks'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/proxy.rb:179:in `set_user'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/proxy.rb:217:in `user'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/proxy.rb:318:in `_perform_authentication'
  /home/mysite/vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/proxy.rb:104:in `authenticate'
  /home/mysite/vendor/bundle/ruby/2.0.0/bundler/gems/devise-6d2992189cee/lib/devise/controllers/helpers.rb:58:in `current_user'
  /home/mysite/app/controllers/application_controller.rb:97:in `invalidate_simultaneous_user_session'
@rafaelfranca
Copy link
Member

Could you create an application reproducing this bug and publish on github to make easier to us debug?

@pivotalshiny
Copy link

Jamilbk has created a demo app:
https://github.com/jamilbk/devise_bug_demo

To see error

  • clone repo
  • run rake db:migrate
  • bundle exec rails s and visit localhost:3000

Source (his comment on a closed Devise issue):
heartcombo/devise#2332

@rails-bot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@u007
Copy link
Author

u007 commented May 28, 2014

hi,

really need this to be fixed,
when warden expires, the rescue on live application does not get caught
but error page came out instead...
its a critical bug

@rafaelfranca
Copy link
Member

cc @tenderlove

@jamo
Copy link
Contributor

jamo commented May 28, 2014

I upgraded the sample app to rails/rails current version of rails, https://github.com/jamox/devise_bug_demo (one may need to change paths in Gemfile... to get it working locally.)

The error occurs still:

/Users/jamo/git/oss/warden/lib/warden/proxy.rb:128:in `throw'
/Users/jamo/git/oss/warden/lib/warden/proxy.rb:128:in `authenticate!'
/Users/jamo/git/oss/devise/lib/devise/controllers/helpers.rb:50:in `authenticate_user!'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:430:in `block in make_lambda'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:159:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:159:in `block in halting'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:230:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:230:in `block in halting'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:230:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:230:in `block in halting'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:165:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:165:in `block in halting'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:165:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:165:in `block in halting'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:165:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:165:in `block in halting'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:86:in `call'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/callbacks.rb:86:in `run_callbacks'
/Users/jamo/git/oss/rails/actionpack/lib/abstract_controller/callbacks.rb:21:in `process_action'
/Users/jamo/git/oss/rails/actionpack/lib/action_controller/metal/rescue.rb:29:in `process_action'
/Users/jamo/git/oss/rails/actionpack/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/notifications.rb:159:in `block in instrument'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/jamo/git/oss/rails/activesupport/lib/active_support/notifications.rb:159:in `instrument'
/Users/jamo/git/oss/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/Users/jamo/git/oss/rails/actionpack/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/Users/jamo/git/oss/rails/activerecord/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/Users/jamo/git/oss/rails/actionpack/lib/abstract_controller/base.rb:137:in `process'
/Users/jamo/git/oss/rails/actionview/lib/action_view/rendering.rb:30:in `process'
/Users/jamo/git/oss/rails/actionpack/lib/action_controller/metal/live.rb:230:in `block in process'

Not sure if this is more feature than a bug - need to investigate further...

@shlima

This comment has been minimized.

@rails rails locked and limited conversation to collaborators Jun 30, 2014
@rails-bot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@tbcooney
Copy link

When warden expires, the error still occurs. I experience this with Action Cable as it is trying to fetch /cable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants