Runtime error during upgrade to v3.0.3

I just responded to a ‘one click upgrade’ email notification of new security and bug fix release to 3.0.3, from my current version 3.0.1

The initial Docker Manager upgrade went fine (according to the upgrade progress report in the upgrade web page), but when I subsequently clicked ‘upgrade all’ to upgrade the remaining discourse components showing as having new version available, this failed, leaving my site offline.

Weirdly, Docker Manager is referred to here again in the subsequent upgrade progress report window, even though it had already just been separately upgraded - this time reporting that it ‘Failed to upgrade’, and ‘RuntimeError’

Am I correct in interpreting that that this was due to an outdated version of Ruby being installed on my Digital Ocean droplet (v3.1, rather than v3.2)? If so, I would have hoped that any such new dependency would have been mentioned in the update notes (it was not an issue with previous update), if not handled more gracefully by the one-click installer?

Below are the contents of that subsequent upgrade progress report window

********************************************************
*** Please be patient, next steps might take a while ***
********************************************************
Cycling Unicorn, to free up memory
Restarting unicorn pid: 575
Waiting for Unicorn to reload.
Waiting for Unicorn to reload..
Waiting for Unicorn to reload...
Waiting for Unicorn to reload....
Waiting for Unicorn to reload.....
Waiting for Unicorn to reload......
Waiting for Unicorn to reload.......
Waiting for Unicorn to reload........
Waiting for Unicorn to reload.........
Using net-protocol 0.2.1
Fetching addressable 2.8.4
Installing addressable 2.8.4
Using aws-sigv4 1.5.0
Using openssl-signature_algorithm 1.3.0
Using sprockets 3.7.2 from https://github.com/rails/sprockets (at 3.x@f4d3dae)
Using request_store 1.5.1
Using message_bus 4.3.2
Using pry 0.14.2
Fetching rack-mini-profiler 3.1.0
Installing rack-mini-profiler 3.1.0
Fetching rack-protection 3.0.6
Installing rack-protection 3.0.6
Using ecma-re-validator 0.4.0
Using faraday 2.7.4
Using image_optim 0.31.3
Using logstash-logger 0.26.1
Using mini_racer 0.6.3
Using mini_suffix 0.3.3
Using omniauth 1.9.2
Using uglifier 4.2.0
Using web-push 3.0.0
Using sidekiq 6.5.8
Using redis-namespace 1.10.0
Using net-http 0.3.2
Using oauth-tty 1.0.5
Using snaky_hash 2.0.1
Using activesupport 7.0.4.3
Fetching sass-embedded 1.62.0 (x86_64-linux-gnu)
Installing sass-embedded 1.62.0 (x86_64-linux-gnu)
Using rqrcode 2.1.2
Using rss 0.2.9
Fetching tzinfo-data 1.2023.3
Installing tzinfo-data 1.2023.3
Using unf 0.1.4
Using unicorn 6.1.0
Fetching loofah 2.20.0
Installing loofah 2.20.0
Using ruby-readability 0.7.0
Using sanitize 6.0.1
Using net-imap 0.3.4
Using net-pop 0.1.2
Using net-smtp 0.3.3
Using css_parser 1.14.0
Using aws-sdk-core 3.130.2
Using cose 1.3.0
Using pry-byebug 3.10.1
Using pry-rails 0.3.9
Using json_schemer 0.2.23
Using faraday-retry 2.1.0
Using oauth2 1.4.11
Using rtlcss 0.2.0
Using rails-dom-testing 2.0.3
Using globalid 1.1.0
Using activemodel 7.0.4.3
Using mini_scheduler 0.15.0
Using oauth 1.1.0
Using dartsass-ruby 3.0.1
Using rails-html-sanitizer 1.5.0
Fetching mail 2.8.1
Installing mail 2.8.1
Using aws-sdk-kms 1.56.0
Using aws-sdk-sns 1.53.0
Using actionview 7.0.4.3
Using activejob 7.0.4.3
Using active_model_serializers 0.8.4
Using activerecord 7.0.4.3
Using omniauth-oauth2 1.7.3
Using omniauth-oauth 1.2.0
Using aws-sdk-s3 1.114.0
Using actionpack 7.0.4.3
Using actionview_precompiler 0.2.3
Using discourse-seed-fu 2.3.12
Using omniauth-facebook 9.0.0
Using omniauth-github 1.4.0
Using omniauth-google-oauth2 0.8.2
Using omniauth-twitter 1.4.0
Using actionmailer 7.0.4.3
Using railties 7.0.4.3
Using sprockets-rails 3.4.2
Using dartsass-sprockets 3.0.0
Using lograge 0.12.0
Fetching rails_failover 1.0.0
Installing rails_failover 1.0.0
Using rails_multisite 4.0.1
Fetching puma 6.2.2
Installing puma 6.2.2 with native extensions
Using bootsnap 1.16.0
Using rbtrace 0.4.14
Bundle complete! 136 Gemfile dependencies, 174 gems now installed.
Gems in the groups 'test' and 'development' were not installed.
Bundled gems are installed into `./vendor/bundle`
$ yarn install --production
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @mixer/parallel-prettier@2.0.3" has unmet peer dependency "prettier@^2.0.0".
warning "eslint-config-discourse > eslint-plugin-lodash@7.1.0" has unmet peer dependency "lodash@>=4".
[5/5] Building fresh packages...
$ yarn --cwd app/assets/javascripts $(node -e 'if(JSON.parse(process.env.npm_config_argv).original.includes(`--frozen-lockfile`)){console.log(`--frozen-lockfile`)}')
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > babel-plugin-debug-macros@0.4.0-pre1" has unmet peer dependency "@babel/core@^7.0.0".
warning "workspace-aggregator-61483bea-5d74-44aa-a245-abffc0a6319e > discourse > @uppy/aws-s3@3.0.6" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-61483bea-5d74-44aa-a245-abffc0a6319e > discourse > @uppy/aws-s3-multipart@3.1.3" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-61483bea-5d74-44aa-a245-abffc0a6319e > discourse > @uppy/xhr-upload@3.1.1" has incorrect peer dependency "@uppy/core@^3.1.2".
[4/4] Building fresh packages...
success Saved lockfile.
$ patch-package
patch-package 6.5.1
Applying patches...
@ember/jquery@2.0.0 ✔
virtual-dom@2.1.1 ✔
Done in 23.96s.
Done in 40.79s.
$ LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all
Discourse requires Ruby 3.2 or above
Unable checkout compatible plugin versions
$ SKIP_POST_DEPLOYMENT_MIGRATIONS=1 bundle exec rake multisite:migrate
Discourse requires Ruby 3.2 or above
Docker Manager: FAILED TO UPGRADE
#<RuntimeError: RuntimeError>
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:202:in `run'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:101:in `upgrade'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:19:in `block in <main>'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `fork'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/commands/runner/runner_command.rb:43:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/commands/runner/runner_command.rb:43:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
bin/rails:18:in `<main>'
Spinning up 1 Unicorn worker(s) that were stopped initially

