# Ошибка при обновлении Discourse до последней версии — возможна проблема с db:migrate

**URL:** https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [02.Март.2022 22:04:53 UTC](https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895 "2022-03-02T22:04:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hollyw](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@hollyw](https://meta.discourse.org/u/hollyw)
#### Post date: [02.Март.2022 22:04:53 UTC](https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895/1 "2022-03-02T22:04:53Z")

</div>

При попытке обновить наш экземпляр Discourse до последней версии в логах появляется следующая ошибка:

```plaintext
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'.

```

Прокрутив вверх, я вижу следующее:

> **More Logs**
>
> ```plaintext
> 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
> 
> ```

Мы провели некоторую диагностику с нашей стороны, но не можем понять, в чём именно проблема, так как ранее с этим не сталкивались. Сталкивался ли кто-то ещё с подобным?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [02.Март.2022 22:45:38 UTC](https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895/2 "2022-03-02T22:45:38Z")

</div>

Это установка Bitnami? См. [Устранение неполадок при установке Bitnami](https://meta.discourse.org/t/troubleshooting-bitnami-installations/142538).

---

<div class="post-metadata">

### Author: ![hollyw](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@hollyw](https://meta.discourse.org/u/hollyw)
#### Post date: [03.Март.2022 15:23:41 UTC](https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895/3 "2022-03-03T15:23:41Z")

</div>

Это не установка Bitnami. Спасибо за ссылку.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [03.Март.2022 16:18:05 UTC](https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895/4 "2022-03-03T16:18:05Z")

</div>

> [@hollyw](#):
>
> ```plaintext
> /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.7.17/lib/chef/provider.rb:182:in `run_action'
> 
> ```

Но это, я так понимаю, не стандартная установка?

---

<div class="post-metadata">

### Author: ![hollyw](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@hollyw](https://meta.discourse.org/u/hollyw)
#### Post date: [01.Апрель.2022 19:30:38 UTC](https://meta.discourse.org/t/error-when-updating-discourse-to-latest-version-potential-db-migrate-issue/219895/5 "2022-04-01T19:30:38Z")

</div>

Верно, это не стандартная настройка. Я хотел узнать, сталкивался ли кто-то ещё с подобными проблемами при нестандартной конфигурации.

В итоге мы решили эту проблему, одним из решений стало обновление Redis до версии 6.2.
