8

I get suddenly the below error on my server with Authlogic

NoMethodError (undefined method `valid_password?' for #<ProductionHouse:0xb53859cc>):

authlogic (2.1.3) [v] lib/authlogic/session/password.rb:191:in `send'

authlogic (2.1.3) [v] lib/authlogic/session/password.rb:191:in `validate_by_password'

authlogic (2.1.3) [v] lib/authlogic/session/callbacks.rb:72:in `validate'

authlogic (2.1.3) [v] lib/authlogic/session/validation.rb:64:in `valid?'

authlogic (2.1.3) [v] lib/authlogic/session/existence.rb:65:in `save'

app/controllers/user_session_controller.rb:162:in `create'

pdfkit (0.5.1) lib/pdfkit/middleware.rb:16:in `call'

Cant get the issue sudden happen? Is there any one knows regarding this then please help?

Bolu
  • 8,696
  • 4
  • 38
  • 70
Chirag Shah
  • 509
  • 1
  • 10
  • 25

1 Answers1

4

I get this error if I start the web server (in my case Thin) before the database is available (in my case MySQL is not running for example).

I load up the app in my browser and it complains that MySQL is not running, so I start MySQL, return to the app which now loads correctly, but will not let me log in (I get the error described by the OP).

If I now go and restart the web server, and try again, I can log in without error.

Presumably valid_password? is a method that is added to the model at boot time, and is dependent on the database being available.

Mike Pollitt
  • 1,817
  • 16
  • 13