Hello,
I set up pop polling using Gmail. Discourse fails to create new posts on some of the e-mails, not all.
I checked the logs and found the following error message and backtrace:
Unrecognized error type (NoMethodError: undefined method `>’ for nil:NilClass) when processing incoming email
Backtrace:
> /var/www/discourse/lib/topic_creator.rb:161:in `setup_tags'
> /var/www/discourse/lib/topic_creator.rb:37:in `create'
> /var/www/discourse/lib/post_creator.rb:406:in `create_topic'
> /var/www/discourse/lib/post_creator.rb:167:in `block in create'
> /var/www/discourse/lib/post_creator.rb:331:in `block in transaction'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:230:in `block in within_new_transaction'
> /usr/local/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:227:in `within_new_transaction'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in `transaction'
> /var/www/discourse/lib/post_creator.rb:330:in `transaction'
> /var/www/discourse/lib/post_creator.rb:165:in `create'
> /var/www/discourse/lib/new_post_manager.rb:204:in `perform_create_post'
> /var/www/discourse/lib/new_post_manager.rb:178:in `perform'
> /var/www/discourse/lib/email/receiver.rb:988:in `create_post'
> /var/www/discourse/lib/email/receiver.rb:895:in `create_post_with_attachments'
> /var/www/discourse/lib/email/receiver.rb:850:in `create_topic'
> /var/www/discourse/lib/email/receiver.rb:596:in `process_destination'
> /var/www/discourse/lib/email/receiver.rb:166:in `block in process_internal'
> /var/www/discourse/lib/email/receiver.rb:164:in `yield'
> /var/www/discourse/lib/email/receiver.rb:164:in `each'
> /var/www/discourse/lib/email/receiver.rb:164:in `each'
> /var/www/discourse/lib/email/receiver.rb:164:in `each'
> /var/www/discourse/lib/email/receiver.rb:164:in `each'
> /var/www/discourse/lib/email/receiver.rb:164:in `process_internal'
> /var/www/discourse/lib/email/receiver.rb:74:in `block in process!'
> /var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
> /var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
> /var/www/discourse/lib/email/receiver.rb:68:in `process!'
> /var/www/discourse/lib/email/processor.rb:18:in `process!'
> /var/www/discourse/lib/email/processor.rb:12: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.5.0/net/pop.rb:666:in `each'
> /usr/local/lib/ruby/2.5.0/net/pop.rb:666:in `each_mail'
> /var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:42:in `block in poll_pop3'
> /usr/local/lib/ruby/2.5.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:137:in `block (2 levels) in perform'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
> /var/www/discourse/app/jobs/base.rb:127:in `block in perform'
> /var/www/discourse/app/jobs/base.rb:123:in `each'
> /var/www/discourse/app/jobs/base.rb:123:in `perform'
> /var/www/discourse/app/jobs/base.rb:185:in `perform'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_scheduler-0.8.1/lib/mini_scheduler/manager.rb:81:in `process_queue'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_scheduler-0.8.1/lib/mini_scheduler/manager.rb:29:in `block in initialize'
I tried changing /var/www/discourse/lib/topic_creator.rb line 161 to
if category && !category.nil? && category.present? && category.minimum_required_tags > 0
and restarted unicorn. But the problem persists. It still displays the same message.