Failed to create channel in chat plugin

I got this:

[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (channels, line 0)
[Error] TypeError: undefined is not an object (evaluating 'e.jqXHR.responseJSON.errors[0]')
	o (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:1859)
	trigger (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4274)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4310:289)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4378:187)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4370:143)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4385:213)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4449)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4402:245)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:4451:122)
	(anonymous function) (discourse-dd32ad61cf639ec4d0b60cabb7b09ec6cd22e175bd8d0f7bf96d630634504baf.js:4171)
	l (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:200:124)
	fireWith (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:201:700)
	C (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:483:479)
	(anonymous function) (vendor-396a6dc0291c08f637411469e57020df3e74c2e6969e46ea9f3b4ab6e3974cd7.js:494:208)

Any ideas? Thank you!

Please check the logs at the /logs page for the 500 error and share the backtrace and message here.

1 Like

Here you are:

info

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_chat_channels_on_slug"
DETAIL:  Key (slug)=() already exists.
)
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
config/initializers/008-rack-cors.rb:24: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:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

backtrace

rack-mini-profiler (3.0.0) lib/patches/db/pg.rb:69:in `exec_params'
rack-mini-profiler (3.0.0) lib/patches/db/pg.rb:69:in `exec_params'
activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `block (2 levels) in exec_no_cache'
activesupport (7.0.3.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport (7.0.3.1) lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:767:in `block in exec_no_cache'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'
activesupport (7.0.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'
activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:766:in `exec_no_cache'
activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:745:in `execute_and_clear'
activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `exec_query'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:132:in `exec_insert'
activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:92:in `exec_insert'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:167:in `insert'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `insert'
activerecord (7.0.3.1) lib/active_record/persistence.rb:496:in `_insert_record'
activerecord (7.0.3.1) lib/active_record/persistence.rb:1096:in `_create_record'
activerecord (7.0.3.1) lib/active_record/counter_cache.rb:166:in `_create_record'
activerecord (7.0.3.1) lib/active_record/locking/optimistic.rb:79:in `_create_record'
activerecord (7.0.3.1) lib/active_record/attribute_methods/dirty.rb:222:in `_create_record'
activerecord (7.0.3.1) lib/active_record/callbacks.rb:461:in `block in _create_record'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:107:in `run_callbacks'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:929:in `_run_create_callbacks'
activerecord (7.0.3.1) lib/active_record/callbacks.rb:461:in `_create_record'
activerecord (7.0.3.1) lib/active_record/timestamp.rb:108:in `_create_record'
activerecord (7.0.3.1) lib/active_record/persistence.rb:1067:in `create_or_update'
activerecord (7.0.3.1) lib/active_record/callbacks.rb:457:in `block in create_or_update'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
activerecord (7.0.3.1) lib/active_record/autosave_association.rb:370:in `around_save_collection_association'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:138:in `run_callbacks'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:929:in `_run_save_callbacks'
activerecord (7.0.3.1) lib/active_record/callbacks.rb:457:in `create_or_update'
activerecord (7.0.3.1) lib/active_record/timestamp.rb:126:in `create_or_update'
activerecord (7.0.3.1) lib/active_record/persistence.rb:648:in `save!'
activerecord (7.0.3.1) lib/active_record/validations.rb:53:in `save!'
activerecord (7.0.3.1) lib/active_record/transactions.rb:302:in `block in save!'
activerecord (7.0.3.1) lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
activerecord (7.0.3.1) lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
activerecord (7.0.3.1) lib/active_record/transactions.rb:302:in `save!'
activerecord (7.0.3.1) lib/active_record/suppressor.rb:54:in `save!'
activerecord (7.0.3.1) lib/active_record/persistence.rb:55:in `create!'
plugins/chat/app/models/concerns/chatable.rb:11:in `create_chat_channel!'
plugins/chat/app/controllers/api/chat_channels_controller.rb:82:in `create'
actionpack (7.0.3.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.0.3.1) lib/abstract_controller/base.rb:215:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/rendering.rb:53:in `process_action'
actionpack (7.0.3.1) lib/abstract_controller/callbacks.rb:234:in `block in process_action'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
i18n (1.12.0) lib/i18n.rb:322:in `with_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:138:in `run_callbacks'
actionpack (7.0.3.1) lib/abstract_controller/callbacks.rb:233:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
activesupport (7.0.3.1) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.0.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (7.0.3.1) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.0.3.1) lib/action_controller/metal/instrumentation.rb:66:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
activerecord (7.0.3.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (7.0.3.1) lib/abstract_controller/base.rb:151:in `process'
actionview (7.0.3.1) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (3.0.0) lib/mini_profiler/profiling_methods.rb:85:in `block in profile_method'
actionpack (7.0.3.1) lib/action_controller/metal.rb:188:in `dispatch'
actionpack (7.0.3.1) lib/action_controller/metal.rb:251:in `dispatch'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:852:in `call'
railties (7.0.3.1) lib/rails/engine.rb:530:in `call'
railties (7.0.3.1) lib/rails/railtie.rb:226:in `public_send'
railties (7.0.3.1) lib/rails/railtie.rb:226:in `method_missing'
actionpack (7.0.3.1) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (7.0.3.1) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:852:in `call'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
rack (2.2.5) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.5) lib/rack/conditional_get.rb:40:in `call'
rack (2.2.5) lib/rack/head.rb:12:in `call'
actionpack (7.0.3.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:366:in `call'
config/initializers/008-rack-cors.rb:24:in `call'
rack (2.2.5) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.5) lib/rack/session/abstract/id.rb:260:in `call'
actionpa

info

Failed to handle exception in exception app middleware : ActiveRecord::RecordNotUnique : PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_chat_channels_on_slug"
DETAIL:  Key (slug)=() already exists.

backtrace

rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:69:in `exec_params'
rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:69:in `exec_params'
activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `block (2 levels) in exec_no_cache'
activesupport-7.0.3.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport-7.0.3.1/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:767:in `block in exec_no_cache'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'
activesupport-7.0.3.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'
activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:766:in `exec_no_cache'
activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:745:in `execute_and_clear'
activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `exec_query'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:132:in `exec_insert'
activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:92:in `exec_insert'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:167:in `insert'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `insert'
activerecord-7.0.3.1/lib/active_record/persistence.rb:496:in `_insert_record'
activerecord-7.0.3.1/lib/active_record/persistence.rb:1096:in `_create_record'
activerecord-7.0.3.1/lib/active_record/counter_cache.rb:166:in `_create_record'
activerecord-7.0.3.1/lib/active_record/locking/optimistic.rb:79:in `_create_record'
activerecord-7.0.3.1/lib/active_record/attribute_methods/dirty.rb:222:in `_create_record'
activerecord-7.0.3.1/lib/active_record/callbacks.rb:461:in `block in _create_record'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:107:in `run_callbacks'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:929:in `_run_create_callbacks'
activerecord-7.0.3.1/lib/active_record/callbacks.rb:461:in `_create_record'
activerecord-7.0.3.1/lib/active_record/timestamp.rb:108:in `_create_record'
activerecord-7.0.3.1/lib/active_record/persistence.rb:1067:in `create_or_update'
activerecord-7.0.3.1/lib/active_record/callbacks.rb:457:in `block in create_or_update'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
activerecord-7.0.3.1/lib/active_record/autosave_association.rb:370:in `around_save_collection_association'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:138:in `run_callbacks'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:929:in `_run_save_callbacks'
activerecord-7.0.3.1/lib/active_record/callbacks.rb:457:in `create_or_update'
activerecord-7.0.3.1/lib/active_record/timestamp.rb:126:in `create_or_update'
activerecord-7.0.3.1/lib/active_record/persistence.rb:648:in `save!'
activerecord-7.0.3.1/lib/active_record/validations.rb:53:in `save!'
activerecord-7.0.3.1/lib/active_record/transactions.rb:302:in `block in save!'
activerecord-7.0.3.1/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
activerecord-7.0.3.1/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
activerecord-7.0.3.1/lib/active_record/transactions.rb:302:in `save!'
activerecord-7.0.3.1/lib/active_record/suppressor.rb:54:in `save!'
activerecord-7.0.3.1/lib/active_record/persistence.rb:55:in `create!'
/var/www/discourse/plugins/chat/app/models/concerns/chatable.rb:11:in `create_chat_channel!'
/var/www/discourse/plugins/chat/app/controllers/api/chat_channels_controller.rb:82:in `create'
actionpack-7.0.3.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack-7.0.3.1/lib/abstract_controller/base.rb:215:in `process_action'
actionpack-7.0.3.1/lib/action_controller/metal/rendering.rb:53:in `process_action'
actionpack-7.0.3.1/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/var/www/discourse/app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
i18n-1.12.0/lib/i18n.rb:322:in `with_locale'
/var/www/discourse/app/controllers/application_controller.rb:414:in `with_resolved_locale'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:138:in `run_callbacks'
actionpack-7.0.3.1/lib/abstract_controller/callbacks.rb:233:in `process_action'
actionpack-7.0.3.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack-7.0.3.1/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
activesupport-7.0.3.1/lib/active_support/notifications.rb:206:in `block in instrument'
activesupport-7.0.3.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport-7.0.3.1/lib/active_support/notifications.rb:206:in `instrument'
actionpack-7.0.3.1/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
actionpack-7.0.3.1/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
activerecord-7.0.3.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack-7.0.3.1/lib/abstract_controller/base.rb:151:in `process'
actionview-7.0.3.1/lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler-3.0.0/lib/mini_profiler/profiling_methods.rb:85:in `block in profile_method'
actionpack-7.0.3.1/lib/action_controller/metal.rb:188:in `dispatch'
actionpack-7.0.3.1/lib/action_controller/metal.rb:251:in `dispatch'
actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:32:in `each'
actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:852:in `call'
railties-7.0.3.1/lib/rails/engine.rb:530:in `call'
railties-7.0.3.1/lib/rails/railtie.rb:226:in `public_send'
railties-7.0.3.1/lib/rails/railtie.rb:226:in `method_missing'
actionpack-7.0.3.1/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack-7.0.3.1/lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:32:in `each'
actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:852:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
rack-2.2.5/lib/rack/tempfile_reaper.rb:15:in `call'
rack-2.2.5/lib/rack/conditional_get.rb:40:in `call'
rack-2.2.5/lib/rack/head.rb:12:in `call'
actionpack-7.0.3.1/lib/action_dispatch/http/permissions_policy.rb:38:in `call'
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:366:in `call'
/var/www/discourse/config/initializers/008-rack-cors.rb:24:in `call'
rack-2.2.5/lib/rack/session/abstract/id.rb:266:in `context'
rack-2.2.5/lib/rack/session/abstract/id.rb:260:in `call'
actionpack-7.0.3.1/lib/action_dispatch/middleware/cookies.rb:697:in `call'
actionpack-7.0.3.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport-7.0.3.1/lib/active_support/callbacks.rb:99:in `run_callbacks'
actionpack-7.0.3.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
actionpack-7.0.3.1/lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
logster-2.11.3/lib/logster/middleware/reporter.rb:43:in `call'
railties-7.0.3.1/lib/rail

I met exactly the same errors.

We have empty slug because in plugins/chat/app/model/category_channel.rb:

def title(_ = nil)
  name.presence || category.name
end

def generate_auto_slug
  return if self.slug.present?
  self.slug = Slug.for(self.title.strip, "")
  self.slug = "" if duplicate_slug?
end

For me the title was β€œι—²θŠζ‰“ε±β€, clearly it is a CJK category name, and my SiteSettings slug_generation_method was none.

So for sure discourse (lib/slug.rb) will return β€œβ€ as the slug name.

try changing slug_generation_method SiteSettings to encoded.

I don’t know the side effects yet. because it is used by discourse everywhere.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.