Bug 1384901

Summary: katello-backup --incremental fails with "NoMethodError" on el6
Product: Red Hat Satellite Reporter: Sean O'Keeffe <sokeeffe>
Component: Backup & RestoreAssignee: Christine Fouant <cfouant>
Status: CLOSED CURRENTRELEASE QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, cfouant, ehelms, jcallaha, kcleveng, mmccune, oshtaier, pondrejk, rochacbruno, vdhande
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-17 18:54:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sean O'Keeffe 2016-10-14 10:52:40 UTC
Description of problem:
el6 has ruby 1.8,  `exist?' method is not available in ruby-1.8


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

How reproducible:
100%

Steps to Reproduce:
1. katello-backup --incremental 
2.
3.

Actual results:
"NoMethodError"


Expected results:
To work

Additional info:

Comment 1 Bryan Kearney 2016-10-14 14:01:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16927 has been resolved.

Comment 3 Peter Ondrejka 2016-10-31 11:09:56 UTC
Unable to do incremental update on el7 as well (Sat 6.3 snap 5, katello-3.2.0-2.rc2.el7.noarch, ruby-2.0.0.598-25.el7_1.x86_64), but TypeError in this case:

~]# katello-backup /appl/sat-db-save3 --incremental
/usr/bin/katello-backup:17:in `exist?': no implicit conversion of nil into String (TypeError)
	from /usr/bin/katello-backup:17: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:29:in `block in <main>'
	from /usr/share/ruby/optparse.rb:885:in `initialize'
	from /usr/bin/katello-backup:9:in `new'
	from /usr/bin/katello-backup:9:in `<main>'

Comment 4 Bryan Kearney 2016-10-31 12:19:34 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16927 has been resolved.

Comment 5 Christine Fouant 2016-11-07 21:18:41 UTC
*** Bug 1390355 has been marked as a duplicate of this bug. ***

Comment 6 Peter Ondrejka 2017-02-09 16:05:20 UTC
I still get type error when combining --incremental with other option, e.g.

~]# katello-backup test-b-dir --incremental --skip-pulp-content test-b-dir/katello-backup-2017-02-09T10:53:21-05:00
/usr/bin/katello-backup:18:in `directory?': can't convert nil into String (TypeError)
	from /usr/bin/katello-backup:18
	from /usr/lib/ruby/1.8/optparse.rb:1267:in `call'
	from /usr/lib/ruby/1.8/optparse.rb:1267:in `parse_in_order'
	from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
	from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
	from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
	from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
	from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
	from /usr/bin/katello-backup:30
	from /usr/lib/ruby/1.8/optparse.rb:791:in `initialize'
	from /usr/bin/katello-backup:10:in `new'
	from /usr/bin/katello-backup:10

Comment 7 Christine Fouant 2017-02-09 19:33:27 UTC
(In reply to Peter Ondrejka from comment #6)
> I still get type error when combining --incremental with other option, e.g.
> 
> ~]# katello-backup test-b-dir --incremental --skip-pulp-content
> test-b-dir/katello-backup-2017-02-09T10:53:21-05:00
> /usr/bin/katello-backup:18:in `directory?': can't convert nil into String
> (TypeError)
> 	from /usr/bin/katello-backup:18
> 	from /usr/lib/ruby/1.8/optparse.rb:1267:in `call'
> 	from /usr/lib/ruby/1.8/optparse.rb:1267:in `parse_in_order'
> 	from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
> 	from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
> 	from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
> 	from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
> 	from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
> 	from /usr/bin/katello-backup:30
> 	from /usr/lib/ruby/1.8/optparse.rb:791:in `initialize'
> 	from /usr/bin/katello-backup:10:in `new'
> 	from /usr/bin/katello-backup:10

You're entering the command line incorrectly, it should be:

# katello-backup <backup directory> --incremental <previous backup directory> --skip-pulp-content

I can get a better error message for an incorrectly formed command line entry, but wondering if that is outside of the context for the bug reported?

Comment 8 Peter Ondrejka 2017-02-20 12:56:08 UTC
In my opinion, it is relevant to fix in this bug. Some user-friendly message would be nice, e.g. "Please specify the previous backup directory" or something like that

Comment 12 Mike McCune 2017-05-17 18:54:24 UTC
we can close this out as current release  , fixed in 6.2.9