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

ArgumentError (wrong number of arguments (given 1, expected 0)) #616

Closed
iiNku opened this issue Apr 19, 2016 · 4 comments
Closed

ArgumentError (wrong number of arguments (given 1, expected 0)) #616

iiNku opened this issue Apr 19, 2016 · 4 comments

Comments

@iiNku
Copy link

iiNku commented Apr 19, 2016

Hello,

I try to register into my ruby on rails API using devise_token_auth.. When sending the confirmation email, there is this error coming :

ArgumentError (wrong number of arguments (given 1, expected 0)):

/usr/local/lib/ruby/gems/2.3.0/bundler/gems/devise-57d150e535f6/lib/devise/models/confirmable.rb:109:in `send_confirmation_instructions'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/devise_token_auth-6b00283da4ce/app/controllers/devise_token_auth/registrations_controller.rb:46:in `create'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/abstract_controller/base.rb:181:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal/rendering.rb:30:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:126:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:455:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:90:in `run_callbacks'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/abstract_controller/callbacks.rb:19:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal/rescue.rb:31:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/notifications.rb:164:in `block in instrument'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/notifications.rb:164:in `instrument'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activerecord/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/abstract_controller/base.rb:126:in `process'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal.rb:190:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_controller/metal.rb:262:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/routing/mapper.rb:17:in `block in <class:Constraints>'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/routing/mapper.rb:47:in `serve'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/journey/router.rb:39:in `block in serve'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/journey/router.rb:26:in `each'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/journey/router.rb:26:in `serve'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/routing/route_set.rb:739:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionview/lib/action_view/digestor.rb:12: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'
rack (2.0.0.alpha) lib/rack/etag.rb:25:in `call'
rack (2.0.0.alpha) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.0.alpha) lib/rack/head.rb:12:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activerecord/lib/active_record/migration.rb:558:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/callbacks.rb:90:in `run_callbacks'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/callbacks.rb:36:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/executor.rb:12:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/railties/lib/rails/rack/logger.rb:36:in `call_app'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/railties/lib/rails/rack/logger.rb:24:in `block in call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/tagged_logging.rb:70:in `block in tagged'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/tagged_logging.rb:26:in `tagged'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/tagged_logging.rb:70:in `tagged'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/railties/lib/rails/rack/logger.rb:24:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.0.alpha) lib/rack/runtime.rb:22:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/activesupport/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/executor.rb:12:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/actionpack/lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.0.alpha) lib/rack/sendfile.rb:111:in `call'
/usr/local/lib/ruby/gems/2.3.0/bundler/gems/rails-91798c75bc56/railties/lib/rails/engine.rb:522:in `call'
puma (3.4.0) lib/puma/configuration.rb:224:in `call'
puma (3.4.0) lib/puma/server.rb:569:in `handle_request'
puma (3.4.0) lib/puma/server.rb:406:in `process_client'
puma (3.4.0) lib/puma/server.rb:271:in `block in run'
puma (3.4.0) lib/puma/thread_pool.rb:114:in `block in spawn_thread'
Started POST "/[email protected]&password=[FILTERED]&password_confirmation=[FILTERED]" for ::1 at 2016-04-19 19:58:43 +0200
Processing by DeviseTokenAuth::RegistrationsController#create as */*
  Parameters: {"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}
Completed 422 Unprocessable Entity in 139ms (Views: 0.3ms | ActiveRecord: 0.0ms)

This is the request :

POST /[email protected]&amp;password=azertyuiop&amp;password_confirmation=azertyuiop&amp;confirm_success_url=timetocook.dev:3000 HTTP/1.1
Host: timetocook.dev:3000
Cache-Control: no-cache
Postman-Token: 9d156196-ff57-74bf-ce8f-9e12c59f0c31
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
@josemotanet
Copy link

I am also seeing this in a new app. Any idea what this can be?

@Drowze
Copy link

Drowze commented Jul 4, 2017

Same issue myself.

Digging into the issue, it seems to be the absence of include DeviseTokenAuth::Concerns::MODEL_NAME into the model.

As I am moving to my own implementation of jwt and only using Devise for signing up users, this is an issue to me.

@zachfeldman
Copy link
Contributor

Yup, you do need to include that concern it would seem to make things work (in my experience).

Going to close this issue for now.

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

No branches or pull requests

5 participants
@josemotanet @zachfeldman @iiNku @Drowze and others