Email notification error when replying to deleted reply?


(Martin Duparc) #1

I encountered a bug yesterday when trying to reply (via email) to a new message posted email notification.

Here is what I think happened:

  • User A creates topic.
  • User B posts reply.
  • User A gets email notification about user B’s reply.
  • User B deletes their reply (we were testing at that time)
  • User A replies to User B’s message via email.
  • Email fails to deliver (undefined method topic).

Discourse might get confused about the notification about a now deleted message.


(Matt Palmer) #2

A full backtrace of the error would help. What should happen is that the e-mail bounces with “this topic does not exist”, rather than an exception.


(Martin Duparc) #3

The logster logs were cleared :frowning: Is there another place these logs are saved?
I’ve looked in /var/discourse/shared/standalone/log but couldn’t see anything relating to the email notification error.


(Jeff Atwood) #4

See if you can repro using those steps?


(Martin Duparc) #5

I am not able to reproduce it but I was able to find a backtrace:

/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.7/lib/logster/logger.rb:93:in `add_with_opts'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.7/lib/logster/logger.rb:50:in `add'
/usr/local/lib/ruby/2.3.0/logger.rb:507:in `error'
/var/www/discourse/lib/email/processor.rb:72:in `handle_failure'
/var/www/discourse/lib/email/processor.rb:27:in `rescue in process!'
/var/www/discourse/lib/email/processor.rb:15:in `process!'
/var/www/discourse/lib/email/processor.rb:11:in `process!'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:25:in `process_popmail'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:43:in `block (2 levels) in poll_pop3'
/usr/local/lib/ruby/2.3.0/net/pop.rb:689:in `block in delete_all'
/usr/local/lib/ruby/2.3.0/net/pop.rb:688:in `each'
/usr/local/lib/ruby/2.3.0/net/pop.rb:688:in `delete_all'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:42:in `block in poll_pop3'
/usr/local/lib/ruby/2.3.0/net/pop.rb:532:in `start'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:41:in `poll_pop3'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:16:in `execute'
/var/www/discourse/app/jobs/base.rb:153:in `block (2 levels) in perform'

Right before the error, a warning was logged:

/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.7/lib/logster/logger.rb:93:in `add_with_opts'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.7/lib/logster/logger.rb:50:in `add'
/usr/local/lib/ruby/2.3.0/logger.rb:498:in `warn'
/var/www/discourse/lib/email/processor.rb:112:in `log_email_process_failure'
/var/www/discourse/lib/email/processor.rb:25:in `rescue in process!'
/var/www/discourse/lib/email/processor.rb:15:in `process!'
/var/www/discourse/lib/email/processor.rb:11:in `process!'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:25:in `process_popmail'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:43:in `block (2 levels) in poll_pop3'
/usr/local/lib/ruby/2.3.0/net/pop.rb:689:in `block in delete_all'
/usr/local/lib/ruby/2.3.0/net/pop.rb:688:in `each'
/usr/local/lib/ruby/2.3.0/net/pop.rb:688:in `delete_all'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:42:in `block in poll_pop3'
/usr/local/lib/ruby/2.3.0/net/pop.rb:532:in `start'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:41:in `poll_pop3'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:16:in `execute'
/var/www/discourse/app/jobs/base.rb:153:in `block (2 levels) in perform'