Recipe Version upgrade not working (4.0.2+v2.25.4 to 5.0.0+v3.0.0) #15

Open
opened 2025-07-24 10:49:46 +00:00 by stevensting · 3 comments
Owner

I tried to upgrade my instance but ran into a strange behaviour: The two organizations I had before were not displayed anymore, but some discussions/decisions showed up on my dashboard. Same for the admin user.

Anyone else ran into this? Not sure if this is a recipe problem or a loomio problem.

I tried to upgrade my instance but ran into a strange behaviour: The two organizations I had before were not displayed anymore, but some discussions/decisions showed up on my dashboard. Same for the admin user. Anyone else ran into this? Not sure if this is a recipe problem or a loomio problem.
stevensting added the
bug
label 2025-07-24 10:49:46 +00:00
Owner

I'm also running into the same issue. When i upgrade from 4.0.2+v2.25.4 to 5.0.0+v3.0.0, my loomio dashboard is completely empty. I do see some notifications when i click on the bell icon but when I try to click on them I get a server error.

I'm also running into the same issue. When i upgrade from 4.0.2+v2.25.4 to 5.0.0+v3.0.0, my loomio dashboard is completely empty. I do see some notifications when i click on the bell icon but when I try to click on them I get a server error.
Owner

Adding some more of my findings here:

I created a test loomio instance and deployed it with version 4.0.2+v2.25.4, populated some test data in it, then upgraded to 5.0.0+v3.0.0. The group that was created in version 4.0.2+v2.25.4 disappeared after the version upgrade and when I tried creating a new group after the upgrade it also failed (attached the logs starting from when i hit "create group"). Based on the logs it does appear to be a database schema issue.

Adding some more of my findings here: I created a test loomio instance and deployed it with version 4.0.2+v2.25.4, populated some test data in it, then upgraded to 5.0.0+v3.0.0. The group that was created in version 4.0.2+v2.25.4 disappeared after the version upgrade and when I tried creating a new group after the upgrade it also failed (attached the logs starting from when i hit "create group"). Based on the logs it does appear to be a database schema issue.
Owner

I was able to resolve this issue for my test loomio instance by running a database migration with rake db:migrate command. After the migration I was able to see the group created when 4.0.2+v2.25.4 was deployed in the 5.0.0 version.

