[Rails] package prints a backtrace on installation when the arvados config.yml file is not present/complete
When installing workbench1 or rails API on a system without config.yml (or with an incomplete config.yml):
Running transaction Installing : arvados-workbench-2.2.0~dev20210413145725-1.x86_64 1/1 WARNING: Unsupported init system. Can't manage web service. WARNING: Web service (Nginx or Apache) not found. To override, set the WEB_SERVICE environment variable to the name of the service hosting the Rails server. For Debian-based systems, then reconfigure this package with dpkg-reconfigure. For RPM-based systems, then reinstall this package. Assumption: is configured to serve Rails from /var/www/arvados-workbench/current Assumption: and passenger run as apache Creating symlinks to configuration in /etc/arvados/workbench ...... done. Running bundle install... done. Ensuring directory and file permissions ...... done. Checking configuration for completeness...Called 'load' without the :safe option -- defaulting to safe mode. You can avoid this warning in the future by setting the SafeYAML::OPTIONS[:default_mode] option (to :safe or :unsafe). open /etc/arvados/config.yml: no such file or directory rake aborted! Keep-web service must be configured in Services.WebDAV and/or Services.WebDAVDownload /var/www/arvados-workbench/current/lib/config_validators.rb:23:in `validate_download_config' /var/www/arvados-workbench/current/config/arvados_config.rb:193:in `block in <top (required)>' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/railties-22.214.171.124/lib/rails/railtie.rb:216:in `instance_eval' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/railties-126.96.36.199/lib/rails/railtie.rb:216:in `configure' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/railties-188.8.131.52/lib/rails/railtie.rb:174:in `configure' /var/www/arvados-workbench/current/config/arvados_config.rb:184:in `<top (required)>' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/activesupport-184.108.40.206/lib/active_support/dependencies.rb:291:in `block in require' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/activesupport-220.127.116.11/lib/active_support/dependencies.rb:257:in `load_dependency' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/activesupport-18.104.22.168/lib/active_support/dependencies.rb:291:in `require' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:49:in `require_relative' /var/www/arvados-workbench/current/config/application.rb:31:in `<class:Application>' /var/www/arvados-workbench/current/config/application.rb:29:in `<module:ArvadosWorkbench>' /var/www/arvados-workbench/current/config/application.rb:28:in `<top (required)>' /var/www/arvados-workbench/current/Rakefile:9:in `require' /var/www/arvados-workbench/current/Rakefile:9:in `<top (required)>' /var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>' /usr/local/rvm/gems/ruby-2.5.8/bin/bundle:23:in `load' /usr/local/rvm/gems/ruby-2.5.8/bin/bundle:23:in `<main>' /usr/local/rvm/gems/ruby-2.5.8/bin/ruby_executable_hooks:24:in `eval' /usr/local/rvm/gems/ruby-2.5.8/bin/ruby_executable_hooks:24:in `<main>' (See full trace by running task with --trace) failed. Precompiling assets... skipped. PLEASE NOTE: The arvados-workbench package was not configured completely because /etc/arvados/config.yml needs some tweaking. Please refer to the documentation at <http://doc.arvados.org/install/install-workbench-app.html#configure> for more details. When config.yml has been modified, reconfigure or reinstall this package. Verifying : arvados-workbench-2.2.0~dev20210413145725-1.x86_64 1/1 Installed: arvados-workbench.x86_64 0:2.2.0~dev20210413145725-1 Complete!
The good: the package installs and tells the user what happened (config not good enough) and what to do (reconfigure/reinstall package).
The bad: the package needs to be reconfigured/reinstalled after config.yml is tweaked.
The ugly: there is a backtrace printed.
To close this bug, at a minimum, we should not print that backtrace.
For bonus points: ideally, the package reconfigure/reinstall step wouldn't be needed. Can we create a default that makes sense? Or use package dependencies to make sure config.yml is already in good shape before installation? How do other packages handle this kind of configuration requirement?
#5 Updated by Peter Amstutz about 1 year ago
- Description updated (diff)
- Subject changed from [workbench] package prints a backtrace on installation when the arvados config.yml file is not present/complete to [Rails] package prints a backtrace on installation when the arvados config.yml file is not present/complete
#8 Updated by Tom Clegg about 1 year ago
- Set SafeYAML::OPTIONS to avoid useless warning from Workbench rake tasks (we had already done this in RailsAPI but not WB1)
- Remove stale
$RAILSPKG_SUPPORTS_CONFIG_CHECKfrom postinst script (it was always 1)
- In postinst, when running assets:precompile, set $ARVADOS_CONFIG to the magic string "none", and recognize that in Rails config loaders to mean "don't even try loading site config"
- Remove obsolete check for empty BlobSigningKey (we've already added this check to
Now "assets:precompile" does some things but fails due to missing "yarn" ... solution tbd.
#9 Updated by Tom Clegg about 1 year ago
Rails uses the [non-]existence of the bin/yarn stub to indicate whether yarn is being used. Our assets are built with npm, so I removed bin/yarn to eliminate misleading log messages ("Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install").
Setting ARVADOS_CONFIG=none in the "assets:precompile" step in run-build-packages.sh should eliminate misleading error messages at package build time.
It is unnecessary to run "assets:precompile" again at install time so I removed it from postinst.