civio / quienmanda

Map of power relations in Spain. TheyRule meets Pinterest.
http://quienmanda.es
GNU Affero General Public License v3.0
40 stars 13 forks source link

No funciona la recuperación de contraseña #284

Open mgavilanes opened 7 years ago

mgavilanes commented 7 years ago

captura de pantalla 2017-03-13 a las 12 24 16

Mensaje de error al solicitar una contraseña nueva para un administrador.

dcabo commented 7 years ago

El error salta al intentar mandar el correo:

2017-03-13T11:41:41.799422+00:00 app[web.1]: Sent mail to miguel@civio.es (9.8ms)
2017-03-13T11:41:41.799640+00:00 app[web.1]: Completed 500 Internal Server Error in 36ms
2017-03-13T11:41:41.805350+00:00 app[web.1]: 
2017-03-13T11:41:41.805352+00:00 app[web.1]: Errno::ECONNREFUSED (Connection refused - connect(2)):
2017-03-13T11:41:41.805353+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/net/smtp.rb:541:in `initialize'
2017-03-13T11:41:41.805353+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/net/smtp.rb:541:in `open'
2017-03-13T11:41:41.805354+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/net/smtp.rb:541:in `tcp_socket'
2017-03-13T11:41:41.805354+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/net/smtp.rb:551:in `block in do_start'
2017-03-13T11:41:41.805355+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
2017-03-13T11:41:41.805356+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/net/smtp.rb:550:in `do_start'
2017-03-13T11:41:41.805356+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/net/smtp.rb:520:in `start'
2017-03-13T11:41:41.805357+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
2017-03-13T11:41:41.805358+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in `do_delivery'
2017-03-13T11:41:41.805359+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:232:in `block in deliver'

Así que debe de ser un tema de configuración de Heroku. No sé si esto funcionó en algún momento. ¿Llegamos a configurar un add-on para el correo?

dcabo commented 7 years ago

Como solución temporal para este caso particular he hecho:

$ heroku run rails console --app quienmanda
> User.where(email: 'miguel@civio.es')
> u = User.find(12)
> u.password='...'
> u.save