Bug #17528

[Rails] package prints a backtrace on installation when the arvados config.yml file is not present/complete

Added by Ward Vandewege 8 months ago. Updated 12 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Start date:
04/15/2021
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Description

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-5.2.4.5/lib/rails/railtie.rb:216:in `instance_eval'
/var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/railties-5.2.4.5/lib/rails/railtie.rb:216:in `configure'
/var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/railties-5.2.4.5/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-5.2.4.5/lib/active_support/dependencies.rb:291:in `block in require'
/var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies.rb:257:in `load_dependency'
/var/www/arvados-workbench/shared/vendor_bundle/ruby/2.5.0/gems/activesupport-5.2.4.5/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?


Subtasks

Task #17546: Review 17528-install-warningsResolvedTom Clegg


Related issues

Related to Arvados - Story #11167: [Workbench] Remove arv-get file download fallbackResolved07/24/2017

Related to Arvados - Bug #16470: Update to Rails 5.2Resolved08/05/2020

Associated revisions

Revision 71be4f14
Added by Tom Clegg 7 months ago

Merge branch '17528-install-warnings'

fixes #17528

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <>

History

#1 Updated by Ward Vandewege 8 months ago

  • Description updated (diff)

#2 Updated by Ward Vandewege 8 months ago

  • Subject changed from [workbench] throws a backtrace on installation when the arvados config.yml file is not present/complete to [workbench] package prints a backtrace on installation when the arvados config.yml file is not present/complete

#3 Updated by Ward Vandewege 8 months ago

  • Related to Story #11167: [Workbench] Remove arv-get file download fallback added

#4 Updated by Peter Amstutz 8 months ago

  • Assigned To set to Nico César

#5 Updated by Peter Amstutz 8 months 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

#6 Updated by Peter Amstutz 8 months ago

  • Assigned To changed from Nico César to Tom Clegg

#7 Updated by Tom Clegg 8 months ago

  • Status changed from New to In Progress

#8 Updated by Tom Clegg 8 months ago

Updates include:
  • 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_CHECK from 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 arvados-server config-check)

17528-install-warnings @ 03aade6dd988f91b1037f39754438846c4844cfb -- https://ci.arvados.org/view/Developer/job/developer-run-tests/2420/

Now "assets:precompile" does some things but fails due to missing "yarn" ... solution tbd.

#9 Updated by Tom Clegg 8 months 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.

17528-install-warnings @ 27004c7c4cffac0b61c3fb346e0bd9b155c3763c -- https://ci.arvados.org/view/Developer/job/developer-run-tests/2422/

#10 Updated by Tom Clegg 8 months ago

  • Related to Bug #16470: Update to Rails 5.2 added

#11 Updated by Tom Clegg 8 months ago

Reverted accidental change to the "please update config and then reconfigure package" behavior. (It would be great to get rid of this requirement -- but not by breaking package install even more!)

17528-install-warnings @ ef63296eb6fc46dc7261c45e5eb068d95eaa7ffd -- https://ci.arvados.org/view/Developer/job/developer-run-tests/2423/

#13 Updated by Tom Clegg 7 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Resolved

#14 Updated by Peter Amstutz 12 days ago

  • Release set to 41

Also available in: Atom PDF