Bug 1721378 - foreman-maintain backup offline failed with undefined method `&' for "":String
Summary: foreman-maintain backup offline failed with undefined method `&' for "":String
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.6.0
Assignee: Martin Bacovsky
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-18 07:13 UTC by Nikhil Kathole
Modified: 2019-11-15 19:49 UTC (History)
8 users (show)

Fixed In Version: rubygem-foreman_maintain-0.4.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 16:36:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27070 0 Normal Closed foreman-maintain backup offline failed with undefined method `&' for "":String 2020-11-02 15:27:03 UTC
Red Hat Product Errata RHBA-2019:3181 0 None None None 2019-10-22 16:37:00 UTC

Description Nikhil Kathole 2019-06-18 07:13:34 UTC
Description of problem:

foreman-maintain backup offline failed with undefined method `&' for "":String

- All services stopped                                                [OK]      
--------------------------------------------------------------------------------
Backup config files: 
\ Collecting config files to backup                                   [FAIL]    
undefined method `&' for "":String
--------------------------------------------------------------------------------
Scenario [Backup] failed.

The following steps ended up in failing state:

  [backup-config-files]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="backup-config-files"


Version-Release number of selected component (if applicable):

Satellite 6.6 snap 7

# rpm -qa | grep maintain
satellite-maintain-0.0.1-1.el7sat.noarch
rubygem-foreman_maintain-0.4.3-1.el7sat.noarch

How reproducible: always


Steps to Reproduce:
1. # foreman-maintain backup offline -y --features dns,tftp,dhcp,openscap /tmp/

Actual results:
foreman-maintain backup offline failed.

Expected results:
Successful backup.

Additional info: Regression.

Comment 3 Nikhil Kathole 2019-06-18 07:15:34 UTC
/var/log/foreman-maintain/foreman-maintain.log showed

I, [2019-06-18 03:12:32-0400 #20420]  INFO -- : --- Execution step 'Stop applicable services' finished ---
I, [2019-06-18 03:12:32-0400 #20420]  INFO -- : --- Execution step 'Backup config files' [backup-config-files] started ---
D, [2019-06-18 03:12:32-0400 #20420] DEBUG -- : Running command hostname -f with stdin nil
D, [2019-06-18 03:12:32-0400 #20420] DEBUG -- : output of the command:
 dell-per630-fc-03.dell2.lab.eng.bos.redhat.com
D, [2019-06-18 03:12:32-0400 #20420] DEBUG -- : Running command curl -w '
%{http_code}' -s  --cert '/etc/foreman-proxy/foreman_ssl_cert.pem' --key '/etc/foreman-proxy/foreman_ssl_key.pem' --cacert '/etc/foreman-proxy/foreman_ssl_ca.pem' https://$(hostname):9090/features with stdin nil
D, [2019-06-18 03:12:32-0400 #20420] DEBUG -- : output of the command:
 000
E, [2019-06-18 03:12:32-0400 #20420] ERROR -- : undefined method `&' for "":String (NoMethodError)
/usr/share/gems/gems/foreman_maintain-0.4.3/definitions/features/foreman_proxy.rb:100:in `backup_features'
/usr/share/gems/gems/foreman_maintain-0.4.3/definitions/features/foreman_proxy.rb:56:in `config_files'
/usr/share/gems/gems/foreman_maintain-0.4.3/definitions/procedures/backup/config_files.rb:35:in `config_files'
/usr/share/gems/gems/foreman_maintain-0.4.3/definitions/procedures/backup/config_files.rb:22:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/reporter/cli_reporter.rb:141:in `with_spinner'
/usr/share/gems/gems/foreman_maintain-0.4.3/definitions/procedures/backup/config_files.rb:21:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/executable.rb:139:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner/execution.rb:83:in `block (2 levels) in run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner/execution.rb:107:in `capture_errors'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner/execution.rb:82:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner/execution.rb:101:in `with_metadata_calculation'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner/execution.rb:81:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:116:in `run_step'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:105:in `run_steps'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:98:in `execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:51:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:32:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:31:in `each'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:31:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli/base.rb:64:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli/backup_command.rb:25:in `perform_backup'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli/backup_command.rb:124:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli.rb:32:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/bin/foreman-maintain:15:in `<top (required)>'
/usr/bin/foreman-maintain:23:in `load'
/usr/bin/foreman-maintain:23:in `<main>'
I, [2019-06-18 03:12:32-0400 #20420]  INFO -- : --- Execution step 'Backup config files' finished ---
I, [2019-06-18 03:12:32-0400 #20420]  INFO -- : === Scenario 'Backup' finished ===

Comment 5 Nikhil Kathole 2019-06-18 07:26:17 UTC
Just to add,

Also rescue scenario failed with following error.

D, [2019-06-18 03:12:32-0400 #20420] DEBUG -- : === Rescue scenario found. Executing ===
E, [2019-06-18 03:12:33-0400 #20420] ERROR -- : The runner is already in quit state (RuntimeError)
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:44:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:94:in `block in execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:94:in `each'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:94:in `execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:36:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:31:in `each'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/runner.rb:31:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli/base.rb:64:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli/backup_command.rb:25:in `perform_backup'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli/backup_command.rb:124:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/lib/foreman_maintain/cli.rb:32:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
/usr/share/gems/gems/foreman_maintain-0.4.3/bin/foreman-maintain:15:in `<top (required)>'
/usr/bin/foreman-maintain:23:in `load'
/usr/bin/foreman-maintain:23:in `<main>'
I, [2019-06-18 03:12:33-0400 #20420]  INFO -- : foreman-maintain command finished with 1

Comment 6 Martin Bacovsky 2019-06-18 08:41:34 UTC
Thanks for the report. Regression confirmed. It was caused by moving backup of configs to offline mode. We are trying to detect features on proxy that is down at that time. I'm working on a fix.

Comment 7 Martin Bacovsky 2019-06-18 08:43:50 UTC
Created redmine issue https://projects.theforeman.org/issues/27070 from this bug

Comment 8 Bryan Kearney 2019-06-19 16:02:53 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27070 has been resolved.

Comment 10 Kavita 2019-06-27 06:48:31 UTC
Updated upstream issue with pull-request https://github.com/theforeman/foreman_maintain/pull/268 in which it is fixed.
This change is not yet released in upstream.

Comment 11 Patrick Creech 2019-06-28 01:48:14 UTC
Kavita,

How soon can we get a 0.4.z cut for foreman_maintain with the fix included?

Comment 12 Nikhil Kathole 2019-07-08 06:36:41 UTC
VERIFIED

Version tested:
Satellite 6.6.0 snap 10

# rpm -qa | grep maintain
satellite-maintain-0.0.1-1.el7sat.noarch
rubygem-foreman_maintain-0.4.4-1.el7sat.noarch

tests/test_backup.py::test_positive_backup_online PASSED                 [  6%]

tests/test_backup.py::test_positive_backup_online_skip_pulp_content PASSED [ 10%]

tests/test_backup.py::test_positive_backup_online_preserve_directory PASSED [ 13%]

tests/test_backup.py::test_positive_backup_online_split_pulp_tar PASSED  [ 16%]

tests/test_backup.py::test_positive_backup_online_incremental PASSED     [ 20%]

tests/test_backup.py::test_positive_backup_online_caspule_features PASSED [ 23%]

tests/test_backup.py::test_positive_backup_online_all PASSED             [ 26%]

tests/test_backup.py::test_positive_backup_offline PASSED                [ 30%]

tests/test_backup.py::test_positive_backup_offline_skip_pulp_content PASSED [ 33%]

tests/test_backup.py::test_positive_backup_offline_preserve_directory PASSED [ 36%]

tests/test_backup.py::test_positive_backup_offline_split_pulp_tar PASSED [ 40%]

tests/test_backup.py::test_positive_backup_offline_incremental PASSED    [ 43%]

tests/test_backup.py::test_positive_backup_offline_capsule_features PASSED [ 46%]

tests/test_backup.py::test_positive_backup_offline_logical PASSED        [ 50%]

tests/test_backup.py::test_positive_backup_offline_all PASSED            [ 53%]

tests/test_backup.py::test_negative_backup_online_nodir PASSED           [ 56%]

tests/test_backup.py::test_negative_backup_offline_nodir PASSED          [ 60%]

tests/test_backup.py::test_negative_backup_online_incremental_nodir PASSED [ 63%]

Comment 14 errata-xmlrpc 2019-10-22 16:36:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3181


Note You need to log in before you can comment on or make changes to this bug.