Adding the detailed steps I took to run the migration since there were a few missing pieces (it's probably smart to backup the db before doing this but i did not since I was just using a test instance):

  1. Start a bash shell for the loomio app container and run rake db:migrate, which resulted in an error
root@584bb3c104dd:/loomio# bundle exec rake db:migrate RAILS_ENV=production
rake aborted!
Cannot load database configuration:
Could not load database configuration. No such file - ["config/database.yml"]
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application/configuration.rb:352:in 'Rails::Application::Configuration#database_configuration'
/usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:266:in 'block (2 levels) in <class:Railtie>'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'Module#class_eval'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'block in ActiveSupport::LazyLoadHooks#execute_hook'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in 'ActiveSupport::LazyLoadHooks#with_execution_control'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in 'ActiveSupport::LazyLoadHooks#execute_hook'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in 'block in ActiveSupport::LazyLoadHooks#on_load'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'Array#each'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'ActiveSupport::LazyLoadHooks#on_load'
/usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:262:in 'block in <class:Railtie>'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:372:in 'Rails::Application#initialize!'
/loomio/config/environment.rb:5:in '<main>'
/usr/local/bundle/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
/usr/local/bundle/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:348:in 'Rails::Application#require_environment!'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:506:in 'block in Rails::Application#run_tasks_blocks'
/usr/local/bundle/gems/rake-13.3.0/exe/rake:27:in '<top (required)>'
/usr/local/bin/bundle:25:in 'Kernel#load'
/usr/local/bin/bundle:25:in '<main>'

Caused by:
Could not load database configuration. No such file - ["config/database.yml"]
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application/configuration.rb:352:in 'Rails::Application::Configuration#database_configuration'
/usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:266:in 'block (2 levels) in <class:Railtie>'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'Module#class_eval'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'block in ActiveSupport::LazyLoadHooks#execute_hook'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in 'ActiveSupport::LazyLoadHooks#with_execution_control'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in 'ActiveSupport::LazyLoadHooks#execute_hook'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in 'block in ActiveSupport::LazyLoadHooks#on_load'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'Array#each'
/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'ActiveSupport::LazyLoadHooks#on_load'
/usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:262:in 'block in <class:Railtie>'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:372:in 'Rails::Application#initialize!'
/loomio/config/environment.rb:5:in '<main>'
/usr/local/bundle/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
/usr/local/bundle/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:348:in 'Rails::Application#require_environment!'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:506:in 'block in Rails::Application#run_tasks_blocks'
/usr/local/bundle/gems/rake-13.3.0/exe/rake:27:in '<top (required)>'
/usr/local/bin/bundle:25:in 'Kernel#load'
/usr/local/bin/bundle:25:in '<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
  1. manually create the database.yml file
docker exec -it <container ID> bash -c 'cat > /loomio/config/database.yml <<EOL
production:
  adapter: postgresql
  host: your_db_host
  database: your_db_name
  username: your_db_user
  password: your_db_password
  port: 5432
EOL'
  1. re-run the db:migrate command but run into another credential issue
rake aborted!
ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (ArgumentError)

        raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:576:in 'Rails::Application#validate_secret_key_base'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:419:in 'Rails::Application#secret_key_base'
/usr/local/bundle/gems/devise-4.9.4/lib/devise/secret_key_finder.rb:24:in 'Devise::SecretKeyFinder#key_exists?'
/usr/local/bundle/gems/devise-4.9.4/lib/devise/secret_key_finder.rb:16:in 'Devise::SecretKeyFinder#find'
/usr/local/bundle/gems/devise-4.9.4/lib/devise/rails.rb:41:in 'block in <class:Engine>'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:372:in 'Rails::Application#initialize!'
/loomio/config/environment.rb:5:in '<main>'
/usr/local/bundle/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
/usr/local/bundle/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:348:in 'Rails::Application#require_environment!'
/usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:506:in 'block in Rails::Application#run_tasks_blocks'
/usr/local/bundle/gems/rake-13.3.0/exe/rake:27:in '<top (required)>'
/usr/local/bin/bundle:25:in 'Kernel#load'
/usr/local/bin/bundle:25:in '<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
  1. Generate the credential file on the server and save the key!
docker exec -it <container ID> bash -c "cd /loomio && RAILS_ENV=production EDITOR=vi bundle exec rails credentials:edit"

Note: I believe an alternative method could be to create a new recipe secret 'secret_key_base' and use abra to insert it (any input or confirmation on this would be appreciated)

  1. Re-run the migrate command. success!
I was able to resolve this issue for my test loomio instance by running a database migration with rake db:migrate command. After the migration I was able to see the group created when 4.0.2+v2.25.4 was deployed in the 5.0.0 version. Adding the detailed steps I took to run the migration since there were a few missing pieces (it's probably smart to backup the db before doing this but i did not since I was just using a test instance): 1. Start a bash shell for the loomio app container and run `rake db:migrate`, which resulted in an error ``` root@584bb3c104dd:/loomio# bundle exec rake db:migrate RAILS_ENV=production rake aborted! Cannot load database configuration: Could not load database configuration. No such file - ["config/database.yml"] /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application/configuration.rb:352:in 'Rails::Application::Configuration#database_configuration' /usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:266:in 'block (2 levels) in <class:Railtie>' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'Module#class_eval' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'block in ActiveSupport::LazyLoadHooks#execute_hook' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in 'ActiveSupport::LazyLoadHooks#with_execution_control' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in 'ActiveSupport::LazyLoadHooks#execute_hook' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in 'block in ActiveSupport::LazyLoadHooks#on_load' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'Array#each' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'ActiveSupport::LazyLoadHooks#on_load' /usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:262:in 'block in <class:Railtie>' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:372:in 'Rails::Application#initialize!' /loomio/config/environment.rb:5:in '<main>' /usr/local/bundle/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' /usr/local/bundle/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:348:in 'Rails::Application#require_environment!' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:506:in 'block in Rails::Application#run_tasks_blocks' /usr/local/bundle/gems/rake-13.3.0/exe/rake:27:in '<top (required)>' /usr/local/bin/bundle:25:in 'Kernel#load' /usr/local/bin/bundle:25:in '<main>' Caused by: Could not load database configuration. No such file - ["config/database.yml"] /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application/configuration.rb:352:in 'Rails::Application::Configuration#database_configuration' /usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:266:in 'block (2 levels) in <class:Railtie>' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'Module#class_eval' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in 'block in ActiveSupport::LazyLoadHooks#execute_hook' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in 'ActiveSupport::LazyLoadHooks#with_execution_control' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in 'ActiveSupport::LazyLoadHooks#execute_hook' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in 'block in ActiveSupport::LazyLoadHooks#on_load' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'Array#each' /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in 'ActiveSupport::LazyLoadHooks#on_load' /usr/local/bundle/gems/activerecord-7.0.8.7/lib/active_record/railtie.rb:262:in 'block in <class:Railtie>' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:372:in 'Rails::Application#initialize!' /loomio/config/environment.rb:5:in '<main>' /usr/local/bundle/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' /usr/local/bundle/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:348:in 'Rails::Application#require_environment!' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:506:in 'block in Rails::Application#run_tasks_blocks' /usr/local/bundle/gems/rake-13.3.0/exe/rake:27:in '<top (required)>' /usr/local/bin/bundle:25:in 'Kernel#load' /usr/local/bin/bundle:25:in '<main>' Tasks: TOP => db:migrate => db:load_config => environment (See full trace by running task with --trace) ``` 2. manually create the database.yml file ``` docker exec -it <container ID> bash -c 'cat > /loomio/config/database.yml <<EOL production: adapter: postgresql host: your_db_host database: your_db_name username: your_db_user password: your_db_password port: 5432 EOL' ``` 3. re-run the `db:migrate` command but run into another credential issue ``` rake aborted! ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (ArgumentError) raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:576:in 'Rails::Application#validate_secret_key_base' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:419:in 'Rails::Application#secret_key_base' /usr/local/bundle/gems/devise-4.9.4/lib/devise/secret_key_finder.rb:24:in 'Devise::SecretKeyFinder#key_exists?' /usr/local/bundle/gems/devise-4.9.4/lib/devise/secret_key_finder.rb:16:in 'Devise::SecretKeyFinder#find' /usr/local/bundle/gems/devise-4.9.4/lib/devise/rails.rb:41:in 'block in <class:Engine>' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:372:in 'Rails::Application#initialize!' /loomio/config/environment.rb:5:in '<main>' /usr/local/bundle/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' /usr/local/bundle/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:348:in 'Rails::Application#require_environment!' /usr/local/bundle/gems/railties-7.0.8.7/lib/rails/application.rb:506:in 'block in Rails::Application#run_tasks_blocks' /usr/local/bundle/gems/rake-13.3.0/exe/rake:27:in '<top (required)>' /usr/local/bin/bundle:25:in 'Kernel#load' /usr/local/bin/bundle:25:in '<main>' Tasks: TOP => db:migrate => db:load_config => environment (See full trace by running task with --trace) ``` 4. Generate the credential file on the server and **save the key**! ``` docker exec -it <container ID> bash -c "cd /loomio && RAILS_ENV=production EDITOR=vi bundle exec rails credentials:edit" ``` _Note_: I believe an alternative method could be to create a new recipe secret 'secret_key_base' and use abra to insert it (any input or confirmation on this would be appreciated) 5. Re-run the migrate command. success!
Sign in to join this conversation.
No description provided.