Project

General

Profile

Actions

Bug #17528

closed

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

Added by Ward Vandewege almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
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 1 (0 open1 closed)

Task #17546: Review 17528-install-warningsResolvedTom Clegg04/15/2021Actions

Related issues

Related to Arvados - Idea #11167: [Workbench] Remove arv-get file download fallbackResolvedLucas Di Pentima07/24/2017Actions
Related to Arvados - Bug #16470: Update to Rails 5.2ResolvedLucas Di Pentima08/05/2020Actions
Actions #1

Updated by Ward Vandewege almost 3 years ago

  • Description updated (diff)
Actions #2

Updated by Ward Vandewege almost 3 years 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
Actions #3

Updated by Ward Vandewege almost 3 years ago

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

Updated by Peter Amstutz almost 3 years ago

  • Assigned To set to Nico César
Actions #5

Updated by Peter Amstutz almost 3 years 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
Actions #6

Updated by Peter Amstutz almost 3 years ago

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

Updated by Tom Clegg almost 3 years ago

  • Status changed from New to In Progress
Actions #8

Updated by Tom Clegg almost 3 years 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 -- developer-run-tests: #2420

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

Actions #9

Updated by Tom Clegg almost 3 years 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 -- developer-run-tests: #2422

Actions #10

Updated by Tom Clegg almost 3 years ago

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

Updated by Tom Clegg almost 3 years 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 -- developer-run-tests: #2423

Actions #13

Updated by Tom Clegg almost 3 years ago

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

Updated by Peter Amstutz over 2 years ago

  • Release set to 41
Actions

Also available in: Atom PDF