Upgrade failed (NoMethodError: undefined method `register_bookmarkable' for Bookmark:Class)

Performing an upgrade in the Admin web interface, from 3.1.0.beta2 to beta3, I think I successfully finished the Docker Manager upgrade and then the main Discourse upgrade failed like so:

$ 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/discourse $(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-0156df5c-af27-46bf-a6aa-a0a12748bb32 > discourse > @uppy/xhr-upload@3.1.0" has incorrect peer dependency "@uppy/core@^3.0.6".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 20.00s.
Done in 44.16s.
$ LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all
discourse-data-explorer is already at latest compatible version
docker_manager is already at latest compatible version
$ SKIP_POST_DEPLOYMENT_MIGRATIONS=1 bundle exec rake multisite:migrate
rake aborted!
NoMethodError: undefined method `register_bookmarkable' for Bookmark:Class
Did you mean?  registered_bookmarkables
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/var/www/discourse/plugins/discourse-data-explorer/plugin.rb:902:in `block in activate!'
/var/www/discourse/lib/plugin/instance.rb:503:in `block in notify_after_initialize'
/var/www/discourse/lib/plugin/instance.rb:501:in `each'
/var/www/discourse/lib/plugin/instance.rb:501:in `notify_after_initialize'
/var/www/discourse/config/application.rb:228:in `each'
/var/www/discourse/config/application.rb:228:in `block (2 levels) in <class:Application>'
/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
/var/www/discourse/config/application.rb:228:in `block in <class:Application>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:92:in `block in execute_hook'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:76:in `block in run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:75:in `each'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:75:in `run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/application/finisher.rb:87:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/application.rb:372:in `initialize!'
/var/www/discourse/config/environment.rb:7: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'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/application.rb:348:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/application.rb:511:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/cli/exec.rb:58:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/cli/exec.rb:58:in `kernel_load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/cli/exec.rb:23:in `run'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/cli.rb:491:in `exec'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/cli.rb:34:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/cli.rb:28:in `start'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/exe/bundle:45:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bundler-2.4.4/exe/bundle:33:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/bin/bundle:25:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/bin/bundle:25:in `<main>'
Tasks: TOP => multisite:migrate => db:load_config => environment
(See full trace by running task with --trace)
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.1/lib/rails/commands/runner/runner_command.rb:43:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.1/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.1/lib/rails/command/base.rb:87:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.1/lib/rails/command.rb:48:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.1/lib/rails/commands.rb:18:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.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.15.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

The forum is running, but the state of play is unclear (to me) - the upgrade page now suggests I’m at latest-release +24, that docker_manager is up to date at e90c8f55 and that Data Explorer is the only component which needs an upgrade. But the dashboard still says I’m at beta2 (b96869d5fb).

What to do? My best guess is to perform a CLI upgrade. I’ve put the forum into read-only mode for now.

2 Likes

I found a couple of recent changes in the code which look like they might be responsible, and it looks like perhaps there’s a conflict with my now-out-of-date discourse-data-explorer plugin.

So, as I can do without that plugin for now, I’ve removed that line from my app.yml and done a rebuild. (I could have tried a rebuild as-is, but I’m already a couple of hours offline.) And that succeeded, so I’m back up.

(I see my actions as a workaround, not a fix.)

The possibly related changes are

1 Like

I just hit this exact same error trying to upgrade from 3.1.0.beta2 to 3.1.0.beta3. This happened in my non-production box that I use to “practice” upgrades before performing them on the production box.

In my case, the forum was down after I encountered the error.

Removing the discourse-data-explorer plugin line from my app.yml and rebuilding worked around the problem.

Many thanks to @Ed_S for saving me tons of time with this helpful post!

1 Like

For what its worth, I reverted my VM a few times and retried this upgrade 2 different ways:

Way #1 - Do the upgrade, and then do a rebuild right after the error.

Way #2 - Remove discourse-data-explorer plugin from app.yml, rebuild, re-add discourse-data-explorer plugin to app.yml, rebuild.

Both seemed to work fine. I’ll also note that the above rebuilds also have the effect of upgrading the install to 3.1.0.beta3. However, the error in Way #1 has me nervous that some file or data might get left in an non-optimal state due to the interrupted upgrade. So, I’ll likely do Way #2 in production.

1 Like