AI plugin failing installation due to incompatibility with stable branch

Installation fails on a standard docker based setup:

I, [2023-04-29T06:34:51.363602 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
	83: from /usr/local/bin/bundle:25:in `<main>'
	82: from /usr/local/bin/bundle:25:in `load'
	81: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/exe/bundle:33:in `<top (required)>'
	80: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	79: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/exe/bundle:45:in `block in <top (required)>'
	78: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli.rb:28:in `start'
	77: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	76: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli.rb:34:in `dispatch'
	75: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	74: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	73: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	72: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli.rb:491:in `exec'
	71: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli/exec.rb:23:in `run'
	70: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli/exec.rb:58:in `kernel_load'
	69: from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli/exec.rb:58:in `load'
	68: from /var/www/discourse/vendor/bundle/ruby/3.2.0/bin/rake:25:in `<top (required)>'
	67: from /var/www/discourse/vendor/bundle/ruby/3.2.0/bin/rake:25:in `load'
	66: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
	65: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
	64: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
	63: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
	62: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
	61: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
	60: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
	59: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
	58: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
	57: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
	56: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
	55: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
	54: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
	53: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
	52: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
	51: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
	50: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
	49: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
	48: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
	47: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
	46: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
	45: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
	44: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
	43: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
	42: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
	41: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
	40: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
	39: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
	38: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
	37: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/application.rb:511:in `block in run_tasks_blocks'
	36: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/application.rb:348:in `require_environment!'
	35: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
	34: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	33: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	32: from /var/www/discourse/config/environment.rb:7:in `<main>'
	31: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/application.rb:372:in `initialize!'
	30: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:60:in `run_initializers'
	29: from /usr/local/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
	28: from /usr/local/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
	27: from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
	26: from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `call'
	25: from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each'
	24: from /usr/local/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
	23: from /usr/local/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
	22: from /usr/local/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	21: from /usr/local/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
	20: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:61:in `block in run_initializers'
	19: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:32:in `run'
	18: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:32:in `instance_exec'
	17: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/application/finisher.rb:87:in `block in <module:Finisher>'
	16: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:75:in `run_load_hooks'
	15: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:75:in `each'
	14: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:76:in `block in run_load_hooks'
	13: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
	12: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
	11: from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:92:in `block in execute_hook'
	10: from /var/www/discourse/config/application.rb:228:in `block in <class:Application>'
	9: from /var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
	8: from /var/www/discourse/config/application.rb:228:in `block (2 levels) in <class:Application>'
	7: from /var/www/discourse/config/application.rb:228:in `each'
	6: from /var/www/discourse/lib/plugin/instance.rb:501:in `notify_after_initialize'
	5: from /var/www/discourse/lib/plugin/instance.rb:501:in `each'
	4: from /var/www/discourse/lib/plugin/instance.rb:503:in `block in notify_after_initialize'
	3: from /var/www/discourse/plugins/discourse-ai/plugin.rb:52:in `block in activate!'
	2: from /var/www/discourse/plugins/discourse-ai/plugin.rb:52:in `each'
	1: from /var/www/discourse/plugins/discourse-ai/plugin.rb:54:in `block (2 levels) in activate!'
/var/www/discourse/plugins/discourse-ai/lib/modules/embeddings/entry_point.rb:28:in `inject_into': undefined method `register_modifier' for #<Plugin::Instance:0x00007fd445a7ddb8 @metadata=#<Plugin::Metadata:0x00007fd44591c370 @name="discourse-ai", @about="TODO", @version="0.0.1", @authors="Discourse", @url="TODO", @required_version="2.7.0">, @path="/var/www/discourse/plugins/discourse-ai/plugin.rb", @idx=0, @enabled_site_setting=:discourse_ai_enabled, @assets=[["/var/www/discourse/plugins/discourse-ai/assets/stylesheets/modules/ai-helper/common/ai-helper.scss", nil, "discourse-ai"], ["/var/www/discourse/plugins/discourse-ai/assets/stylesheets/modules/summarization/common/summarization.scss", nil, "discourse-ai"]], @directory_name="discourse-ai", @initializers=[#<Proc:0x00007fd4457ec1d0 /var/www/discourse/plugins/discourse-ai/plugin.rb:23>], @styles=[], @javascripts=[], @locales=[], @service_workers=[], @seed_data={}, @extra_js_file_path="/var/www/discourse/app/assets/javascripts/plugins/discourse-ai_extra.js.erb", @asset_filters=[], @before_auth_initializers=[], @before_auth_complete=true, @color_schemes=[]> (NoMethodError)

** INCOMPATIBLE PLUGIN **

You are unable to build Discourse due to errors in the plugin at
/var/www/discourse/plugins/discourse-ai

Please try removing this plugin and rebuilding again!
I, [2023-04-29T06:34:56.760568 #1]  INFO -- : gem install tokenizers -v 0.3.2 -i /var/www/discourse/plugins/discourse-ai/gems/3.2.2 --no-document --ignore-dependencies --no-user-install
Successfully installed tokenizers-0.3.2-x86_64-linux
1 gem installed
gem install iso8601 -v 0.13.0 -i /var/www/discourse/plugins/discourse-automation/gems/3.2.2 --no-document --ignore-dependencies --no-user-install
Successfully installed iso8601-0.13.0
1 gem installed
gem install rrule -v 0.4.4 -i /var/www/discourse/plugins/discourse-automation/gems/3.2.2 --no-document --ignore-dependencies --no-user-install
Successfully installed rrule-0.4.4
1 gem installed
gem install sentry-raven -v 3.0.0 -i /var/www/discourse/plugins/discourse-sentry/gems/3.2.2 --no-document --ignore-dependencies --no-user-install
Successfully installed sentry-raven-3.0.0
1 gem installed
gem install aws-sdk-translate -v 1.35.0 -i /var/www/discourse/plugins/discourse-translator/gems/3.2.2 --no-document --ignore-dependencies --no-user-install
Successfully installed aws-sdk-translate-1.35.0
1 gem installed



FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 2068 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1

Are you on the default tests-passed branch, or are you trying to install it using the stable version?

I was not aware of any setting here, just followed discourse/INSTALL-cloud.md at main · discourse/discourse · GitHub

In the admin UI it shows 3.0.3 (845000a6ce)

IDK if this is right or wrong :slight_smile:

Normally when you follow the standard install you would be on tests-passed, but it looks like you may have added in stable at some point.

But for this new plugin to work you would need to be on the latest version (or wait until sometime midyear for the new Stable release :slight_smile:)

You can set your version in the app.yml, though you can’t downgrade again to stable if you do change over.

I see - using this one: GitHub - aws-samples/aws-cdk-for-discourse: AWS CDK for Discourse

Thanks for the hint regarding the app.yml setting.

image

1 Like

I’m not familiar with that set-up method, so you may want to take a full backup of everything if you do want to make any adjustments. I’m afraid I’m not knowledgeable enough to know if there will be any other consequences to swopping your version.

(Though it’s probably good advice anyway :slight_smile:)

1 Like

Solution: make sure to use the tests-passed version.

Thanks for the great help.

2 Likes

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