Development install fails when running bin/rails db:migrate

Basically, I am trying to do a dev install on my Pi, following this guide. I ran bin/rails db:create, which worked fine. Then when trying to run bin/rails db:migrate, it ends by saying something about oxipng binary file not working? It tells me to either put a proper binary file or use some command (I cannot remember it exactly, I’ll tell you why).
But, um, my VNC lagged out when doing this (I think the processing was too much? I did a bin/ember-cli -u even with this oxipng thing. Anyway, I then clicked on something and all I say was a grey screen. I closed the VNC session and tried to reconnect. Nothing happened for a long time. I disconnected and reconnected my Pi (yes, force shut down. Very bad.). As such, I don’t know that oxipng message much.
Tried again to run bin/rails db:migrate, and this was the error (same error as well when running RAILS_ENV=test bin/rails db:create db:migrate):

== 20241024093027 RemoveCategoryExpertsWebHookEventTypes: migrating ===========
-- execute("DELETE FROM web_hook_event_types WHERE (name, id) IN (('category_experts_approved', 1901), ('category_experts_unapproved', 1902))")
   -> 0.0011s
== 20241024093027 RemoveCategoryExpertsWebHookEventTypes: migrated (0.0029s) ==

/home/natedhaliwal/discourse-f/app/models/post_action_type.rb:16:in `expire_cache'
/home/natedhaliwal/discourse-f/app/models/post_action_type.rb:42:in `reload_types'
/home/natedhaliwal/discourse-f/app/models/flag.rb:37:in `reset_flag_settings!'
(eval):78:in `block (2 levels) in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:46:in `eval'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:46:in `block (2 levels) in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:58:in `block in open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:57:in `open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:57:in `open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:36:in `block in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.1.4.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/transactions.rb:212:in `transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:35:in `run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:26:in `block in run'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:25:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:25:in `run'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/discourse-seed-fu.rb:29:in `seed'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:264:in `block (2 levels) in <main>'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:34:in `synchronize'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:234:in `block in <main>'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:156:in `invoke_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:73:in `block in invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:149:in `with_argv'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:69:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands.rb:18:in `<main>'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'
bin/rails aborted!
ActiveRecord::RecordNotFound: Couldn't find Upload with 'id'=-6 (ActiveRecord::RecordNotFound)
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:119:in `resolve_original'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:71:in `block in ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `each'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:272:in `block (2 levels) in <main>'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:34:in `synchronize'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:234:in `block in <main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

When running it with --trace, I get:

natedhaliwal@raspberrypi:~/discourse-f $ RAILS_ENV=test bin/rails db:create db:migrate --trace
** Invoke db:create (first_time)
** Invoke db:force_skip_persist (first_time)
** Execute db:force_skip_persist
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:create
Database 'discourse_test' already exists
Database 'discourse_test_multisite' already exists
** Invoke db:migrate (first_time)
** Invoke db:load_config 
** Invoke environment 
** Invoke set_locale (first_time)
** Execute set_locale
** Invoke assets:precompile:theme_transpiler (first_time)
** Invoke environment 
** Execute assets:precompile:theme_transpiler
** Execute db:migrate
/home/natedhaliwal/discourse-f/app/models/post_action_type.rb:16:in `expire_cache'
/home/natedhaliwal/discourse-f/app/models/post_action_type.rb:42:in `reload_types'
/home/natedhaliwal/discourse-f/app/models/flag.rb:37:in `reset_flag_settings!'
(eval):78:in `block (2 levels) in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:46:in `eval'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:46:in `block (2 levels) in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:58:in `block in open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:57:in `open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:57:in `open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:36:in `block in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.1.4.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/transactions.rb:212:in `transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:35:in `run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:26:in `block in run'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:25:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:25:in `run'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/discourse-seed-fu.rb:29:in `seed'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:264:in `block (2 levels) in <main>'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:34:in `synchronize'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:234:in `block in <main>'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:156:in `invoke_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:73:in `block in invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:149:in `with_argv'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:69:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands.rb:18:in `<main>'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'
bin/rails aborted!
ActiveRecord::RecordNotFound: Couldn't find Upload with 'id'=-6 (ActiveRecord::RecordNotFound)
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/core.rb:253:in `find'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:119:in `resolve_original'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:71:in `block in ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `each'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:272:in `block (2 levels) in <main>'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:34:in `synchronize'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:234:in `block in <main>'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:156:in `invoke_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:73:in `block in invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:149:in `with_argv'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:69:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands.rb:18:in `<main>'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'
Tasks: TOP => db:migrate

Any thoughts on what I should do?

Hmm the answer is probably this line:

ActiveRecord::RecordNotFound: Couldn't find Upload with 'id'=-6 (ActiveRecord::RecordNotFound)
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:119:in `resolve_original'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:71:in `block in ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `each'

Did you recently remove an icon?

An icon? You mean like an image icon (e.g. FA)?

Open the Rails console and inspect the uploads table to verify ID = -6 is missing:

RAILS_ENV=test bin/rails console
Upload.find_by(id: -6)

The error indicates that the record with ID = -6 has been deleted. You’ll need to update the seed data or fixtures accordingly in your test environment.

1 Like

Hello, I am facing this problem too, but am stucked before install finish, so am dont have bin/rails…how can i fix it. And i cant enter app (./launcher enter app) the bin folder is empty

@woozievert, please share the detailed trace of your error

same error:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1962 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.
ActiveRecord::RecordNotFound: Couldn't find Upload with 'id'=-6 (ActiveRecord::RecordNotFound)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/core.rb:253:in `find'
/var/www/discourse/lib/site_icon_manager.rb:119:in `resolve_original'
/var/www/discourse/lib/site_icon_manager.rb:71:in `block in ensure_optimized!'
/var/www/discourse/lib/site_icon_manager.rb:70:in `each'
/var/www/discourse/lib/site_icon_manager.rb:70:in `ensure_optimized!'
/var/www/discourse/lib/tasks/db.rake:272: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)
1 Like

