A
A
Alexander Petrov2016-04-28 11:46:19
Ruby on Rails
Alexander Petrov, 2016-04-28 11:46:19

How to recover password on devise?

I don't understand why password recovery doesn't work. I'm still having a hard time setting up mail for ruby ​​on rails, so I don't understand where to dig.
In general, I did it in produciton.rb as it says in the documentation: config.action_mailer.default_url_options = { :host => 'mysite.ru' }
I uploaded it to the server, I send it, it gives such an error. Here are the logs:
App 1153 stderr: Started POST "/users/password" for 109.172.53.212 at 2016-04-28 11:38:09 +0300
App 1153 stderr: Processing by Devise::PasswordsController#create as HTML
App 1153 stderr: Parameters: {"utf8"=>"✓", "authenticity_token"=>"ZMzSTdUwK+KbGJXt7SCRZOb+hDEIevPtwrwy5iWmcCgZOGPEmz3f3VZniFxfMsjU4Nlz4OejDwvNuNdp3ahrCw==", "user"=>{"email"=>"
App 1153 stderr: [1m[36mUser Load (0.4ms)[0m [1mSELECT `users`.* FROM `users` WHERE `users`.`email` = '[email protected]' ORDER BY `users`.`id `ASC LIMIT 1 [0m
App 1153 stderr: [1m [35mUser Load ( 0.4ms) [0m SELECT` users` * FROM `users` WHERE` users`.`reset_password_token` = 'e71c32cd9f651c74210021e341943f3c18fd5cea5c1a2ea53f2dc907385636d5' ORDER BY `users`.`. id` ASC LIMIT 1
App 1153 stderr: [1m [36m (0.1ms) [0m [1mBEGIN [0m
App 1153 stderr: [1m [35mSQL (0.5ms ) [0m UPDATE `users` SET` reset_password_token` = 'e71c32cd9f651c74210021e341943f3c18fd5cea5c1a2ea53f2dc907385636d5', `reset_password_sent_at` = '2016-04-28 08:38:11', `updated_at` = '2016-04-28 08:38:11' WHERE `users`.`id` = 0
App 1153 stderr: [1m[ 36m (6.9ms)[0m [1mCOMMIT[0m
App 1153 stderr: Rendered devise/mailer/reset_password_instructions.html.haml (8.8ms)
App 1153 stderr:
App 1153 stderr: Devise::Mailer#reset_password_instructions: processed outbound mail in 620.7ms
App 1153 stderr:
App 1153 stderr: Sent mail to [email protected] (82.0ms)
App 1153 stderr: Date: Thu, 28 Apr 2016 11:38:12 +0300
App 1153 stderr: From: please-chan[email protected]
App 1153 stderr: Reply-To: [email protected]
App 1153 stderr: To: [email protected]
App 1153 stderr: Message-ID: <[email protected] >
App 1153 stderr: Subject: Reset password instructions
App 1153 stderr: Mime-Version: 1.0
App 1153 stderr: Content-Type: text/html;
App 1153 stderr: charset=UTF-8
App 1153 stderr: Content-Transfer-Encoding: 7bit
App 1153 stderr:
App 1153 stderr:
App 1153 stderr: Hello [email protected]!
App 1153 stderr:
App 1153 stderr: Someone has requested a link to change your password. You can do this through the link below.
App 1153 stderr: Change my password
App 1153 stderr: If you didn't request this, please ignore this email.
App 1153 stderr: Your password won't change until you access the link above and create a new one.
App 1153 stderr:
App 1153 stderr: Completed 500 Internal Server Error in 2613ms (ActiveRecord: 9.7ms)
App 1153 stderr:
App 1153 stderr: OpenSSL::SSL::SSLError (hostname "localhost" does not match the server certificate):
App 1153 stderr: / usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/openssl/ssl.rb:178:in `post_connection_check'
App 1153 stderr: /usr/local/rvm/rubies/ruby -2.0.0-p643/lib/ruby/2.0.0/net/smtp.rb:588:in `tlsconnect'
App 1153 stderr: /usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ ruby/2.0.0/net/smtp.rb:563:in `do_start'
App 1153 stderr: /usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/net/smtp .rb:520:in `start'
App 1153 stderr: mail (2.6.3) lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
App 1153 stderr: mail (2.6.3) lib/mail/message.rb:2141:in `do_delivery'
App 1153 stderr: mail (2.6.3) lib/mail/message.rb:236:in `block in deliver'
App 1153 stderr: actionmailer (4.2.5.1) lib/action_mailer/base.rb:543:in `block in deliver_mail'
App 1153 stderr: activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `block in instrument'
App 1153 stderr: activesupport (4.2.5.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
App 1153 stderr: activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in ` instrument'
App 1153 stderr: actionmailer (4.2.5.1) lib/action_mailer/base.rb:541:in `deliver_mail'
App 1153 stderr: mail (2.6.3) lib/mail/message.rb:236:in `deliver'
App 1153 stderr: actionmailer (4.2.5.1) lib/action_mailer/message_delivery.rb:85:in `deliver_now'
App 1153 stderr: devise (3.5.2) lib/devise/models/authenticatable.rb:170:in `send_devise_notification'
App 1153 stderr: devise (3.5.2) lib/devise/models/recoverable.rb:111:in `send_reset_password_instructions_notification'
App 1153 stderr: devise (3.5.2) lib/devise/models/recoverable.rb:64:in ` send_reset_password_instructions'
App 1153 stderr: devise (3.5.2) lib/devise/models/recoverable.rb:128:in `send_reset_password_instructions'
App 1153 stderr: devise (3.5.2) app/controllers/devise/passwords_controller.rb:13: in `create'
App 1153 stderr: actionpack (4.2.5.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
App 1153 stderr: actionpack (4.2.5.1) lib/abstract_controller/base.rb:198:in `process_action'
App 1153 stderr: actionpack (4.2.5.1) lib/action_controller/metal/rendering.rb:10:in `process_action'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
TyzhSysAdmin, 2016-04-28
@POS_troi

The reason for the error is indicated in this line of the log
Without rail and dev environment configs, it's useless to guess.

A
Andrey Andreev, 2016-04-28
@b0nn1e

1. Correctly highlight the error from the log.
You have this:
2. In Google for this error, we get the first link:
www.nico.schottelius.org/blog/ruby-on-rails-fix-ho...

A
Alexander Petrov, 2016-04-28
@Mirkom63

Set up google settings.
config.action_mailer.delivery_method = :smtp
# SMTP settings for gmail
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => '[email protected]',
:password => 'password',
:authentication => "plain",
:enable_starttls_auto => true
}
gives this error now:
App 10376 stderr: Net::SMTPAuthenticationError (534-5.7.14

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question