Bitnami Discourse 3.3.2 update error
Problem:
Do you get this error trying to update your Bitnami Discourse installation?
NameError: uninitialized constant ChatMessageSerializer::BasicUserWithStatusSerializer (NameError)
has_one :user, serializer: BasicUserWithStatusSerializer, embed: :objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean? BasicUserSerializer
/opt/bitnami/discourse/plugins/chat/app/serializers/chat_message_serializer.rb
Solution:
You can fix this error and finalize the upgrade process by removing your discourse/plugins/chat folder.
I had this issue for multiple discourse versions starting from Discourse 3.0.6
Here's the original full error, for better search visibility:
2024-10-13T22:59:45.777379755Z NameError: uninitialized constant ChatMessageSerializer::BasicUserWithStatusSerializer (NameError)
2024-10-13T22:59:45.777390101Z
2024-10-13T22:59:45.777393022Z has_one :user, serializer: BasicUserWithStatusSerializer, embed: :objects
2024-10-13T22:59:45.777395660Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-13T22:59:45.777398201Z Did you mean? BasicUserSerializer
2024-10-13T22:59:45.777505254Z /opt/bitnami/discourse/plugins/chat/app/serializers/chat_message_serializer.rb:18:in `class:ChatMessageSerializer'
2024-10-13T22:59:45.777512294Z /opt/bitnami/discourse/plugins/chat/app/serializers/chat_message_serializer.rb:3:in `
'
2024-10-13T22:59:45.777515256Z /opt/bitnami/discourse/plugins/chat/plugin.rb:150:in `load'
2024-10-13T22:59:45.777517718Z /opt/bitnami/discourse/plugins/chat/plugin.rb:150:in `block in activate!'
2024-10-13T22:59:45.777526911Z /opt/bitnami/discourse/lib/plugin/instance.rb:588:in `block in notify_after_initialize'
2024-10-13T22:59:45.777529316Z /opt/bitnami/discourse/lib/plugin/instance.rb:586:in `each'
2024-10-13T22:59:45.777531516Z /opt/bitnami/discourse/lib/plugin/instance.rb:586:in `notify_after_initialize'
2024-10-13T22:59:45.777533724Z /opt/bitnami/discourse/config/application.rb:243:in `each'
2024-10-13T22:59:45.777535903Z /opt/bitnami/discourse/config/application.rb:243:in `block (2 levels) in class:Application'
2024-10-13T22:59:45.777538214Z /opt/bitnami/discourse/lib/plugin.rb:6:in `initialization_guard'
2024-10-13T22:59:45.777540403Z /opt/bitnami/discourse/config/application.rb:243:in `block in class:Application'
2024-10-13T22:59:45.777542777Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
2024-10-13T22:59:45.777545110Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
2024-10-13T22:59:45.777547466Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
2024-10-13T22:59:45.777549781Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
2024-10-13T22:59:45.777552095Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:77:in `each'
2024-10-13T22:59:45.777554348Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
2024-10-13T22:59:45.777556588Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/application/finisher.rb:93:in `block in module:Finisher'
2024-10-13T22:59:45.777558937Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `instance_exec'
2024-10-13T22:59:45.777561652Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `run'
2024-10-13T22:59:45.777563927Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
2024-10-13T22:59:45.777566437Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:60:in `run_initializers'
2024-10-13T22:59:45.777568702Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/application.rb:426:in `initialize!'
2024-10-13T22:59:45.777570940Z /opt/bitnami/discourse/config/environment.rb:7:in `'
2024-10-13T22:59:45.777573234Z internal:/opt/bitnami/ruby/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb:37:in `require'
2024-10-13T22:59:45.777575543Z internal:/opt/bitnami/ruby/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb:37:in `require'
2024-10-13T22:59:45.777577876Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2024-10-13T22:59:45.777582298Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.16/lib/zeitwerk/kernel.rb:34:in `require'
2024-10-13T22:59:45.777584625Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/application.rb:402:in `require_environment!'
2024-10-13T22:59:45.777586839Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/application.rb:588:in `block in run_tasks_blocks'
2024-10-13T22:59:45.777589070Z /opt/bitnami/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
2024-10-13T22:59:45.777591442Z /opt/bitnami/ruby/bin/bundle:25:in `load'
2024-10-13T22:59:45.777593605Z /opt/bitnami/ruby/bin/bundle:25:in `'
2024-10-13T22:59:45.777595780Z Tasks: TOP => db:migrate => db:load_config => environment
2024-10-13T22:59:45.777598076Z (See full trace by running task with --trace)