[solved] Error after upgrade « undefined method assets »
Added by Alexandre Russo over 1 year ago
Hello,
After upgrade from 5.0.4-5~bpo11+1 to 5.0.4-5~bpo11+2 (bullseye backports) on debian
Réception de :1 http://deb.debian.org/debian bullseye-backports/main amd64 redmine-mysql all 5.0.4-5~bpo11+2 [128 kB] Réception de :2 http://deb.debian.org/debian bullseye-backports/main amd64 redmine all 5.0.4-5~bpo11+2 [1 324 kB] Réception de :3 https://packages.gitlab.com/gitlab/gitlab-ee/debian bullseye/main amd64 gitlab-ee amd64 16.1.2-ee.0 [1 415 MB] 1 416 Mo réceptionnés en 19s (74,1 Mo/s) Préconfiguration des paquets... (Lecture de la base de données... 221975 fichiers et répertoires déjà installés.) Préparation du dépaquetage de .../redmine-mysql_5.0.4-5~bpo11+2_all.deb ... Dépaquetage de redmine-mysql (5.0.4-5~bpo11+2) sur (5.0.4-5~bpo11+1) ... Préparation du dépaquetage de .../redmine_5.0.4-5~bpo11+2_all.deb ... Determining localhost credentials from /etc/mysql/debian.cnf: succeeded. Dépaquetage de redmine (5.0.4-5~bpo11+2) sur (5.0.4-5~bpo11+1) ...
i had one error :
Paramétrage de redmine (5.0.4-5~bpo11+2) ... /var/lib/dpkg/info/redmine.postinst: 7: [[: not found Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine. /var/lib/dpkg/info/redmine.postinst: 57: [[: not found dbconfig-common: writing config to /etc/dbconfig-common/redmine/instances/default.conf dbconfig-common: flushing administrative password
But now i have this error :
App 15176 stdout: App 15176 stdout: [ 2023-07-18 11:54:10.9780 698/7f6e981fa700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/redmine: An error occurred while starting up the preloader. Error ID: d1bb32cf Error details saved to: /tmp/passenger-error-agcwHW.html Message from application: undefined method `assets' for #<Rails::Application::Configuration:0x00005600cc593058> Did you mean? asset_host (NoMethodError) /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/railtie/configuration.rb:97:in `method_missing' /usr/share/redmine/config/initializers/assets.rb:4:in `<top (required)>' /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:326:in `load' /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:326:in `block in load' /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:326:in `load' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:681:in `block in load_config_initializer' /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:205:in `instrument' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:680:in `load_config_initializer' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:634:in `block (2 levels) in <class:Engine>' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:633:in `each' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:633:in `block in <class:Engine>' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:32:in `instance_exec' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:32:in `run' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:61:in `block in run_initializers' /usr/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each' /usr/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' /usr/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' /usr/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from' /usr/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:50:in `each' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:50:in `tsort_each_child' /usr/lib/ruby/2.7.0/tsort.rb:415:in `call' /usr/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from' /usr/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component' /usr/lib/ruby/2.7.0/tsort.rb:347:in `each' /usr/lib/ruby/2.7.0/tsort.rb:347:in `call' /usr/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component' /usr/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each' /usr/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:60:in `run_initializers' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/application.rb:391:in `initialize!' /usr/share/redmine/config/environment.rb:16:in `<top (required)>' config.ru:3:in `require' config.ru:3:in `block in <main>' /var/lib/gems/2.7.0/gems/rack-2.2.6.4/lib/rack/builder.rb:125:in `instance_eval' /var/lib/gems/2.7.0/gems/rack-2.2.6.4/lib/rack/builder.rb:125:in `initialize' config.ru:1:in `new' config.ru:1:in `<main>' /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval' /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>' /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>' [ 2023-07-18 11:54:10.9837 698/7f6e99c01700 age/Cor/Con/CheckoutSession.cpp:283 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is d1bb32cf. Please see earlier logs for details about the error.
If i run `bin/about` i have this error :
$ RAILS_ENV=production ./bin/about Traceback (most recent call last): 35: from ./bin/about:4:in `<main>' 34: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require' 33: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require' 32: from /usr/share/redmine/config/environment.rb:16:in `<top (required)>' 31: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/application.rb:391:in `initialize!' 30: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:60:in `run_initializers' 29: from /usr/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each' 28: from /usr/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each' 27: from /usr/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component' 26: from /usr/lib/ruby/2.7.0/tsort.rb:347:in `call' 25: from /usr/lib/ruby/2.7.0/tsort.rb:347:in `each' 24: from /usr/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component' 23: from /usr/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from' 22: from /usr/lib/ruby/2.7.0/tsort.rb:415:in `call' 21: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:50:in `tsort_each_child' 20: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:50:in `each' 19: from /usr/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from' 18: from /usr/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from' 17: from /usr/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' 16: from /usr/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 15: from /usr/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each' 14: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:61:in `block in run_initializers' 13: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:32:in `run' 12: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/initializable.rb:32:in `instance_exec' 11: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:633:in `block in <class:Engine>' 10: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:633:in `each' 9: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:634:in `block (2 levels) in <class:Engine>' 8: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:680:in `load_config_initializer' 7: from /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:205:in `instrument' 6: from /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:681:in `block in load_config_initializer' 5: from /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:326:in `load' 4: from /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency' 3: from /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:326:in `block in load' 2: from /var/lib/gems/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:326:in `load' 1: from /usr/share/redmine/config/initializers/assets.rb:4:in `<top (required)>' /var/lib/gems/2.7.0/gems/railties-6.1.7.3/lib/rails/railtie/configuration.rb:97:in `method_missing': undefined method `assets' for #<Rails::Application::Configuration:0x0000560daf3ba430> (NoMethodError) Did you mean? asset_host
Someone know how to fix it ?
Replies (2)
RE: Error after upgrade « undefined method assets » - Added by Holger Just over 1 year ago
It appears that you have added a custom file in /usr/share/redmine/config/initializers/assets.rb
which tries to call an undefined assets
method. This file is not present neither in "plain" Redmine, nor in the Debian package and thus was likely added by yourself or a previous admin.
Your Redmine may start again if you remove the file. However, if you (or some other admin) has performed other code changes (such as adding / removing / editing any of the core Redmine files), other things may break in different ways. Unless you are sure what you are doping and are willing to maintain each change, we would thus recommend to not change any Redmine code yourself and use the unchanged releases code instead.