Narrative Bot not responding due to Mailing List Mode

discobot

(Joe Buhlig) #1

I’m pretty certain this isn’t a bug but it’s driving me nuts. If I do the following I get no responses from the bot:

I can verify that responding to the bot works for new users. There’s no issue there. But for some reason my admin account never triggers a reply from the bot. And I haven’t been able to locate an error anywhere in the console or in /logs.

I should also note that I have two other instances that I’ve tested this on and it works flawlessly. I’m simply at a loss for where to look next. Ideas?


Start narrative bot (discobot) for existing users
#2

Guildbot? :nerd:
I assume you changed the name of the bot.
Try re-name to discobot and try again


(Joe Buhlig) #3

Well, that was certainly something I missed trying. But no dice. I changed it back, tried to trigger display help, and still no response.


(Jeff Atwood) #4

Not sure @tgxworld would need to weigh in. Could be the rename but that is supported.


(cpradio) #5

Depending the version of Discourse/Narative Bot you are on, there was at one point a requirement of a rebuild for the rename to take effect. I know that requirement is no longer necessary, but maybe it was a timing thing and doing a rebuild would clear it up now?


(Tobias Eigen) #6

stupid question - did you disable public replies?


(Joe Buhlig) #7

I was operating on that assumption originally. I didn’t realize until later that it wasn’t required if I was on latest first. So I made the change and then ran a rebuild. It didn’t make any difference.

Good thing to check on for sure. :wink: I wish that had been it, but it’s not. Good call, though.


(Jeff Atwood) #8

If you did a bot rename on an old version you may have run into a bug; I suggest restarting the docker container to make sure all values are reloaded.


(Joe Buhlig) #9

Just tried a stop app and start app. No change there. Could there be a rate limiter involved here?


(Christoph) #10

I vaguely remember having had similar issues after renaming the bot and after some time (perhaps after I rebuilt?) it suddenly worked again. That was more than a month ago, though.


(Alan Tan) #11

There are a couple of things you can check.

What is the locale of the site/your user locale?
Do someone rename the trigger in site settings text customizations?


(Joe Buhlig) #12

Locales are both English.

I’ve not touched any text customizations. I’m the only admin on the site.

I did do a bit more digging and found a potential error that’s related. It didn’t seem relevant at the time and it still doesn’t add up to me why failing once would cause it to continue to fail. Either way, here’s the trace:

Job exception: RateLimiter::LimitExceeded

/var/www/discourse/lib/rate_limiter.rb:61:in `performed!'
/var/www/discourse/lib/rate_limiter/on_create_record.rb:42:in `block in rate_limit'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:446:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:446:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:228:in `block in halting_and_conditional'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:506:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:506:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:506:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_create_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:306:in `_create_record'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/timestamp.rb:57:in `_create_record'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/persistence.rb:504:in `create_or_update'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:302:in `block in create_or_update'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:117:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_save_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:302:in `create_or_update'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/persistence.rb:120:in `save'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/validations.rb:37:in `save'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block in save'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:285:in `save'
/var/www/discourse/lib/post_creator.rb:430:in `save_post'
/var/www/discourse/lib/post_creator.rb:143:in `block in create'
/var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
/var/www/discourse/lib/post_creator.rb:293:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
/var/www/discourse/lib/post_creator.rb:287:in `transaction'
/var/www/discourse/lib/post_creator.rb:140:in `create'
/var/www/discourse/lib/post_creator.rb:182:in `create!'
/var/www/discourse/lib/post_creator.rb:209:in `create!'
/var/www/discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb:119:in `init_tutorial_edit'
/var/www/discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb:189:in `init_state'
/var/www/discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb:49:in `block in input'
/var/www/discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb:375:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
/var/www/discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb:375:in `synchronize'
/var/www/discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb:15:in `input'
/var/www/discourse/plugins/discourse-narrative-bot/jobs/narrative_init.rb:8:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/i18n-0.8.1/lib/i18n.rb:257:in `with_locale'
/var/www/discourse/plugins/discourse-narrative-bot/jobs/narrative_init.rb:7:in `execute'
/var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'

(Joe Buhlig) #14

Thinking about this a bit further, would it make sense to manually trigger the NarrativeInit job? That seems to be where the beginning of that trace develops.


(Alan Tan) #15

@joebuhlig That trace was super helpful :slight_smile: . Can you try again? I’ve deployed the following fix


(Joe Buhlig) #16

Just gave it a try. No dice. :confused: I’m on 30f275. Is there a log file somewhere I can run through to see what’s going on when the trigger phrase is used? That’s the only thing I can think of right now since there are no errors. I’ve tried numerous ways of reproducing this and can’t get it done.


(Alan Tan) #17

Hmm can you try to trigger a job manually? Is the site we’re talking about feverbee?


(Joe Buhlig) #18

Ok. Here’s what I did.

  1. enter app and ran Jobs.enqueue(:narrative_init, user_id: 1, klass:DiscourseNarrativeBot::NewUserNarrative.to_s)
  2. I received the welcome message from the bot but bookmarking the message does nothing.
  3. I checked all my settings for the bot to make sure I didn’t miss something. Here’s what I have:
  4. I managed to find the log files on the server but nothing stands out as odd to me.
  5. No errors in console or /logs.

And the site in question is productivityguild.com


(Alan Tan) #19

Are you still the only user that is unable to interact with the bot? If not can you ensure that Sidekiq is running?


(Joe Buhlig) #20

It’s still just me. I can create a new user and it works fine. Sidekiq is running. That’s how I was able to manually trigger the job. :wink:


(Alan Tan) #21

Ah ha do you have mailing list mode enabled?