Can Anyone Resolve This Plugin Error?

Why is this plugin not working? I haven’t done much Ruby so it is written by ChatGPT.

If anyone can help fix it, please open a PR.
For reference, it should be using GitHub leereilly/swot gem for this.

Errors:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 650 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

Thank you!

That’s not the true error(s), please

3 Likes

I think this is the error earlier in the log:

Bundle complete! 142 Gemfile dependencies, 184 gems now installed.
Gems in the groups 'test' and 'development' were not installed.
Bundled gems are installed into `./vendor/bundle`

I, [2024-08-11T15:14:05.376148 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2024-08-11T15:14:10.843149 #1]  INFO -- : discourse-swot-validation is already at latest compatible version
docker_manager is already at latest compatible version

I, [2024-08-11T15:14:10.843914 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2024-08-11T15:14:10.846866 #1]  INFO -- : > sleep 10
646:C 11 Aug 2024 15:14:10.863 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
646:C 11 Aug 2024 15:14:10.863 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=646, just started
646:C 11 Aug 2024 15:14:10.863 # Configuration loaded
646:M 11 Aug 2024 15:14:10.864 * monotonic clock: POSIX clock_gettime
646:M 11 Aug 2024 15:14:10.865 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
646:M 11 Aug 2024 15:14:10.865 # Failed listening on port 6379 (TCP), aborting.
I, [2024-08-11T15:14:20.852454 #1]  INFO -- :
I, [2024-08-11T15:14:20.853397 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
LoadError: cannot load such file -- swot (LoadError)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
/var/www/discourse/plugins/discourse-swot-validation/plugin.rb:10:in `block in activate!'
/var/www/discourse/lib/plugin/instance.rb:604:in `block in notify_after_initialize'
/var/www/discourse/lib/plugin/instance.rb:602:in `each'
/var/www/discourse/lib/plugin/instance.rb:602:in `notify_after_initialize'
/var/www/discourse/config/application.rb:243:in `each'
/var/www/discourse/config/application.rb:243:in `block (2 levels) in <class:Application>'
/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
/var/www/discourse/config/application.rb:243:in `block in <class:Application>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:77:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application/finisher.rb:93:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:426:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:402:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:588:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'

I think the AI didn’t know how to get it to install swot, so plugin.rb isn’t proper? How can i fix this?

2 Likes

You can search for other plugins that add a gem. I believe there’s a topic here about it.

2 Likes

this topic might help you

4 Likes