Content
Error after upgrading from 13.x to 14.x: NameError: uninitialized constant Cron::CronJob (NameError)
Added by Chris Croome about 1 year ago
Hi
I have just upgraded a OpenProject server from version 13.4.2 to 14.3.0 and have this error when running openproject configure:
I, [2024-08-01T15:13:47.293273 #13095] INFO -- : Increasing database pool size to 17 to match max threads
rake aborted!
NameError: uninitialized constant Cron::CronJob (NameError)
::Cron::CronJob.register! ::Cron::ClearOldMergeRequestsJob
^^^^^^^^^
/opt/openproject/vendor/bundle/ruby/3.3.0/bundler/gems/openproject-gitlab-integration-7ae05eb72034/lib/open_project/gitlab_integration/engine.rb:105:in `block in <class:Engine>'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:448:in `instance_exec'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:448:in `block in make_lambda'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:202:in `block (2 levels) in halting'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:707:in `block (2 levels) in default_terminator'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:706:in `catch'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:706:in `block in default_terminator'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:203:in `block in halting'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `block in invoke_before'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `each'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `invoke_before'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:109:in `run_callbacks'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/reloader.rb:96:in `prepare!'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `instance_exec'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `run'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:60:in `run_initializers'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:426:in `initialize!'
/opt/openproject/config/environment.rb:33:in `<top (required)>'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.16/lib/zeitwerk/kernel.rb:34:in `require'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:402:in `require_environment!'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:588:in `block in run_tasks_blocks'
/opt/openproject/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/opt/openproject/bin/bundle:110:in `load'
/opt/openproject/bin/bundle:110:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
Has anyone else come across this before?
Does anyone have any suggestions regarding what I might be able to to do to debug / fix this issue?
Thanks!
Chris
Replies (3)
Some more detail in case it helps anyone debug this:
Remove the old GitLab integration following these steps.
Run
openproject configure --tracethis returns:Launching installer for openproject... chown: warning: '.' should be ':': ‘openproject.openproject’ chown: warning: '.' should be ':': ‘openproject.openproject’ chown: warning: '.' should be ':': ‘openproject.openproject’ Selected addons: legacy-installer openproject-edition postgres apache2 repositories memcached openproject [legacy-installer] ./bin/configure [openproject-edition] ./bin/configure DONE [postgres] ./bin/configure Trying to connect through password-based authentication... ?column? ---------- 1 (1 row) Connection OK Postgres connection OK DONE [apache2] ./bin/configure DONE [repositories] ./bin/configure No server installed. Skipping. DONE [memcached] ./bin/configure DONE [openproject] ./bin/configure DONE [legacy-installer] ./bin/preinstall [openproject-edition] ./bin/preinstall [postgres] ./bin/preinstall INFO: autoinstall=reuse. Skipping to next step. [apache2] ./bin/preinstall chown: warning: '.' should be ':': ‘openproject.openproject’ [repositories] ./bin/preinstall [memcached] ./bin/preinstall No memcached server to install. Skipping. [openproject] ./bin/preinstall [legacy-installer] ./bin/postinstall [openproject-edition] ./bin/postinstall [postgres] ./bin/postinstall chown: warning: '.' should be ':': ‘openproject.openproject’ [apache2] ./bin/postinstall [repositories] ./bin/postinstall [memcached] ./bin/postinstall [openproject] ./bin/postinstall Fetching https://github.com/btey/openproject-gitlab-integration.git Fetching gem metadata from https://rubygems.org/....... Resolving dependencies... Bundle complete! 200 Gemfile dependencies, 292 gems now installed. Gems in the groups 'development' and 'test' were not installed. Bundled gems are installed into `./vendor/bundle` 2 installed gems you directly depend on are looking for funding. Run `bundle fund` for details Custom Gemfile present. Need to recompile rails assets. Setting RECOMPILE_RAILS_ASSETS=true RECOMPILE_ANGULAR_ASSETS was set. Installing node dependencies... > openproject@0.1.0 postinstall > cd frontend && npm install up to date in 3s 242 packages are looking for funding run `npm fund` for details up to date in 4s 11 packages are looking for funding run `npm fund` for details I, [2024-08-02T10:30:03.621677 #651031] INFO -- : Increasing database pool size to 17 to match max threads rake aborted! NameError: uninitialized constant Cron::CronJob (NameError) ::Cron::CronJob.register! ::Cron::ClearOldMergeRequestsJob ^^^^^^^^^ /opt/openproject/vendor/bundle/ruby/3.3.0/bundler/gems/openproject-gitlab-integration-7ae05eb72034/lib/open_project/gitlab_integration/engine.rb:105:in `block in <class:Engine>' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:448:in `instance_exec' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:448:in `block in make_lambda' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:202:in `block (2 levels) in halting' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:707:in `block (2 levels) in default_terminator' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:706:in `catch' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:706:in `block in default_terminator' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:203:in `block in halting' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `block in invoke_before' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `each' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `invoke_before' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:109:in `run_callbacks' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/reloader.rb:96:in `prepare!' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `instance_exec' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `run' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:61:in `block in run_initializers' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:60:in `run_initializers' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:426:in `initialize!' /opt/openproject/config/environment.rb:33:in `<top (required)>' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.16/lib/zeitwerk/kernel.rb:34:in `require' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:402:in `require_environment!' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:588:in `block in run_tasks_blocks' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>' /opt/openproject/bin/bundle:110:in `load' /opt/openproject/bin/bundle:110:in `<main>' Tasks: TOP => db:migrate => db:load_config => environment (See full trace by running task with --trace)Incidently the same results are returned when the steps to remove the GitLab plugin are not followed:
openproject configure --trace Launching installer for openproject... chown: warning: '.' should be ':': ‘openproject.openproject’ chown: warning: '.' should be ':': ‘openproject.openproject’ chown: warning: '.' should be ':': ‘openproject.openproject’ Selected addons: legacy-installer openproject-edition postgres apache2 repositories memcached openproject [legacy-installer] ./bin/configure [openproject-edition] ./bin/configure DONE [postgres] ./bin/configure Trying to connect through password-based authentication... ?column? ---------- 1 (1 row) Connection OK Postgres connection OK DONE [apache2] ./bin/configure DONE [repositories] ./bin/configure No server installed. Skipping. DONE [memcached] ./bin/configure DONE [openproject] ./bin/configure DONE [legacy-installer] ./bin/preinstall [openproject-edition] ./bin/preinstall [postgres] ./bin/preinstall INFO: autoinstall=reuse. Skipping to next step. [apache2] ./bin/preinstall chown: warning: '.' should be ':': ‘openproject.openproject’ [repositories] ./bin/preinstall [memcached] ./bin/preinstall No memcached server to install. Skipping. [openproject] ./bin/preinstall [legacy-installer] ./bin/postinstall [openproject-edition] ./bin/postinstall [postgres] ./bin/postinstall chown: warning: '.' should be ':': ‘openproject.openproject’ [apache2] ./bin/postinstall [repositories] ./bin/postinstall [memcached] ./bin/postinstall [openproject] ./bin/postinstall Bundle complete! 200 Gemfile dependencies, 292 gems now installed. Gems in the groups 'development' and 'test' were not installed. Bundled gems are installed into `./vendor/bundle` 2 installed gems you directly depend on are looking for funding. Run `bundle fund` for details Custom Gemfile present. Need to recompile rails assets. Setting RECOMPILE_RAILS_ASSETS=true RECOMPILE_ANGULAR_ASSETS was set. Installing node dependencies... > openproject@0.1.0 postinstall > cd frontend && npm install up to date in 3s 242 packages are looking for funding run `npm fund` for details up to date in 3s 11 packages are looking for funding run `npm fund` for details I, [2024-08-02T11:07:18.983119 #665730] INFO -- : Increasing database pool size to 17 to match max threads rake aborted! NameError: uninitialized constant Cron::CronJob (NameError) ::Cron::CronJob.register! ::Cron::ClearOldMergeRequestsJob ^^^^^^^^^ /opt/openproject/vendor/bundle/ruby/3.3.0/bundler/gems/openproject-gitlab-integration-7ae05eb72034/lib/open_project/gitlab_integration/engine.rb:105:in `block in <class:Engine>' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:448:in `instance_exec' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:448:in `block in make_lambda' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:202:in `block (2 levels) in halting' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:707:in `block (2 levels) in default_terminator' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:706:in `catch' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:706:in `block in default_terminator' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:203:in `block in halting' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `block in invoke_before' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `each' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:598:in `invoke_before' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:109:in `run_callbacks' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/reloader.rb:96:in `prepare!' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `instance_exec' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `run' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:61:in `block in run_initializers' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:60:in `run_initializers' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:426:in `initialize!' /opt/openproject/config/environment.rb:33:in `<top (required)>' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.16/lib/zeitwerk/kernel.rb:34:in `require' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:402:in `require_environment!' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:588:in `block in run_tasks_blocks' /opt/openproject/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>' /opt/openproject/bin/bundle:110:in `load' /opt/openproject/bin/bundle:110:in `<main>' Tasks: TOP => db:migrate => db:load_config => environment (See full trace by running task with --trace)Incidently this is on a Debian Bookworm server with this version:
And the output from
openproject logsis: