Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear transient data is failing #784

Open
jsia9 opened this issue Dec 28, 2021 · 3 comments
Open

clear transient data is failing #784

jsia9 opened this issue Dec 28, 2021 · 3 comments

Comments

@jsia9
Copy link

jsia9 commented Dec 28, 2021

Description

hi, I am trying to upgrade the instance for a demo. I do this to keep the server up to date even though we do not have any active customers. The server was offline the most half of the year and the last upgrade was Nov 2020. So I ran the site.yml and it failed at the deploy.yml with an error that seems common but without any known fix. Maybe because in my case, the instance does not have any orders and therefore the DB instance doest not have any rows to migrate. But here is the error. commenting out the sections as I heard does not work because it will fail at the following step.
I commented
- name: clear transient data
- name: migrate database and it resulted in this

TASK [deploy : seed database] ******************************************************************************************************************************************************************************
task path: /Users/papa/Projects/github/mahofood/ofn-install/roles/deploy/tasks/deploy.yml:118
fatal: [staging.mahofood.com]: FAILED! => {
    "changed": true,
    "cmd": [
        "bash",
        "-lc",
        "bundle exec rake db:seed RAILS_ENV=staging"
    ],
    "delta": "0:00:11.853306",
    "end": "2021-12-28 11:30:47.520471",
    "invocation": {
        "module_args": {
            "_raw_params": "bash -lc \"bundle exec rake db:seed RAILS_ENV=staging\"",
            "_uses_shell": false,
            "argv": null,
            "chdir": "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-112743",
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2021-12-28 11:30:35.667165",
    "stderr": "Run `bin/rails db:migrate` to update your database then try again.",
    "stderr_lines": [
        "Run `bin/rails db:migrate` to update your database then try again."
    ],

Expected Behavior

Actual Behaviour

This is what happened when running it normally. it seems to be related to the goodmigrationgem that was added but I am not sure.

TASK [deploy : clear transient data] ***********************************************************************************************************************************************************************
task path: /Users/test/ofn-install/roles/deploy/tasks/deploy.yml:101
fatal: [staging.mahofood.com]: FAILED! => {
    "changed": true,
    "cmd": [
        "bash",
        "-lc",
        "bundle exec rake ofn:data:remove_transient_data RAILS_ENV=staging"
    ],
    "delta": "0:00:14.366970",
    "end": "2021-12-28 11:36:13.757824",
    "invocation": {
        "module_args": {
            "_raw_params": "bash -lc \"bundle exec rake ofn:data:remove_transient_data RAILS_ENV=staging\"",
            "_uses_shell": false,
            "argv": null,
            "chdir": "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253",
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2021-12-28 11:35:59.390854",
    "stderr": "rake aborted!\nActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column spree_adjustments.order_id does not exist\nLINE 1: DELETE FROM \"spree_adjustments\" WHERE \"spree_adjustments\".\"o...\n                                              ^\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:70:in `exec_delete'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:185:in `delete'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `delete'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/relation.rb:594:in `delete_all'\n/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:33:in `clear_old_cart_data!'\n/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:19:in `call'\n/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rake:10:in `block (3 levels) in <main>'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/bugsnag-6.24.0/lib/bugsnag/integrations/rake.rb:20:in `execute'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'\n/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `load'\n/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `<main>'\n\nCaused by:\nPG::UndefinedColumn: ERROR:  column spree_adjustments.order_id does not exist\nLINE 1: DELETE FROM \"spree_adjustments\" WHERE \"spree_adjustments\".\"o...\n                                              ^\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:70:in `exec_delete'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:185:in `delete'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `delete'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/relation.rb:594:in `delete_all'\n/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:33:in `clear_old_cart_data!'\n/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:19:in `call'\n/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rake:10:in `block (3 levels) in <main>'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/bugsnag-6.24.0/lib/bugsnag/integrations/rake.rb:20:in `execute'\n/home/openfoodnetwork/.gem/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'\n/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `load'\n/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `<main>'\nTasks: TOP => ofn:data:remove_transient_data\n(See full trace by running task with --trace)",
    "stderr_lines": [
        "rake aborted!",
        "ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column spree_adjustments.order_id does not exist",
        "LINE 1: DELETE FROM \"spree_adjustments\" WHERE \"spree_adjustments\".\"o...",
        "                                              ^",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:70:in `exec_delete'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:185:in `delete'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `delete'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/relation.rb:594:in `delete_all'",
        "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:33:in `clear_old_cart_data!'",
        "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:19:in `call'",
        "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rake:10:in `block (3 levels) in <main>'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/bugsnag-6.24.0/lib/bugsnag/integrations/rake.rb:20:in `execute'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'",
        "/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `load'",
        "/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `<main>'",
        "",
        "Caused by:",
        "PG::UndefinedColumn: ERROR:  column spree_adjustments.order_id does not exist",
        "LINE 1: DELETE FROM \"spree_adjustments\" WHERE \"spree_adjustments\".\"o...",
        "                                              ^",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:70:in `exec_delete'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:185:in `delete'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `delete'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/relation.rb:594:in `delete_all'",
        "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:33:in `clear_old_cart_data!'",
        "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rb:19:in `call'",
        "/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2021-12-28-113253/lib/tasks/data/remove_transient_data.rake:10:in `block (3 levels) in <main>'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/bugsnag-6.24.0/lib/bugsnag/integrations/rake.rb:20:in `execute'",
        "/home/openfoodnetwork/.gem/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'",
        "/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `load'",
        "/home/openfoodnetwork/.rbenv/versions/2.7.3/bin/bundle:23:in `<main>'",
        "Tasks: TOP => ofn:data:remove_transient_data",
        "(See full trace by running task with --trace)"
    ],
    "stdout": "RAILS_ENV=staging environment is not defined in config/webpacker.yml, falling back to production environment",
    "stdout_lines": [
        "RAILS_ENV=staging environment is not defined in config/webpacker.yml, falling back to production environment"
    ]
}
Tuesday 28 December 2021  11:36:11 +0000 (0:00:14.821)       0:03:24.522 ******

TASK [debug] ***********************************************************************************************************************************************************************************************
task path: /Users/test/ofn-install/playbooks/deploy.yml:61
fatal: [staging.mahofood.com]: FAILED! => {
    "msg": "Deployment failed"
}

Steps to Reproduce

Setup an instance in 3.xx version , and run the site.yml.

Severity

bug-s2: a non-critical feature is broken, no workaround

the server has been off for over 2 months while trying to fix the issue.
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Bug-severity
-->

Your Environment

Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-1064-azure x86_64)
on azure

@Matt-Yorkley
Copy link
Collaborator

Hi @jsia9 👋

Deploying the latest version directly on top of an old release from November 2020 is tricky; there have been too many major changes that have happened in the last 13 months.

You might need to try deploying incremental updates in smaller steps. I made some notes here on milestones, starting from around December 2020:

v3.4.5 (Rails 4.2 and Ruby 2.3.7)
---
v3.5.0 bumps Ruby to 2.4.4
v3.5.11 has a sizeable adjustments migration...
v3.5.12 good_migrations gem was added...
v3.5.14 last major release before the Rails 5.0 upgrade
v3.6.0-rc1 complete Rails 5.0 upgrade
v3.6.1 is the offical Rails 5.0 release. also has adjustments schema changes
v3.6.2 hotfix on v3.6.1 (nils in variant serializer bug?)
---
v3.6.3 bumps Ruby to 2.5.8
v3.6.4 emergency hotfix on v3.6.3 for a customer balance issue
v3.6.5 adds some adjustments schema changes...
v3.6.6 hotfix on v3.6.5... relevant
v3.6.7 some adjustments schema changes...
v3.6.10 last release before Rails 5.2 upgrade
v3.7.0 upgrades to Rails 5.2
v3.7.2 switches to Redis
---
v3.7.3 bumps Ruby to 2.5.9, switches to Sidekiq for jobs, last release before Rails 6.0
v3.8.0 upgrades to Rails 6.0
---
v3.8.3 upgrades to Ruby 2.7.3 and contains the biggest adjustments migrations
v3.8.4 upgrades to Rails 6.1 and adds Webpacker
v3.8.5 switches to Dotenv
v3.8.8 final release before v4.0.0
---
v4.0.0 switches from Unicorn to Puma!
v4.1.0 changes sessions cookie handling...

You'll need to provision/deploy with the ofn-v3 branch of ofn-install until you get to v3.8.8. You'll probably need to update the ruby_versions value in inventory/group_vars/all.yml as well when approaching the Ruby version changes...

@jsia9
Copy link
Author

jsia9 commented Dec 28, 2021

thanks @Matt-Yorkley 👍🏾 I ll try that

@jsia9
Copy link
Author

jsia9 commented Dec 28, 2021

ok so it either tells me that ruby 2.4.4 is required but it does not install it. interestingly version 2.4.4 is not available by default. 2.4.1 et 2.5-dev

use ruby 2.4.4] ***************************************************************************************************************************************************************************** task path: /Users/test/ofn-install/ofn-install/roles/deploy/tasks/deploy.yml:43 fatal: [staging.mahofood.com]: FAILED! => { "changed": true, "cmd": "bash -lc \"/home/openfoodnetwork/.rbenv/bin/rbenv global 2.4.4 && rbenv rehash\"", "delta": "0:00:00.092388", "end": "2021-12-28 17:44:26.607092", "invocation": { "module_args": { "_raw_params": "bash -lc \"/home/openfoodnetwork/.rbenv/bin/rbenv global 2.4.4 && rbenv rehash\"", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true } }, "msg": "non-zero return code", "rc": 1, "start": "2021-12-28 17:44:26.514704", "stderr": "rbenv: version 2.4.4' not installed",
"stderr_lines": [
"rbenv: version 2.4.4' not installed"

Maybe because it is not available. versions that I can get are
rbenv install --list Available versions: 1.8.5-p52 1.8.5-p113 1.8.5-p114 1.8.5-p115 1.8.5-p231 1.8.6 1.8.6-p36 1.8.6-p110 1.8.6-p111 1.8.6-p114 1.8.6-p230 1.8.6-p286 1.8.6-p287 1.8.6-p368 1.8.6-p369 1.8.6-p383 1.8.6-p388 1.8.6-p398 1.8.6-p399 1.8.6-p420 1.8.7-preview1 1.8.7-preview2 1.8.7-preview3 1.8.7-preview4 1.8.7 1.8.7-p17 1.8.7-p22 1.8.7-p71 1.8.7-p72 1.8.7-p160 1.8.7-p173 1.8.7-p174 1.8.7-p248 1.8.7-p249 1.8.7-p299 1.8.7-p301 1.8.7-p302 1.8.7-p330 1.8.7-p334 1.8.7-p352 1.8.7-p357 1.8.7-p358 1.8.7-p370 1.8.7-p371 1.8.7-p373 1.8.7-p374 1.8.7-p375 1.9.0-0 1.9.0-1 1.9.0-2 1.9.0-3 1.9.0-4 1.9.0-5 1.9.1-preview1 1.9.1-preview2 1.9.1-rc1 1.9.1-rc2 1.9.1-p0 1.9.1-p129 1.9.1-p243 1.9.1-p376 1.9.1-p378 1.9.1-p429 1.9.1-p430 1.9.1-p431 1.9.2-preview1 1.9.2-preview3 1.9.2-rc1 1.9.2-rc2 1.9.2-p0 1.9.2-p136 1.9.2-p180 1.9.2-p290 1.9.2-p318 1.9.2-p320 1.9.2-p326 1.9.2-p330 1.9.3-dev 1.9.3-preview1 1.9.3-rc1 1.9.3-p0 1.9.3-p105 1.9.3-p125 1.9.3-p194 1.9.3-p286 1.9.3-p327 1.9.3-p362 1.9.3-p374 1.9.3-p385 1.9.3-p392 1.9.3-p426 1.9.3-p429 1.9.3-p448 1.9.3-p484 1.9.3-p545 1.9.3-p547 1.9.3-p550 1.9.3-p551 2.0.0-dev 2.0.0-preview1 2.0.0-preview2 2.0.0-rc1 2.0.0-rc2 2.0.0-p0 2.0.0-p195 2.0.0-p247 2.0.0-p353 2.0.0-p451 2.0.0-p481 2.0.0-p576 2.0.0-p594 2.0.0-p598 2.0.0-p643 2.0.0-p645 2.0.0-p647 2.0.0-p648 2.1.0-dev 2.1.0-preview1 2.1.0-preview2 2.1.0-rc1 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.2.0-dev 2.2.0-preview1 2.2.0-preview2 2.2.0-rc1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.3.0-dev 2.3.0-preview1 2.3.0-preview2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0-dev 2.4.0-preview1 2.4.0-preview2 2.4.0-preview3 2.4.0-rc1 2.4.0 2.4.1 2.5.0-dev jruby-1.5.6 jruby-1.6.3 jruby-1.6.4 jruby-1.6.5 jruby-1.6.5.1 jruby-1.6.6 jruby-1.6.7 jruby-1.6.7.2 jruby-1.6.8 jruby-1.7.0-preview1 jruby-1.7.0-preview2 jruby-1.7.0-rc1 jruby-1.7.0-rc2 jruby-1.7.0 jruby-1.7.1 jruby-1.7.2 jruby-1.7.3 jruby-1.7.4 jruby-1.7.5 jruby-1.7.6 jruby-1.7.7 jruby-1.7.8 jruby-1.7.9 jruby-1.7.10 jruby-1.7.11 jruby-1.7.12 jruby-1.7.13 jruby-1.7.14 jruby-1.7.15 jruby-1.7.16 jruby-1.7.16.1 jruby-1.7.16.2 jruby-1.7.17 jruby-1.7.18 jruby-1.7.19 jruby-1.7.20 jruby-1.7.20.1 jruby-1.7.21 jruby-1.7.22 jruby-1.7.23 jruby-1.7.24 jruby-1.7.25 jruby-1.7.26 jruby-1.7.27 jruby-9.0.0.0.pre1 jruby-9.0.0.0.pre2 jruby-9.0.0.0.rc1 jruby-9.0.0.0.rc2 jruby-9.0.0.0 jruby-9.0.1.0 jruby-9.0.3.0 jruby-9.0.4.0 jruby-9.0.5.0 jruby-9.1.0.0-dev jruby-9.1.0.0 jruby-9.1.1.0 jruby-9.1.2.0 jruby-9.1.3.0 jruby-9.1.4.0 jruby-9.1.5.0 jruby-9.1.6.0 jruby-9.1.7.0 jruby-9.1.8.0 jruby-9.1.9.0-dev jruby-9.1.9.0 jruby-9.1.10.0 jruby-9.1.11.0 jruby-9.1.12.0 maglev-1.0.0 maglev-1.1.0-dev maglev-2.0.0-dev mruby-dev mruby-1.0.0 mruby-1.1.0 mruby-1.2.0 rbx-2.2.2 rbx-2.2.3 rbx-2.2.4 rbx-2.2.5 rbx-2.2.6 rbx-2.2.7 rbx-2.2.8 rbx-2.2.9 rbx-2.2.10 rbx-2.3.0 rbx-2.4.0 rbx-2.4.1 rbx-2.5.0 rbx-2.5.1 rbx-2.5.2 rbx-2.5.3 rbx-2.5.4 rbx-2.5.5 rbx-2.5.6 rbx-2.5.7 rbx-2.5.8 rbx-2.6 rbx-2.7 rbx-2.8 rbx-2.9 rbx-2.10 rbx-2.11 rbx-2.71828182 rbx-3.0 rbx-3.1 rbx-3.2 rbx-3.3 rbx-3.4 rbx-3.5 rbx-3.6 rbx-3.7 rbx-3.8 rbx-3.9 rbx-3.10 rbx-3.11 rbx-3.12 rbx-3.13 rbx-3.14 rbx-3.15 rbx-3.16 rbx-3.17 rbx-3.18 rbx-3.19 rbx-3.20 rbx-3.21 rbx-3.22 rbx-3.23 rbx-3.24 rbx-3.25 rbx-3.26 rbx-3.27 rbx-3.28 rbx-3.29 rbx-3.30 rbx-3.31 rbx-3.32 rbx-3.33 rbx-3.34 rbx-3.35 rbx-3.36 rbx-3.37 rbx-3.38 rbx-3.39 rbx-3.40 rbx-3.41 rbx-3.42 rbx-3.43 rbx-3.44 rbx-3.45 rbx-3.46 rbx-3.47 rbx-3.48 rbx-3.49 rbx-3.50 rbx-3.51 rbx-3.52 rbx-3.53 rbx-3.54 rbx-3.55 rbx-3.56 rbx-3.57 rbx-3.58 rbx-3.59 rbx-3.60 rbx-3.61 rbx-3.62 rbx-3.63 rbx-3.64 rbx-3.65 rbx-3.66 rbx-3.67 rbx-3.68 rbx-3.69 rbx-3.70 rbx-3.71 rbx-3.72 rbx-3.73 rbx-3.74 rbx-3.75 rbx-3.76 rbx-3.77 rbx-3.78 rbx-3.79 rbx-3.80 rbx-3.81 rbx-3.82 ree-1.8.7-2011.03 ree-1.8.7-2011.12 ree-1.8.7-2012.01 ree-1.8.7-2012.02 topaz-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: All the things 💤
Development

No branches or pull requests

2 participants