New user responding to invite fails, word_watcher.rb:258:in `censor_text_with_regexp'

kgrier
Fri, 29 Aug 2025 16:48:46 +0000
Bug

Hey Discoursers,

I have report from forum member of invited user being unable to complete registratio . Have confirmed. Repro is easy, just send invite to specific user, they enter desire username, password, name, check “accept tos”, hit “accept invitation” button which greys, then nada. Logs appear to show the process is failing in the watch_words censor function. Here’s what I see. Regex option is not selected in Watch Words, no changes have been made in watch_words for many months.

Assistance will be appreciated. - Kirk

Message (13 copies reported)

NoMethodError (undefined method `gsub' for true)
app/services/word_watcher.rb:258:in `censor_text_with_regexp'
app/services/word_watcher.rb:146:in `block in censor_text'
app/services/word_watcher.rb:146:in `each'
app/services/word_watcher.rb:146:in `inject'
app/services/word_watcher.rb:146:in `censor_text'
app/models/user.rb:1612:in `block in apply_watched_words'
app/models/user.rb:1611:in `each'
app/models/user.rb:1611:in `apply_watched_words'
app/models/invite_redeemer.rb:156:in `create_user_from_invite'
app/models/invite_redeemer.rb:220:in `invited_user'
app/models/invite_redeemer.rb:277:in `add_user_to_groups'
app/models/invite_redeemer.rb:238:in `process_invitation'
app/models/invite_redeemer.rb:56:in `block in redeem'
app/models/invite_redeemer.rb:54:in `redeem'
app/models/invite.rb:239:in `redeem'
app/controllers/invites_controller.rb:376:in `perform_accept_invitation'
app/controllers/application_controller.rb:428:in `block in with_resolved_locale'
app/controllers/application_controller.rb:428:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:35:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:415:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:26:in `call'
lib/middleware/default_headers.rb:13:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/processing_request.rb:12:in `call'
lib/middleware/request_tracker.rb:410:in `call'

Backtrace