I will go through the steps to rebuild my site via Putty, but am reporting the above in case there is a bug with the installer.

3 Likes

I’m getting something similar. Dead in water on the forum currently . . .

I will know more tomorrow when I’m not falling asleep. I guess this is a “second that.”

-Walker

1 Like

You need to pull a new version of the Docker image.

By the way - that error only occurs on 3.1.0.beta4 and up, not in 3.0.3 stable.

2 Likes

Looks like docker manager needs to know that it can’t do an upgrade, right? It should be requiring a command line rebuild after it gets upgraded. I thought that I had seen a version bump in the commits a while back but I guess I’m wrong about that.

So you’ll need to

./launcher rebuild app

4 Likes

Thanks - yes the issue was resolved for me when I rebuilt via Putty.

1 Like

Yeah, this happened quite recently. Update minimum image version for Ruby 3.2 (#176) · discourse/docker_manager@7e7b6b5 · GitHub

Docker Manager should prompt for a command line rebuild when that requirement isn’t met. :thinking:

4 Likes

So maybe there is some bug or regression? But I guess you guys are checking on that. It seems like a bug if docker manager doesn’t know it can’t succeed.

3 Likes

Can you confirm these versions? As @RGJ said in a post below, the stable versions do not require Ruby 3.2, so you shouldn’t see those errors while upgrading in the stable branch.

Did you by any chance try to upgrade from v3.1.0.beta1 (or an even older version) to v3.1.0.beta4?

The problem is that we are pinning docker_manager to an old version for Discourse v3.1.0.beta1 and below. You will see something like this.

Upgrading to v3.1.0.beta4 will require Ruby 3.2, but there’s a chance that you are running a Docker image that didn’t come with Ruby 3.2 yet. The old docker_manager thinks that’s fine, so it allows you to upgrade in the UI, while it should prompt for a CLI rebuild.

I’m in the process of reproducing the problem. I think the fix will be to make changes to the pinned version, so that it prompts for a CLI rebuild. I’ll try to come up with a fix…

2 Likes

I saw this for two sites yesterday that are on tests passed. I’m not entirely sure of the version that they were upgrading from. Sorry not to have better data.

1 Like

I can’t be sure now that the upgrade has completed - but I think it may well have been a 3.0.1 beta that I was upgrading from ** edit ** - NOT a 3.10 beta

1 Like

Wait. You can’t go from 3.1 beta to 3.0.3 stable?

Ok, the version has changed again, but I am pretty sure I was trying to upgrade from 3.0.1 (possibly a beta) to 3.0.3 stable, which at that point seemed to be the most recent stable option. . I see that after that failed and I rebuilt in Putty, the result had skipped over the intended version 3.0.3, and actually installed a 3.1.0 beta 4.

Yes, that failed, because you cannot go from 3.1 beta to 3.0 stable.

I did not start from 3.1 beta. I started from 3.0.1 beta

There is no 3.01, it is either 3.0.1 or 3.1.0.
But it doesn’t really matter. Your situation happened because you were going to 3.1.0 beta4.

1 Like

This is my point - I started from 3.0.1 beta, and the emailed one click upgrade notification was to 3.0.3 stable - which upgrade failed. At that point I had not been presented with an option to go to 3.1.0 beta.

Perhaps part of the problem was that instead of installing the 3.0.3 stable version ‘advertised’, the updater attempted to install 3.1.0 beta?

Either way, as far as I know the only reason I have 3.1.0 beta installed now, is due to rebuilding via Putty, which pulled the most recent beta version, not the most recent stable version.

The root cause will be fixed as soon as FIX: Update compatibility file for v3.1.0.beta1 and below by gschlager · Pull Request #178 · discourse/docker_manager · GitHub is merged.

4 Likes