Here are a more complete list of log entries, at the very end of the log. I now have all 575 rows, so if you want the full thing just let me know.
1. 98:M 15 Jul 2024 15:46:33.090 # User requested shutdown...
2. 98:M 15 Jul 2024 15:46:33.090 * Saving the final RDB snapshot before exiting.
3. 2024-07-15 15:46:33.103 UTC [36] LOG: database system is shut down
4. 98:M 15 Jul 2024 15:46:33.205 * DB saved on disk
5. 98:M 15 Jul 2024 15:46:33.205 # Redis is now ready to exit, bye bye...
* FAILED
6. --------------------
7. Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1676 exit 1>
8. Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
9. exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
10. bootstrap failed with exit code 1
11. ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
12. ./discourse-doctor may help diagnose the problem.
13. 1143b37805d37aeca127453b4c978fff71efca2bd2ed56be58acd404c7ea8f49
Looks nearly identical to what I shared in Cannot rebuild with Discourse AI. While both error logs share a common issue with the tokenizers library causing the rake db:migrate command to fail, your error includes an additional Redis server startup error that is not present in mine.
Iâm on 3.2.4. I also got the redis error this time. I think the logs I shared previously were on 3.2.1. Everything was working fine when I was (unwittingly) building Discourse from the latest commits on main. It broke when I rebuild from the stable branch.
We recently bumped Ruby to 3.3, and since you are on 3.2.1, the plugin is pinned to an older commit for compatibility reasons. In this commit, the extra gems the plugin needs are incompatible with 3.3.
Discourse 3.3 is around the corner, and it should fix the issue, but I didnât want to leave you folks hanging or force you to start following beta/tests-passed. Iâm pinning the plugin to a commit that is Ruby 3.3 compatible:
Please let me know if you still experience errors during rebuild.
I, [2024-07-17T22:58:15.869101 #1] INFO â : Terminating async processes
I, [2024-07-17T22:58:15.869151 #1] INFO â : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 35
I, [2024-07-17T22:58:15.869356 #1] INFO â : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 97
97:signal-handler (1721257095) Received SIGTERM scheduling shutdownâŚ
2024-07-17 22:58:15.869 UTC [35] LOG: received fast shutdown request
2024-07-17 22:58:15.874 UTC [35] LOG: aborting any active transactions
2024-07-17 22:58:15.880 UTC [35] LOG: background worker âlogical replication launcherâ (PID 50) exited with exit code 1
2024-07-17 22:58:15.880 UTC [45] LOG: shutting down
97:M 17 Jul 2024 22:58:15.887 # User requested shutdownâŚ
97:M 17 Jul 2024 22:58:15.887 * Saving the final RDB snapshot before exiting.
2024-07-17 22:58:15.917 UTC [35] LOG: database system is shut down
97:M 17 Jul 2024 22:58:16.349 * DB saved on disk
97:M 17 Jul 2024 22:58:16.349 # Redis is now ready to exit, bye byeâŚ
FAILED
Pups::ExecError: cd /var/www/discourse && su discourse -c âbundle exec rake db:migrateâ failed with return #<Process::Status: pid 1722 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
That did the trick! We were able to complete the install. Iâm assuming the next time we run a Discourse update it will grab the most recent version, right?
Here is the output. Not sure whatâs up with this because my Discourse instance is up and running just fine.
LOAD_PLUGINS=1 bundle exec rake db:migrate
root@forum-app:/var/www/discourse# LOAD_PLUGINS=1 bundle exec rake db:migrate
kfatal: detected dubious ownership in repository at â/var/www/discourseâ
To add an exception for this directory, call:
rake aborted!
ActiveRecord::NoDatabaseError: We could not find your database: discourse. Which can be found in the database configuration file located at config/database.yml. (ActiveRecord::NoDatabaseError)
To resolve this issue:
Did you create the database for this app, or delete it? You may need to create your database.
Has the database name changed? Check your database.yml config has the correct database name.
To create your database, run:
bin/rails db:create
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in rescue in new_client' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in new_clientâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in postgresql_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in public_sendâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in new_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in checkout_new_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in try_to_checkout_new_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in acquire_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in checkout' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in retrieve_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:313:in retrieve_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:280:in connection' /var/www/discourse/lib/site_settings/db_provider.rb:58:in table_exists?â
/var/www/discourse/lib/site_settings/db_provider.rb:14:in all' /var/www/discourse/lib/site_settings/defaults_provider.rb:30:in db_allâ
/var/www/discourse/lib/site_setting_extension.rb:260:in block in refresh!' /var/www/discourse/lib/site_setting_extension.rb:253:in synchronizeâ
/var/www/discourse/lib/site_setting_extension.rb:253:in refresh!' /var/www/discourse/lib/site_setting_extension.rb:528:in block in setup_methodsâ
/var/www/discourse/config/initializers/100-push-notifications.rb:13:in block in <main>' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:445:in instance_execâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:445:in block in make_lambda' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:199:in block (2 levels) in haltingâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:687:in block (2 levels) in default_terminator' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:686:in catchâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:686:in block in default_terminator' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:200:in block in haltingâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in block in invoke_before' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in eachâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in invoke_before' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:106:in run_callbacksâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/reloader.rb:88:in prepare!' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:68:in block in module:Finisherâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in instance_exec' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in runâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in block in run_initializers' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in run_initializersâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application.rb:372:in initialize!' /var/www/discourse/config/environment.rb:7:in â
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.17.1/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.12/lib/zeitwerk/kernel.rb:38:in requireâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application.rb:348:in require_environment!' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application.rb:506:in block in run_tasks_blocksâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.1.0/exe/rake:27:in <top (required)>' /usr/local/bin/bundle:25:in loadâ
/usr/local/bin/bundle:25:in `â
Caused by:
PG::ConnectionBad: connection to server on socket â/var/run/postgresql/.s.PGSQL.5432â failed: FATAL: Peer authentication failed for user âdiscourseâ (PG::ConnectionBad)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg/connection.rb:696:in async_connect_or_reset' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg/connection.rb:824:in connect_to_hostsâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg/connection.rb:759:in new' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg.rb:63:in connectâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in new_client' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in postgresql_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in public_send' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in new_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in checkout_new_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in try_to_checkout_new_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in acquire_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in checkoutâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in retrieve_connectionâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:313:in retrieve_connection' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:280:in connectionâ
/var/www/discourse/lib/site_settings/db_provider.rb:58:in table_exists?' /var/www/discourse/lib/site_settings/db_provider.rb:14:in allâ
/var/www/discourse/lib/site_settings/defaults_provider.rb:30:in db_all' /var/www/discourse/lib/site_setting_extension.rb:260:in block in refresh!â
/var/www/discourse/lib/site_setting_extension.rb:253:in synchronize' /var/www/discourse/lib/site_setting_extension.rb:253:in refresh!â
/var/www/discourse/lib/site_setting_extension.rb:528:in block in setup_methods' /var/www/discourse/config/initializers/100-push-notifications.rb:13:in block in â
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:445:in instance_exec' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:445:in block in make_lambdaâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:199:in block (2 levels) in halting' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:687:in block (2 levels) in default_terminatorâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:686:in catch' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:686:in block in default_terminatorâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:200:in block in halting' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in block in invoke_beforeâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in each' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in invoke_beforeâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:106:in run_callbacks' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8/lib/active_support/reloader.rb:88:in prepare!â
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:68:in block in <module:Finisher>' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in instance_execâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in run' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in block in run_initializersâ
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in run_initializers' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application.rb:372:in initialize!â
/var/www/discourse/config/environment.rb:7:in <main>' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.17.1/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.12/lib/zeitwerk/kernel.rb:38:in require' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application.rb:348:in require_environment!â
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8/lib/rails/application.rb:506:in block in run_tasks_blocks' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.1.0/exe/rake:27:in <top (required)>â
/usr/local/bin/bundle:25:in load' /usr/local/bin/bundle:25:in â
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
Is there something I need to do to build the plugin from this branch? I just have git clone https://github.com/discourse/discourse-ai.git in my app.yaml.
EDIT: Sounds like I can do that by changing it to git clone -b security/backport-ssrf-protection https://github.com/discourse/discourse-ai.git. However, that doesnât seem necessary since the PR referenced above was merged in the main branch.
1719:M 18 Jul 2024 14:58:24.143 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
1719:M 18 Jul 2024 14:58:24.143 # Failed listening on port 6379 (TCP), aborting.
I, [2024-07-18T14:58:34.132729 #1] INFO -- :
I, [2024-07-18T14:58:34.133090 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
97:M 18 Jul 2024 15:00:31.873 * 100 changes in 300 seconds. Saving...
97:M 18 Jul 2024 15:00:31.876 * Background saving started by pid 3948
3948:C 18 Jul 2024 15:00:32.356 * DB saved on disk
3948:C 18 Jul 2024 15:00:32.358 * Fork CoW for RDB: current 1 MB, peak 1 MB, average 1 MB
97:M 18 Jul 2024 15:00:32.378 * Background saving terminated with success
rake aborted!
NoMethodError: undefined method `commands=' for an instance of AiPersona (NoMethodError)
.
.
.
I, [2024-07-18T15:00:33.541391 #1] INFO -- : Terminating async processes
I, [2024-07-18T15:00:33.541460 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 35
I, [2024-07-18T15:00:33.541515 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 97
2024-07-18 15:00:33.542 UTC [35] LOG: received fast shutdown request
97:signal-handler (1721314833) Received SIGTERM scheduling shutdown...
2024-07-18 15:00:33.546 UTC [35] LOG: aborting any active transactions
2024-07-18 15:00:33.550 UTC [35] LOG: background worker "logical replication launcher" (PID 50) exited with exit code 1
2024-07-18 15:00:33.555 UTC [45] LOG: shutting down
97:M 18 Jul 2024 15:00:33.585 # User requested shutdown...
97:M 18 Jul 2024 15:00:33.585 * Saving the final RDB snapshot before exiting.
2024-07-18 15:00:33.586 UTC [35] LOG: database system is shut down
97:M 18 Jul 2024 15:00:34.067 * DB saved on disk
97:M 18 Jul 2024 15:00:34.067 # Redis is now ready to exit, bye bye...
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1722 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.
We sorted it out via PM. This happened because the instance was previously following tests-passed and then switched to stable. Downgrading is not recommended as your DB schema will diverge from what the app code expects.