app/services/word_watcher.rb:258:in `censor_text_with_regexp'
app/services/word_watcher.rb:146:in `block in censor_text'
app/services/word_watcher.rb:146:in `each'
app/services/word_watcher.rb:146:in `inject'
app/services/word_watcher.rb:146:in `censor_text'
app/models/user.rb:1612:in `block in apply_watched_words'
app/models/user.rb:1611:in `each'
app/models/user.rb:1611:in `apply_watched_words'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:361:in `block in make_lambda'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:178:in `block in call'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:668:in `block (2 levels) in default_terminator'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:667:in `catch'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:667:in `block in default_terminator'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:179:in `call'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:559:in `block in invoke_before'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:559:in `each'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:559:in `invoke_before'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:140:in `run_callbacks'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:913:in `_run_save_callbacks'
activerecord (8.0.2.1) lib/active_record/callbacks.rb:441:in `create_or_update'
activerecord (8.0.2.1) lib/active_record/timestamp.rb:127:in `create_or_update'
activerecord (8.0.2.1) lib/active_record/persistence.rb:424:in `save!'
activerecord (8.0.2.1) lib/active_record/validations.rb:54:in `save!'
activerecord (8.0.2.1) lib/active_record/transactions.rb:365:in `block in save!'
activerecord (8.0.2.1) lib/active_record/transactions.rb:417:in `block (2 levels) in with_transaction_returning_status'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/database_statements.rb:357:in `transaction'
activerecord (8.0.2.1) lib/active_record/transactions.rb:413:in `block in with_transaction_returning_status'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:412:in `with_connection'
activerecord (8.0.2.1) lib/active_record/connection_handling.rb:310:in `with_connection'
activerecord (8.0.2.1) lib/active_record/transactions.rb:409:in `with_transaction_returning_status'
activerecord (8.0.2.1) lib/active_record/transactions.rb:365:in `save!'
activerecord (8.0.2.1) lib/active_record/suppressor.rb:56:in `save!'
app/models/invite_redeemer.rb:156:in `create_user_from_invite'
app/models/invite_redeemer.rb:220:in `invited_user'
app/models/invite_redeemer.rb:277:in `add_user_to_groups'
app/models/invite_redeemer.rb:238:in `process_invitation'
app/models/invite_redeemer.rb:56:in `block in redeem'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/transaction.rb:626:in `block in within_new_transaction'
activesupport (8.0.2.1) lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/transaction.rb:623:in `within_new_transaction'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/database_statements.rb:367:in `within_new_transaction'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/database_statements.rb:359:in `transaction'
activerecord (8.0.2.1) lib/active_record/transactions.rb:233:in `block in transaction'
activerecord (8.0.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:418:in `with_connection'
activerecord (8.0.2.1) lib/active_record/connection_handling.rb:310:in `with_connection'
activerecord (8.0.2.1) lib/active_record/transactions.rb:232:in `transaction'
app/models/invite_redeemer.rb:54:in `redeem'
app/models/invite.rb:239:in `redeem'
app/controllers/invites_controller.rb:376:in `perform_accept_invitation'
actionpack (8.0.2.1) lib/action_controller/metal/basic_implicit_render.rb:8:in `send_action'
actionpack (8.0.2.1) lib/abstract_controller/base.rb:226:in `process_action'
actionpack (8.0.2.1) lib/action_controller/metal/rendering.rb:193:in `process_action'
actionpack (8.0.2.1) lib/abstract_controller/callbacks.rb:261:in `block in process_action'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:120:in `block in run_callbacks'
app/controllers/application_controller.rb:428:in `block in with_resolved_locale'
i18n (1.14.7) lib/i18n.rb:353:in `with_locale'
app/controllers/application_controller.rb:428:in `with_resolved_locale'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:129:in `block in run_callbacks'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:140:in `run_callbacks'
actionpack (8.0.2.1) lib/abstract_controller/callbacks.rb:260:in `process_action'
actionpack (8.0.2.1) lib/action_controller/metal/rescue.rb:27:in `process_action'
actionpack (8.0.2.1) lib/action_controller/metal/instrumentation.rb:76:in `block in process_action'
activesupport (8.0.2.1) lib/active_support/notifications.rb:210:in `block in instrument'
activesupport (8.0.2.1) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
activesupport (8.0.2.1) lib/active_support/notifications.rb:210:in `instrument'
actionpack (8.0.2.1) lib/action_controller/metal/instrumentation.rb:75:in `process_action'
actionpack (8.0.2.1) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
activerecord (8.0.2.1) lib/active_record/railties/controller_runtime.rb:39:in `process_action'
actionpack (8.0.2.1) lib/abstract_controller/base.rb:163:in `process'
actionview (8.0.2.1) lib/action_view/rendering.rb:40:in `process'
rack-mini-profiler (4.0.1) lib/mini_profiler/profiling_methods.rb:90:in `block in profile_method'
actionpack (8.0.2.1) lib/action_controller/metal.rb:252:in `dispatch'
actionpack (8.0.2.1) lib/action_controller/metal.rb:335:in `dispatch'
actionpack (8.0.2.1) lib/action_dispatch/routing/route_set.rb:67:in `dispatch'
actionpack (8.0.2.1) lib/action_dispatch/routing/route_set.rb:50:in `serve'
actionpack (8.0.2.1) lib/action_dispatch/journey/router.rb:53:in `block in serve'
actionpack (8.0.2.1) lib/action_dispatch/journey/router.rb:133:in `block in find_routes'
actionpack (8.0.2.1) lib/action_dispatch/journey/router.rb:126:in `each'
actionpack (8.0.2.1) lib/action_dispatch/journey/router.rb:126:in `find_routes'
actionpack (8.0.2.1) lib/action_dispatch/journey/router.rb:34:in `serve'
actionpack (8.0.2.1) lib/action_dispatch/routing/route_set.rb:908:in `call'
lib/middleware/omniauth_bypass_middleware.rb:35:in `call'
rack (2.2.17) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.17) lib/rack/conditional_get.rb:40:in `call'
rack (2.2.17) lib/rack/head.rb:12:in `call'
actionpack (8.0.2.1) lib/action_dispatch/http/permissions_policy.rb:38:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:415:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:26:in `call'
rack (2.2.17) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.17) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (8.0.2.1) lib/action_dispatch/middleware/cookies.rb:706:in `call'
actionpack (8.0.2.1) lib/action_dispatch/middleware/callbacks.rb:31:in `block in call'
activesupport (8.0.2.1) lib/active_support/callbacks.rb:100:in `run_callbacks'
actionpack (8.0.2.1) lib/action_dispatch/middleware/callbacks.rb:30:in `call'
actionpack (8.0.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:31:in `call'
actionpack (8.0.2.1) lib/action_dispatch/middleware/show_exceptions.rb:32:in `call'
logster (2.20.1) lib/logster/middleware/reporter.rb:40:in `call'
lib/middleware/default_headers.rb:13:in `call'
railties (8.0.2.1) lib/rails/rack/logger.rb:41:in `call_app'
railties (8.0.2.1) lib/rails/rack/logger.rb:29:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
actionpack (8.0.2.1) lib/action_dispatch/middleware/request_id.rb:34:in

Env

HTTP HOSTS: discourse.bsh.zone

18 messaggi - 7 partecipanti