Discourse AI plugin failing container rebuilds/bootstrappings

Today I tried to update thru UI/One Click upgrade. It failed.
Currently I’m on: 3.4.0.beta1-dev (65895f44e9)

  • I tried to rebuild the web_only container, but it failed too, and succeeds only when I disable Discourse AI plugin from my Web_only yml file.

  • I’m on ‘Tests-Passed’ build (I always was, didn’t change in recent past).

  • When I run this command:

./launcher enter app
LOAD_PLUGINS=1 bundle exec rake db:migrate

I get this result:

root@cx32-i4s-8gb-80gb-helsinki-frm-sshot-web-only:/var/www/discourse# LOAD_PLUGINS=1 bundle exec rake db:migrate
fatal: detected dubious ownership in repository at '/var/www/discourse'
To add an exception for this directory, call:

        git config --global --add safe.directory /var/www/discourse
  • I did update (and upgrade) my ubunut 22.04 this morning, in normal ways which we all do, with sudo apt command.
  • I’ve also tried my commenting out the MaxMind License key, but still fails.

I’m getting this error msg in the console:

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 868 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.

Logs screenshot:

I’m a little confused by some of the details. You say you have a web_only yml file, which suggests you have a two-container setup, but then you run /launcher enter app which indicates you have a single container install. (I’m also not sure why you’re running LOAD_PLUGINS=1 bundle exec rake db:migrate?)

Also, you reference discourse-ai but your logs have lots of errors for Chatbot instead.

1 Like

I mistakenly may have typed rebuild app. I do have 2 container setup.

But I failed to find this, where did I type/write ‘rebuild app’?

Sorry, you wrote ./launcher enter app:

Do you have more of the tail of the logs? (the bit above where it asks you to scroll up for more detail)

1 Like

Could it be actually this:

3 Likes
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `with_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/postgres/connection.rb:181:in `exec'
/var/www/discourse/plugins/discourse-ai/db/migrate/20240611170904_upgrade_pgvector_070.rb:10:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:989:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:989:in `exec_migration'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:970:in `block (2 levels) in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:969:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:227:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:968:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1178:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1529:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1580:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1528:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1503:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1503:in `migrate_without_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1448:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1600:in `with_advisory_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1448:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1274:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1249:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/tasks/database_tasks.rb:243:in `migrate'
/var/www/discourse/lib/tasks/db.rake:259:in `block (2 levels) in <main>'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/lib/tasks/db.rake:234:in `block in <main>'
/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>'

Caused by:
PG::InsufficientPrivilege: ERROR:  must be owner of extension vector (PG::InsufficientPrivilege)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-profiler-3.3.1/lib/patches/db/pg.rb:110:in `exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-profiler-3.3.1/lib/patches/db/pg.rb:110:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/postgres/connection.rb:202:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `block in with_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `with_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.5.0/lib/mini_sql/postgres/connection.rb:181:in `exec'
/var/www/discourse/plugins/discourse-ai/db/migrate/20240611170904_upgrade_pgvector_070.rb:10:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:989:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:989:in `exec_migration'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:970:in `block (2 levels) in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:969:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:227:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:968:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1178:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1529:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1580:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1528:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1503:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1503:in `migrate_without_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1448:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1600:in `with_advisory_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1448:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1274:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/migration.rb:1249:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/tasks/database_tasks.rb:243:in `migrate'
/var/www/discourse/lib/tasks/db.rake:259:in `block (2 levels) in <main>'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/lib/tasks/db.rake:234:in `block in <main>'
/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>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I, [2024-08-09T11:00:23.759679 #1]  INFO -- : gem install multipart-post -v 2.4.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed multipart-post-2.4.0
1 gem installed
gem install faraday-multipart -v 1.0.4 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed faraday-multipart-1.0.4
1 gem installed
gem install event_stream_parser -v 1.0.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed event_stream_parser-1.0.0
1 gem installed
gem install ruby-openai -v 7.0.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed ruby-openai-7.0.0
1 gem installed
gem install tokenizers -v 0.4.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed tokenizers-0.4.4-x86_64-linux
1 gem installed
gem install tiktoken_ruby -v 0.0.9 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed tiktoken_ruby-0.0.9-x86_64-linux
1 gem installed
gem install multipart-post -v 2.4.0 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed multipart-post-2.4.0
1 gem installed
gem install faraday-multipart -v 1.0.4 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed faraday-multipart-1.0.4
1 gem installed
gem install event_stream_parser -v 1.0.0 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed event_stream_parser-1.0.0
1 gem installed
gem install ruby-openai -v 7.0.0 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed ruby-openai-7.0.0
1 gem installed
gem install google_search_results -v 2.2.0 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed google_search_results-2.2.0
1 gem installed
gem install wikipedia-client -v 1.17.0 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed wikipedia-client-1.17.0
1 gem installed
gem install childprocess -v 5.0.0 -i /var/www/discourse/plugins/discourse-chatbot/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed childprocess-5.0.0
1 gem installed
gem install google-id-token -v 1.4.2 -i /var/www/discourse/plugins/discourse-google-one-tap/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed google-id-token-1.4.2
1 gem installed
gem install geocoder -v 1.8.2 -i /var/www/discourse/plugins/discourse-locations/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed geocoder-1.8.2
1 gem installed
gem install aws-sdk-translate -v 1.35.0 -i /var/www/discourse/plugins/discourse-translator/gems/3.3.3 --no-document --ignore-dependencies --no-user-install
Successfully installed aws-sdk-translate-1.35.0
1 gem installed
== 20240611170904 UpgradePgvector070: migrating ===============================



FAILED
--------------------

Looks like this may be the issue. I think there’s a report here:

Good news is there’s a fix in the pipeline. :partying_face:

(Ah, I missed Jagster already suggesting it. :slight_smile:)

2 Likes

Yeah, it could be. Looks similar to mine.

Dup of Broken update: ERROR: must be owner of extension vector (PG::InsufficientPrivilege)