Error when updating Discourse to latest version - potential db:migrate issue

We’re seeing the following error in our logs when attempting to update our instance of Discourse to the latest version:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 5195 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
** 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.
STDERR: From https://github.com/discourse/pups
   17f04ec..e0ff889  master     -> origin/master
 * [new branch]      main       -> origin/main
 * [new tag]         v1.1.1     -> v1.1.1
 * [new tag]         v1.1.0     -> v1.1.0
Note: checking out 'v1.0.3'.

Scrolling up, I can see the following:

More Logs
Ran /var/discourse/launcher rebuild app returned 1
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/mixlib-shellout-2.4.0/lib/mixlib/shellout.rb:297:in `invalid!'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/mixlib-shellout-2.4.0/lib/mixlib/shellout.rb:284:in `error!'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/mixin/shell_out.rb:202:in `shell_out_compacted!'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/mixin/shell_out.rb:124:in `shell_out!'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/provider/execute.rb:58:in `block in action_run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/mixin/why_run.rb:51:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/provider.rb:227:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/provider/execute.rb:56:in `action_run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/provider.rb:182:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource.rb:578:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:70:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:78:in `block in run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:76:in `each'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:76:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:98:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:98:in `each'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:98:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/runner.rb:97:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/client.rb:720:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/client.rb:715:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/client.rb:715:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/client.rb:754:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/client.rb:286:in `run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/application.rb:303:in `run_with_graceful_exit_option'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-patch-0.0.0/lib/chef/application.rb:30:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-patch-0.0.0/lib/chef/application.rb:11:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/application/client.rb:440:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/bin/chef-client:25:in `<top (required)>'
/opt/chef/embedded/bin/chef-client:23:in `load'
/opt/chef/embedded/bin/chef-client:23:in `<main>'

>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /var/discourse/launcher rebuild app ----
STDOUT: WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

2.0.20210528-1735: Pulling from discourse/base
69692152171a: Pulling fs layer
caccdbcee96e: Pulling fs layer
69692152171a: Verifying Checksum
69692152171a: Download complete
69692152171a: Pull complete
caccdbcee96e: Verifying Checksum
caccdbcee96e: Download complete
caccdbcee96e: Pull complete
Digest: sha256:b1890ab83b905ada5c9b7221264d62159bbf63bda706cdc652b0533bc90431c5
Status: Downloaded newer image for discourse/base:2.0.20210528-1735
docker.io/discourse/base:2.0.20210528-1735
cd /pups && git pull && git checkout v1.0.3 && /pups/bin/pups --stdin
Updating 17f04ec..e0ff889
Fast-forward
 .github/workflows/ci.yml     |  29 ++++++
 .github/workflows/lint.yml   |  27 +++++
 .rubocop.yml                 |   3 +
 Gemfile                      |   2 +
 Guardfile                    |   4 +-
 README.md                    |  21 ++++
 Rakefile                     |  14 +--
 bin/pups                     |   8 +-
 lib/pups.rb                  |  32 ++++--
 lib/pups/cli.rb              |  92 ++++++++++-------
 lib/pups/command.rb          |  25 +++--
 lib/pups/config.rb           | 240 +++++++++++++++++++++++--------------------
 lib/pups/docker.rb           |  69 +++++++++++++
 lib/pups/exec_command.rb     | 182 ++++++++++++++++----------------
 lib/pups/file_command.rb     |  60 +++++------
 lib/pups/merge_command.rb    |  94 ++++++++---------
 lib/pups/replace_command.rb  |  70 +++++++------
 lib/pups/runit.rb            |  47 +++++----
 lib/pups/version.rb          |   4 +-
 pups.gemspec                 |  37 ++++---
 test/cli_test.rb             | 102 +++++++++++++++---
 test/config_test.rb          | 215 ++++++++++++++++++++++++++++----------
 test/docker_test.rb          | 157 ++++++++++++++++++++++++++++
 test/exec_command_test.rb    |  62 ++++++-----
 test/file_command_test.rb    |  17 ++-
 test/merge_command_test.rb   |  64 ++++++------
 test/replace_command_test.rb |  86 ++++++++--------
 test/test_helper.rb          |   2 +
 28 files changed, 1158 insertions(+), 607 deletions(-)
 create mode 100644 .github/workflows/ci.yml
 create mode 100644 .github/workflows/lint.yml
 create mode 100644 .rubocop.yml
 create mode 100644 lib/pups/docker.rb
 create mode 100644 test/docker_test.rb

We’ve done some troubleshooting on our side but are having trouble figuring out what the issue is here since we’ve never encountered it before. Has anyone else seen this before?

Is this a bitnami install? See Troubleshooting Bitnami Installations.

1 Like

It’s not a Bitnami install. Thanks for the link though.

But it’s not a standard install, I’m guessing?

2 Likes

That’s correct, it’s not standard. I was looking to see if anyone else with a non-standard setup had experienced similar issues.

We ended up resolving this, with one of the fixes being an update to Redis 6.2.

2 Likes