# Failed upgrade v3.0.1 to v3.0.2

**URL:** <https://meta.discourse.org/t/failed-upgrade-v3-0-1-to-v3-0-2/259255>\
**Category:** Self-hosting\
**Created:** [March 24, 2023, 9:02am UTC](https://meta.discourse.org/t/failed-upgrade-v3-0-1-to-v3-0-2/259255 "2023-03-24T09:02:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swarndeep\_Poddar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swarndeep_poddar/32/231276_2.png) [@Swarndeep\_Poddar](https://meta.discourse.org/u/Swarndeep_Poddar)\
**Post date:** [March 24, 2023, 9:02am UTC](https://meta.discourse.org/t/failed-upgrade-v3-0-1-to-v3-0-2/259255/1 "2023-03-24T09:02:22Z")

</div>

Here is the message .  
I, [2023-03-23T15:14:16.270826 #1] INFO – : \> cd /var/www/discourse && su discourse -c ‘bundle install --deployment --retry 3 --jobs 4 --verbose --without test development’  
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag  
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'test development'`, and stop using this flag

> **Bundler::InstallError: web-push-3.0.0 requires ruby version \>= 3.0, which is incompatible with the current version, 2.7.6**  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/installer.rb:233:in `block in ensure_specs_are_compatible!' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/spec_set.rb:155:in `each’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/spec\_set.rb:155:in `each' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/installer.rb:231:in `ensure\_specs\_are\_compatible!’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/installer.rb:83:in `block in run' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/process_lock.rb:12:in `block in lock’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/process\_lock.rb:9:in `open' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/process_lock.rb:9:in `lock’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/installer.rb:71:in `run' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/installer.rb:23:in `install’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/cli/install.rb:62:in `run' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/cli.rb:260:in `block in install’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/settings.rb:131:in `temporary' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/cli.rb:259:in `install’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke\_command’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/cli.rb:34:in `dispatch’  
> /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.1/lib/bundler/cli.rb:28:in `start’

* * *

* * *

Looking up gems [“powerbar”, “middleware”, “pattern-match”, “coffee-script-source”, “virtus”, “needle”, “jruby-pageant”, “bcrypt\_pbkdf”, “rbnacl”, “rbnacl-libsodium”]  
HTTP GET [https://index.rubygems.org/info/middleware](https://index.rubygems.org/info/middleware)  
HTTP 200 OK [https://index.rubygems.org/info/middleware](https://index.rubygems.org/info/middleware)  
Looking up gems [“ansi”, “descendants\_tracker”, “axiom-types”, “coercible”, “equalizer”]  
Looking up gems [“ice\_nine”, “adamantium”]  
Looking up gems [“memoizable”]

## FAILED

Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle install --deployment --retry 3 --jobs 4 --verbose --without test development’ failed with return #\<Process::Status: pid 324 exit 5\>  
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec\_command.rb:117:in `spawn’  
exec failed with the params {“cd”=\>“$home”, “hook”=\>“bundle\_exec”, “cmd”=\>[“su discourse -c ‘bundle install --deployment --retry 3 --jobs 4 --verbose --without test development’”]}  
bootstrap failed with exit code 5  
\*\* 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.  
58f4a7f8ec4aa127e0b28260dd525155e6d18554aa5a8bbd4b8036374e5b2fe5  
make: \*\*\* [Makefile:44: build] Error 1

**How can we upgrade ruby version to \>3.0?**

---

<div class="post-metadata">

**Author:** ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)\
**Post date:** [March 24, 2023, 9:20am UTC](https://meta.discourse.org/t/failed-upgrade-v3-0-1-to-v3-0-2/259255/2 "2023-03-24T09:20:08Z")

</div>

What kind of installation do you have? It doesn’t look like a [standard install](https://meta.discourse.org/t/142537?silent=true).

My understanding is that a [standard install](https://meta.discourse.org/t/142537?silent=true) can be command-line upgraded, although it might take two attempts. If you get stuck with a wrong version of ruby then you have an unusual setup.

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [March 24, 2023, 1:21pm UTC](https://meta.discourse.org/t/failed-upgrade-v3-0-1-to-v3-0-2/259255/3 "2023-03-24T13:21:26Z")

</div>

Can you please try a command line rebuild?

---

<div class="post-metadata">

**Author:** ![Swarndeep\_Poddar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swarndeep_poddar/32/231276_2.png) [@Swarndeep\_Poddar](https://meta.discourse.org/u/Swarndeep_Poddar)\
**Post date:** [March 24, 2023, 5:51pm UTC](https://meta.discourse.org/t/failed-upgrade-v3-0-1-to-v3-0-2/259255/4 "2023-03-24T17:51:53Z")

</div>

Here is my app.yml file.

```plaintext
templates:
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
  - "templates/weekly.report.template.yml"
nginx,

params:
  version: stable

env:
  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8
  LANGUAGE: en_US.UTF-8
  # DISCOURSE_DEFAULT_LOCALE: en

  DISCOURSE_HOSTNAME: 'XXXXXX.changeme.com'

  
  DISCOURSE_DEVELOPER_EMAILS: ''

  
  DISCOURSE_SMTP_ADDRESS: 127.0.0.1
  DISCOURSE_SMTP_PORT: 2525
  DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)
  
  
  DISCOURSE_DB_USERNAME: XXXXXX
  DISCOURSE_DB_PASSWORD: XXXXXXX
  DISCOURSE_DB_HOST: 172.17.0.1
  DISCOURSE_REDIS_HOST: 172.17.0.1

  
volumes:
  - volume:
      host: /var/discourse/shared/web-only
      guest: /shared
  - volume:
      host: /var/discourse/shared/web-only/log/var-log
      guest: /var/log

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-user-notes.git
    - exec:
        cd: $home
        cmd:
          - git fetch --tags
          - git checkout tags/v3.0.2
run:
  - exec: echo "Beginning of custom commands"

  - exec: 
      cmd:
        - echo "Updating Yarn apt key"
        - "curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -"

  - exec:
      cmd:
        - echo "Adding GCS-Fuse to the Image"
        - "curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -"

  - file:
      path: /etc/apt/sources.list.d/gcsfuse.list
      contents: |
        deb http://packages.cloud.google.com/apt gcsfuse-buster main

  - exec:
      cmd:
        - apt-get -y update
        - apt-get -y install gcsfuse
        - mkdir -p /shared/bucket
        - echo "Done with adding GCS-Fuse to the Image"

  - exec:
      cmd:
        - echo "Adding PostgreSQL 14 to the Image."
        - apt-get -y update
        - apt-get -y install postgresql-14
        - pg_dropcluster 13 main

  # fix the backups and uploads patchs to point into the gcs bucket
  - exec: ln -sf /shared/bucket/discourse/backups /var/www/discourse/public/
  - exec: ln -sf /shared/bucket/discourse/uploads /var/www/discourse/public/
  # fix the weekly reports into the gcs bucket sync
  - exec: ln -sf /shared/bucket/weekly_reports /var/www/discourse/public/

  # log to stdout, even in production for logs explorer
  - replace:
      filename: /etc/nginx/conf.d/discourse.conf
      from: 'access_log /var/log/nginx/access.log log_discourse;'
      to: 'access_log /dev/stdout log_discourse;'

  - replace:
      filename: /var/www/discourse/config/unicorn.conf.rb
      from: 'if ENV["RAILS_ENV"] != "production"'
      to: 'if ENV["RAILS_ENV"] == "production"'
  - exec: 'echo "Rails.logger = Logger.new(STDOUT)" >> /var/www/discourse/config/application.rb'

  # fix rsync for gcsfuse and restores (b/226700873#comment8)
  - replace:
      filename: /var/www/discourse/lib/file_store/local_store.rb
      from: "'rsync', '-a', '--safe-links', \"#{source_path}/\", \"#{upload_path}/\","
      to: "'rsync', '-a', '--safe-links', \"#{source_path}/\", \"#{upload_path}/\", '--inplace', '--no-times', '--update', '--no-perms', '--no-owner', '--no-group',"
        
        
  - exec: echo "End of custom commands"
  - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'

```