I posted here and forget to reply to you sry

I ran this and got nil.

natedhaliwal@raspberrypi:~/discourse-f $ RAILS_ENV=test bin/rails db:create db:migrate
Database 'discourse_test' already exists
Database 'discourse_test_multisite' already exists
/home/natedhaliwal/discourse-f/app/models/post_action_type.rb:16:in `expire_cache'
/home/natedhaliwal/discourse-f/app/models/post_action_type.rb:42:in `reload_types'
/home/natedhaliwal/discourse-f/app/models/flag.rb:37:in `reset_flag_settings!'
(eval):78:in `block (2 levels) in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:46:in `eval'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:46:in `block (2 levels) in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:58:in `block in open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:57:in `open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:57:in `open'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:36:in `block in run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.1.4.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.1.4.1/lib/active_record/transactions.rb:212:in `transaction'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:35:in `run_file'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:26:in `block in run'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:25:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/seed-fu/runner.rb:25:in `run'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse-seed-fu-2.3.12/lib/discourse-seed-fu.rb:29:in `seed'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:264:in `block (2 levels) in <main>'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:34:in `synchronize'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:234:in `block in <main>'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:156:in `invoke_rake'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:73:in `block in invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:149:in `with_argv'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/command.rb:69:in `invoke'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.1.4.1/lib/rails/commands.rb:18:in `<main>'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/natedhaliwal/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'
bin/rails aborted!
ActiveRecord::RecordNotFound: Couldn't find Upload with 'id'=-6 (ActiveRecord::RecordNotFound)
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:119:in `resolve_original'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:71:in `block in ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `each'
/home/natedhaliwal/discourse-f/lib/site_icon_manager.rb:70:in `ensure_optimized!'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:272:in `block (2 levels) in <main>'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:49:in `synchronize'
/home/natedhaliwal/discourse-f/lib/distributed_mutex.rb:34:in `synchronize'
/home/natedhaliwal/discourse-f/lib/tasks/db.rake:234:in `block in <main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

natedhaliwal@raspberrypi:~/discourse-f $ RAILS_ENV=test bin/rails console
Loading test environment (Rails 7.1.4.1)
irb(main):001> Upload.find_by(id: -6)
=> nil
irb(main):002> 

natedhaliwal@raspberrypi:~/discourse-f $ 

Which step are you currently at? Have you cloned Discourse yet?

I am using docker install

1 Like

I just came across this when creating a new local db and migrating.

Unfortunately I think it was introduced by FIX: reset cache after flags are seed by lis2 · Pull Request #28801 · discourse/discourse · GitHub. Brand new migrations from scratch are not possible now.

@kris.kotlarek could you have a look please. I believe touching the redis cache in the initializer could be the issue.

2 Likes

Thanks for the report @NateDhaliwal

Kris fixed the issue with

We should be good now!

3 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.