SystemStackError with Devise :confirmable #753

Closed
srpouyet opened this Issue Nov 15, 2012 · 7 comments

2 participants

@srpouyet

I've encountered a very strange exception with Devise in Pry:

I have a User Model with Devise :confirmable enabled:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :confirmable

# user methods etc

end

Except for adding mailer.html.slim and mailer.text.slim in layouts/devise, I haven't changed the default Devise :confirmable configuration.

Now when I do this in pry:

[6] pry(main)> u = User.create(email: "john@doe.com", 
first_name: "John", last_name: "Doe", password: "supersecret", password_confirmation: "supersecret")
   (0.1ms)  begin transaction
  User Exists (0.2ms)  SELECT 1 AS one FROM "users" WHERE "users"."email" = 'john@doe.com' LIMIT 1
  User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'YqeHW79uzDmfeSy9cxMB' LIMIT 1
   (0.2ms)  rollback transaction
SystemStackError: stack level too deep
from /Users/sebastiaan/.rbenv/versions/1.9.3-p194-perf/lib/ruby/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:275

cat --ex 0 gives me:

Exception: SystemStackError: stack level too deep

From: /Users/sebastiaan/.rbenv/versions/1.9.3-p194-perf/lib/ruby/gems/1.9.1/
gems/pry-0.9.10/lib/pry/pry_instance.rb @ line 275 @ level: 0 of backtrace (of 0).

    270: 
    271:     code = r(target)
    272: 
    273:     exec_hook :before_eval, code, self
    274: 
 => 275:     result = target.eval(code, Pry.eval_path, Pry.current_line)
    276:     set_last_result(result, target, code)
    277: 
    278:     result
    279:   rescue RescuableException => e
    280:     self.last_exception = e

When I do the same in irb, the user is saved normally, and in my passenger instance user sign up is working as well without any problems.

Also without :confirmable Pry doesn't act up.

Any pointers on what's going on here this would be greatly appreciated!
I haven't got the faintest clue what's causing this error...

Cheers,
Sebastiaan

@ghost

Typically a backtrace like this shows that the error is within your code. It blows up on eval(…), that's when we're executing your input. It could be something else, though, because as you say it works in IRB & Heroku. Do you have a small reproduction case hanging around that we could use?

@ghost

Reproducible case:

[4] pry(main)> def foo                                                                            
[4] pry(main)*   foo                                                                              
[4] pry(main)* end                                                                            
=> nil
[5] pry(main)> foo                                                                       
SystemStackError: stack level too deep
from /Users/rob/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:325
[6] pry(main)> 
@ghost

From the backtrace, though, it looks like we blow up somewhere else in the above example.

@kyrylo
pry member

@serepo, ping.

@srpouyet

Hi @kyrylo, my daughter was born last week, so I've been busy with 🍼 I don't expect to have time to investigate for the foreseeable future... also it could have been an issue with my 1.9.3 + performance patches installation. You (or I) can close this if you want to, I'll reopen if necessary once I get around to coding again :)

Cheers!

@kyrylo
pry member

I'm wishing you and your family all the very best.

@kyrylo kyrylo closed this Dec 2, 2012
@ghost

Congrats @serepo !

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