I’m seeing similar errors on at least 2 different discourse installations. Does anyone have any idea what the following is about?
The most serious manifestation is when trying to post from the web interface, which fails with a 500 error. the rails/production.log has the following:
Started POST "/posts" for 212.139.89.48 at 2016-09-15 10:56:19 +0000 Processing by PostsController#create as JSON Parameters: {"raw"=>"If you are applying for a person over 18 and they need someone to accompany them on the bus you will need to get a letter from their Doctor stating that they cannot travel without support. That way they will be able to get a +1. If under 18 thats not a problem", "unlist_topic"=>"false", "category"=>"6", "topic_id"=>"1029", "is_warning"=>"false", "whisper"=>"false", "archetype"=>"regular", "typing_duration_msecs"=>"29600", "composer_open_duration_msecs"=>"123882", "reply_to_post_number"=>"1", "nested_post"=>"true"} Completed 500 Internal Server Error in 191ms (ActiveRecord: 2.5ms) NoMethodError (undefined method `staff?' for nil:NilClass) /var/www/discourse/lib/validators/post_validator.rb:94:in `unique_post_validator'
I also see another variant, which turns up in an email which is copied in the production.log file. The email contains a similar error, but this time with a backtrace:
Unrecognized error type (NoMethodError: undefined method `staff?’ for nil:NilClass) when processing incoming email
Backtrace:
/var/www/discourse/lib/validators/post_validator.rb:94:inunique_post_validator' /var/www/discourse/lib/validators/post_validator.rb:20:in
validate’
/var/www/discourse/lib/new_post_manager.rb:85:indefault_handler' /var/www/discourse/lib/new_post_manager.rb:133:in
call’
/var/www/discourse/lib/new_post_manager.rb:133:inblock in perform' /var/www/discourse/lib/new_post_manager.rb:132:in
any?’
/var/www/discourse/lib/new_post_manager.rb:132:inperform' /var/www/discourse/lib/email/receiver.rb:501:in
create_post’
/var/www/discourse/lib/email/receiver.rb:470:increate_post_with_attachments' /var/www/discourse/lib/email/receiver.rb:427:in
create_reply’
/var/www/discourse/lib/email/receiver.rb:348:inprocess_destination' /var/www/discourse/lib/email/receiver.rb:101:in
block in process_internal’
/var/www/discourse/lib/email/receiver.rb:99:inyield' /var/www/discourse/lib/email/receiver.rb:99:in
yield’
/var/www/discourse/lib/email/receiver.rb:99:ineach' /var/www/discourse/lib/email/receiver.rb:99:in
each’
/var/www/discourse/lib/email/receiver.rb:99:ineach' /var/www/discourse/lib/email/receiver.rb:99:in
each’
/var/www/discourse/lib/email/receiver.rb:99:ineach' /var/www/discourse/lib/email/receiver.rb:99:in
each’
/var/www/discourse/lib/email/receiver.rb:99:inprocess_internal' /var/www/discourse/lib/email/receiver.rb:43:in
process!’
/var/www/discourse/lib/email/processor.rb:17:inprocess!' /var/www/discourse/lib/email/processor.rb:11:in
process!’
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:25:inprocess_popmail' /var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:36:in
block (2 levels) in poll_pop3’
/usr/local/lib/ruby/2.3.0/net/pop.rb:689:inblock 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:indelete_all' /var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:35:in
block in poll_pop3’
/usr/local/lib/ruby/2.3.0/net/pop.rb:532:instart' /var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:34:in
poll_pop3’
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:16:inexecute' /var/www/discourse/app/jobs/base.rb:154:in
block (2 levels) in perform’