使用Heroku设计新会话问题

时间:2017-10-16 20:38:53

标签: ruby-on-rails heroku devise

我最近使用我的应用程序实现了载波,所以帖子可以有图片,但是当我尝试登录我的应用程序时遇到错误。以下是运行heroku logs

时的结果
    2017-10-16T20:14:41.944943+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:2149:in `do_delivery'
2017-10-16T20:14:41.944943+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `block in deliver'
2017-10-16T20:14:41.944944+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.1.4/lib/action_mailer/base.rb:558:in `block in deliver_mail'
2017-10-16T20:14:41.944944+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `block in instrument'
2017-10-16T20:14:41.944945+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
2017-10-16T20:14:41.944945+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `instrument'
2017-10-16T20:14:41.944945+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.1.4/lib/action_mailer/base.rb:556:in `deliver_mail'
2017-10-16T20:14:41.944946+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `deliver'
2017-10-16T20:14:41.944946+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.1.4/lib/action_mailer/message_delivery.rb:96:in `block in deliver_now'
2017-10-16T20:14:41.944947+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.1.4/lib/action_mailer/rescuable.rb:15:in `handle_exceptions'
2017-10-16T20:14:41.944947+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.1.4/lib/action_mailer/message_delivery.rb:95:in `deliver_now'
2017-10-16T20:14:41.944948+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/authenticatable.rb:191:in `send_devise_notification'
2017-10-16T20:14:41.944948+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/confirmable.rb:119:in `send_confirmation_instructions'
2017-10-16T20:14:41.944948+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/confirmable.rb:126:in `send_reconfirmation_instructions'
2017-10-16T20:14:41.944949+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
2017-10-16T20:14:41.944949+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:260:in `block in conditional'
2017-10-16T20:14:41.944950+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `block in invoke_after'
2017-10-16T20:14:41.944950+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `each'
2017-10-16T20:14:41.944951+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:132:in `run_callbacks'
2017-10-16T20:14:41.944950+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `invoke_after'
2017-10-16T20:14:41.944966+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_commit_callbacks'
2017-10-16T20:14:41.944967+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:343:in `committed!'
2017-10-16T20:14:41.944968+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:86:in `commit_records'
2017-10-16T20:14:41.944969+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:178:in `block in commit_transaction'
2017-10-16T20:14:41.944970+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:168:in `commit_transaction'
2017-10-16T20:14:41.944969+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/ruby-2.3.4/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
2017-10-16T20:14:41.944970+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:207:in `block in within_new_transaction'
2017-10-16T20:14:41.944971+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/ruby-2.3.4/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
2017-10-16T20:14:41.944972+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
2017-10-16T20:14:41.944972+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
2017-10-16T20:14:41.944973+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
2017-10-16T20:14:41.944974+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:308:in `block in save'
2017-10-16T20:14:41.944973+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
2017-10-16T20:14:41.944975+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:323:in `rollback_active_record_state!'
2017-10-16T20:14:41.944975+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:307:in `save'
2017-10-16T20:14:41.944976+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/suppressor.rb:42:in `save'
2017-10-16T20:14:41.944977+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/recoverable.rb:92:in `set_reset_password_token'
2017-10-16T20:14:41.944977+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/recoverable.rb:49:in `send_reset_password_instructions'
2017-10-16T20:14:41.944980+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:186:in `process_action'
2017-10-16T20:14:41.944978+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/recoverable.rb:134:in `send_reset_password_instructions'
2017-10-16T20:14:41.944980+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionpack-5.1.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
2017-10-16T20:14:41.944979+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/actionpack-5.1.4/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
2017-10-16T20:14:41.944978+00:00 app[web.1]: [4e6c03b3-5414-44a7-883b-b0ba34b62b6a] vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/app/controllers/devise/passwords_controller.rb:13:in `create'

我想知道我的错误是什么,或者是否有人指示我应该修复什么?我不知道如何解决这个问题。花了几个小时谷歌搜索,但没有发现任何类似的东西。

2 个答案:

答案 0 :(得分:1)

看起来问题是密码被更改了,而Devise想要发送电子邮件并且邮件存在问题

注册免费的heroku邮件插件,进行设置,配置设备以发送电子邮件,然后重新启动dyno

邮件问题

vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:2149:in `do_delivery'
vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `block in deliver'
vendor/bundle/ruby/2.3.0/gems/actionmailer-5.1.4/lib/action_mailer/base.rb:558:in `block in deliver_mail'

设计触发器

vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/lib/devise/models/recoverable.rb:134:in `send_reset_password_instructions'
vendor/bundle/ruby/2.3.0/gems/devise-4.3.0/app/controllers/devise/passwords_controller.rb:13:in `create'

答案 1 :(得分:0)

我最后只是重置整个数据库来修复它(我仍然在开发中工作,所以这不是什么大问题)。如果您在制作中遇到此问题,我建议您使用rails console手动重置用户的密码。这应该有助于解决问题。由于我的ISP阻止5000端口能够运行heroku run rails console,我也遇到了连接到Heroku的问题。