Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1447619 - incremental backup with no source dir specified fails with no implicit conversion of nil into String (TypeError)
Summary: incremental backup with no source dir specified fails with no implicit conver...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Backup & Restore
Version: 6.2.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Christine Fouant
QA Contact: Bruno Rocha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-03 10:44 UTC by Peter Ondrejka
Modified: 2019-04-01 20:27 UTC (History)
5 users (show)

Fixed In Version: katello-3.4.5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 17:06:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18756 0 Normal Closed katello-backup --incremental failure does not provide adequate error message 2020-07-20 19:55:38 UTC
Foreman Issue Tracker 20635 0 Normal Closed katello-backup needs cleaner error messages for invalid option calls 2020-07-20 19:55:38 UTC

Description Peter Ondrejka 2017-05-03 10:44:29 UTC
katello-backup /tmp/ --incremental
/usr/bin/katello-backup:18:in `directory?': no implicit conversion of nil into String (TypeError)
	from /usr/bin/katello-backup:18:in `block (2 levels) in <main>'
	from /usr/share/ruby/optparse.rb:1364:in `call'
	from /usr/share/ruby/optparse.rb:1364:in `block in parse_in_order'
	from /usr/share/ruby/optparse.rb:1351:in `catch'
	from /usr/share/ruby/optparse.rb:1351:in `parse_in_order'
	from /usr/share/ruby/optparse.rb:1345:in `order!'
	from /usr/share/ruby/optparse.rb:1437:in `permute!'
	from /usr/share/ruby/optparse.rb:1459:in `parse!'
	from /usr/bin/katello-backup:30:in `block in <main>'
	from /usr/share/ruby/optparse.rb:885:in `initialize'
	from /usr/bin/katello-backup:10:in `new'
	from /usr/bin/katello-backup:10:in `<main>'


fixed in upstream 
https://github.com/Katello/katello-packaging/commit/4f6d966db0ae2603dd1a7485805076ed1dab4afa

Comment 1 Satellite Program 2017-05-09 15:51:36 UTC
Connecting redmine issue http://projects.theforeman.org/issues/18756 from this bug

Comment 2 Satellite Program 2017-05-09 16:02:28 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18756 has been resolved.

Comment 5 Evgeni Golov 2017-08-09 13:46:30 UTC
FAILED_QA

Version Tested:
Satellite-6.3 Snap 10
katello-common-3.4.4-2.el7sat.noarch

While the original error is gone, you still end up with a quite unfriendly traceback when no directory is given:
# katello-backup /tmp/ --incremental
/sbin/katello-backup:72:in `block in <main>': missing argument: --incremental (OptionParser::MissingArgument)
	from /sbin/katello-backup:22:in `new'
	from /sbin/katello-backup:22:in `<main>'

I was expecting to see:
# katello-backup /tmp/ --incremental
katello-backup: Please specify the previous backup directory.

This is due to the change that went in later:
-  opts.on("--incremental [PREVIOUS_BACKUP_DIR]", String, "Backup changes since previous backup") do |dir_path|
+  opts.on("--incremental PREVIOUS_BACKUP_DIR", String, "Backup changes since previous backup") do |dir_path|

Removing the brackets made the value required, but now Ruby's OptionParser outputs the traceback and I can't find a way to tell it to output a friendly message :(

Comment 6 Bruno Rocha 2017-09-21 21:43:00 UTC
During the verification of other BZ I had the chance to verify this one, so taking and moving to verified:


Verified with snap 16:

[root@cloud-qe-15 v2]# rpm -q satellite
satellite-6.3.0-18.0.beta.el7sat.noarch

Steps:

[root@cloud-qe-15 v2]# katello-backup /tmp/ --incremental
missing argument: --incremental
Usage: katello-backup /path/to/dir [options]
 eg: $ katello-backup /tmp/katello-backup
        --skip-pulp-content          Create backup without Pulp content for debugging only
        --incremental PREVIOUS_BACKUP_DIR
                                     Backup changes since previous backup
        ....
        ....
        ....


Help message states very clearly that `--incremental` requires a `PREVIOUS_BACKUP_DIR`

Comment 7 Bryan Kearney 2018-02-21 17:06:24 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/RHSA-2018:0336


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