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

ThreadError in Users/sessions#create uncaught throw `warden' in thread 0xe2ea4c8 #754

Closed
inetufo opened this issue Jan 2, 2011 · 11 comments

Comments

@inetufo
Copy link

inetufo commented Jan 2, 2011

Using the code at master of devise
gem 'devise', :git => 'git://github.com/plataformatec/devise.git'

with :confirmable in my modle

class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable

end

When i signed in a new user without registration confirmation, i got these error messages:

ThreadError in Users/sessions#create
Showing F:/XXX/_header.html.erb where line #4 raised:

uncaught throw `warden' in thread 0xe2ea4c8

Extracted source (around line #4):

1:


2:

3:


4: <% if user_signed_in? %>
5:

@inetufo
Copy link
Author

inetufo commented Jan 2, 2011

Here is the full trace

D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/hooks/activatable.rb:8:in throw' D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/hooks/activatable.rb:8 warden (1.0.3) lib/warden/hooks.rb:14:incall'
warden (1.0.3) lib/warden/hooks.rb:14:in _run_callbacks' warden (1.0.3) lib/warden/hooks.rb:9:ineach'
warden (1.0.3) lib/warden/hooks.rb:9:in _run_callbacks' warden (1.0.3) lib/warden/manager.rb:53:in_run_callbacks'
warden (1.0.3) lib/warden/proxy.rb:164:in set_user' warden (1.0.3) lib/warden/proxy.rb:275:in_perform_authentication'
warden (1.0.3) lib/warden/proxy.rb:90:in authenticate' D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/controllers/helpers.rb:48:incurrent_user'
D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/controllers/helpers.rb:44:in user_signed_in?' actionpack (3.0.3) lib/abstract_controller/helpers.rb:55:insend'
actionpack (3.0.3) lib/abstract_controller/helpers.rb:55:in user_signed_in?' app/views/shared/_header.html.erb:4:in_app_views_shared__header_html_erb___1045377625_47350608_270070'
actionpack (3.0.3) lib/action_view/template.rb:135:in send' actionpack (3.0.3) lib/action_view/template.rb:135:inrender'
activesupport (3.0.3) lib/active_support/notifications.rb:54:in instrument' actionpack (3.0.3) lib/action_view/template.rb:127:inrender'
actionpack (3.0.3) lib/action_view/render/partials.rb:333:in render_partial' actionpack (3.0.3) lib/action_view/render/partials.rb:262:inrender'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:ininstrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in instrument' actionpack (3.0.3) lib/action_view/render/partials.rb:260:inrender'
actionpack (3.0.3) lib/action_view/render/partials.rb:378:in _render_partial' actionpack (3.0.3) lib/action_view/render/rendering.rb:22:inrender'
app/views/layouts/welcome.html.erb:14:in _app_views_layouts_welcome_html_erb__287016869_47525160_0' actionpack (3.0.3) lib/action_view/template.rb:135:insend'
actionpack (3.0.3) lib/action_view/template.rb:135:in render' activesupport (3.0.3) lib/active_support/notifications.rb:54:ininstrument'
actionpack (3.0.3) lib/action_view/template.rb:127:in render' actionpack (3.0.3) lib/action_view/render/layouts.rb:80:in_render_layout'
actionpack (3.0.3) lib/action_view/render/rendering.rb:62:in _render_template' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument'
actionpack (3.0.3) lib/action_view/render/rendering.rb:56:in _render_template' actionpack (3.0.3) lib/action_view/render/rendering.rb:26:inrender'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:114:in _render_template' actionpack (3.0.3) lib/abstract_controller/rendering.rb:108:inrender_to_body'
actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:in render_to_body' actionpack (3.0.3) lib/action_controller/metal/compatibility.rb:55:inrender_to_body'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:101:in render_to_string' actionpack (3.0.3) lib/abstract_controller/rendering.rb:92:inrender'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:17:in render' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:inrender'
activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:in ms' D:/Ruby187/lib/ruby/1.8/benchmark.rb:308:inrealtime'
activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:in ms' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:inrender'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:78:in cleanup_view_runtime' activerecord (3.0.3) lib/active_record/railties/controller_runtime.rb:15:incleanup_view_runtime'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:39:in render' D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/controllers/scoped_views.rb:28:inrender_with_scope'
D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/app/controllers/devise/sessions_controller.rb:8:in new' actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:4:insend_action'
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:inprocess_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:inprocess_action'
activesupport (3.0.3) lib/active_support/callbacks.rb:445:in _run__41413582__process_action__943997142__callbacks' activesupport (3.0.3) lib/active_support/callbacks.rb:409:insend'
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:insend'
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in run_callbacks' actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:inprocess_action'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in process_action' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument'
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:inprocess_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in process' actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:inprocess'
actionpack (3.0.3) lib/action_controller/metal.rb:138:in dispatch' actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
actionpack (3.0.3) lib/action_controller/metal.rb:178:in action' D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/failure_app.rb:44:incall'
D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/failure_app.rb:44:in recall' D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/failure_app.rb:28:inrespond'
actionpack (3.0.3) lib/abstract_controller/base.rb:151:in send_action' actionpack (3.0.3) lib/abstract_controller/base.rb:151:inprocess_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in process' actionpack (3.0.3) lib/action_controller/metal.rb:138:indispatch'
actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:in dispatch' actionpack (3.0.3) lib/action_controller/metal.rb:178:inaction'
D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/failure_app.rb:17:in call' D:/Ruby187/lib/ruby/gems/1.8/bundler/gems/devise-555435e6fefc/lib/devise/failure_app.rb:17:incall'
warden (1.0.3) lib/warden/manager.rb:118:in call_failure_app' warden (1.0.3) lib/warden/manager.rb:104:inprocess_unauthenticated'
warden (1.0.3) lib/warden/manager.rb:47:in call' actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in call' rack (1.2.1) lib/rack/methodoverride.rb:24:incall'
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:incall'
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:incall'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in call' activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:incache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in cache' activerecord (3.0.3) lib/active_record/query_cache.rb:31:incall'
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:incall'
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:incall'
rack (1.2.1) lib/rack/sendfile.rb:107:in call' actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in call' railties (3.0.3) lib/rails/rack/logger.rb:13:incall'
rack (1.2.1) lib/rack/runtime.rb:17:in call' activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:incall'
rack (1.2.1) lib/rack/lock.rb:11:in call' rack (1.2.1) lib/rack/lock.rb:11:insynchronize'
rack (1.2.1) lib/rack/lock.rb:11:in call' actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:incall'
railties (3.0.3) lib/rails/application.rb:168:in call' railties (3.0.3) lib/rails/application.rb:77:insend'
railties (3.0.3) lib/rails/application.rb:77:in method_missing' railties (3.0.3) lib/rails/rack/log_tailer.rb:14:incall'
rack (1.2.1) lib/rack/content_length.rb:13:in call' rack (1.2.1) lib/rack/handler/webrick.rb:52:inservice'
D:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:104:in service' D:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:65:inrun'
D:/Ruby187/lib/ruby/1.8/webrick/server.rb:173:in start_thread' D:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:instart'
D:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in start_thread' D:/Ruby187/lib/ruby/1.8/webrick/server.rb:95:instart'
D:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in each' D:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:instart'
D:/Ruby187/lib/ruby/1.8/webrick/server.rb:23:in start' D:/Ruby187/lib/ruby/1.8/webrick/server.rb:82:instart'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in run' rack (1.2.1) lib/rack/server.rb:213:instart'
railties (3.0.3) lib/rails/commands/server.rb:65:in start' railties (3.0.3) lib/rails/commands.rb:30 railties (3.0.3) lib/rails/commands.rb:27:intap'
railties (3.0.3) lib/rails/commands.rb:27
/script\rails:6:in require' /script\rails:6 ruby-debug-ide (0.4.16) lib/ruby-debug-ide.rb:112:indebug_load'
ruby-debug-ide (0.4.16) lib/ruby-debug-ide.rb:112:in debug_program' ruby-debug-ide (0.4.16) bin/rdebug-ide:87 D:/Ruby187/bin/rdebug-ide:19:inload'
D:/Ruby187/bin/rdebug-ide:19

@josevalim
Copy link
Contributor

Could you please isolate the error in a small application and push it to Github?

@inetufo
Copy link
Author

inetufo commented Jan 2, 2011

Hi, here is the repository

https://github.com/inetufo/test_devise

@clemens
Copy link

clemens commented Jan 3, 2011

I tried checking out a few revisions. It was introduced here: 379d8c6.

@clemens
Copy link

clemens commented Jan 3, 2011

Okay, the problem is that the :recall option is being passed. If I change the line as follows (not saying that it makes sense), it works again:

throw :warden, options.merge(:message => record.inactive_message).slice(:scope, :message, :store, :event)

Now I'm not sure about the details but it looks like this triggers the FailureApp (line 27) so the thrown warden doesn't ever get caught.

Should this work like it is or should it not? A quick fix would be to go back to the old version or exclude the :recall option from the passed options.

@josevalim
Copy link
Contributor

Don't pass options forward, this fixes uncaught warden error. Unfortunately could not write a test for it, although easily reproducible in Rails applications. Closed by 7ff0231

@siong1987
Copy link
Contributor

Can we reopen this issue? Is it caused by the :recall option?

I enabled this because :recall option is useful for Issue 675(https://github.com/plataformatec/devise/issues/closed#issue/675) so that confirmable/activable can be used via ajax.

@josevalim
Copy link
Contributor

I have thought more about the issue and I think the best way to achieve what described in this ticket would be by customizing the failure app.

@siong1987
Copy link
Contributor

So, should the :recall option be forwarded? If the :recall option is not forwarded, it will fail ajaxied login with activable/confirmable.

@josevalim
Copy link
Contributor

No. We should handle it in another way.

@siong1987
Copy link
Contributor

Okay. Do you have any idea in mind now? I can help to integrate it.

janx pushed a commit that referenced this issue Apr 19, 2011
…nately could not write a test for it, although easily reproducible in Rails applications. Closes #754
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants