Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1544396

Summary: k-backup fails when passed a relative path for the destination
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: Backup & RestoreAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.13CC: bkearney, janarula, mmccune, vdeshpan, zhunting
Target Milestone: UnspecifiedKeywords: Regression, 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:
: 1544401 1553882 1553883 (view as bug list) Environment:
Last Closed: 2018-05-21 20:16:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1544401, 1557333    

Description Evgeni Golov 2018-02-12 11:24:27 UTC
<pre>
# katello-backup .
Starting backup: 2018-02-12 11:11:37 +0000
Creating backup folder ./katello-backup-20180212111138
Generating metadata ... 
/usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
Done.
Backing up config files... 

Failed 'tar --selinux --create --gzip --file=./katello-backup-20180212111138/config_files.tar.gz --listed-incremental=./katello-backup-20180212111138/.config.snar /etc/foreman-proxy /etc/httpd /etc/foreman-installer /etc/pki/katello /etc/pki/katello-certs-tools /etc/pki/pulp /etc/pulp /etc/puppet /etc/qpid /etc/qpid-dispatch /root/ssl-build /var/www/html/pub /etc/squid /etc/puppetlabs /opt/puppetlabs/puppet/cache/foreman_cache_data /opt/puppetlabs/puppet/ssl/ /var/lib/puppet/foreman_cache_data /var/lib/puppet/ssl /etc/candlepin /etc/foreman /etc/hammer /etc/sysconfig/tomcat* /etc/tomcat* /var/lib/candlepin     2>/dev/null' with exit code 141
Cleaning up backup folder and starting any stopped services... 
/usr/share/ruby/fileutils.rb:125: warning: conflicting chdir during another chdir block
Done.
</pre>

Calling <code>katello-backup $(pwd)</code> works as expected.

Comment 1 Evgeni Golov 2018-02-12 11:24:30 UTC
Created from redmine issue http://projects.theforeman.org/issues/22548

Comment 2 Evgeni Golov 2018-02-12 11:24:34 UTC
Upstream bug assigned to egolov

Comment 6 jcallaha 2018-04-23 18:32:09 UTC
Failed QA in Satellite 6.2.15.

The code fix is not present in the currently packaged version of katello-backup and the error is still present.

-bash-4.2# sed -n 70p /usr/bin/katello-backup
  @dir = ARGV[0].dup

Comment 8 jcallaha 2018-04-27 19:13:10 UTC
Verified in Satellite 6.2.15 Snap 2.

-bash-4.2# mcd /tmp/backup

-bash-4.2# pwd
/tmp/backup

-bash-4.2# katello-backup .
Starting backup: 2018-04-27 15:05:41 -0400
Creating backup folder /tmp/backup/katello-backup-20180427150541
Generating metadata ... 
Done.
Backing up config files... 
Done.
WARNING: This script will stop your services. Do you want to proceed(y/n)? y
Redirecting to /bin/systemctl stop foreman-tasks.service
Redirecting to /bin/systemctl stop httpd.service
Redirecting to /bin/systemctl stop pulp_workers.service
Redirecting to /bin/systemctl stop pulp_streamer.service
Redirecting to /bin/systemctl stop pulp_resource_manager.service
Redirecting to /bin/systemctl stop pulp_celerybeat.service
Redirecting to /bin/systemctl stop tomcat.service
Redirecting to /bin/systemctl stop postgresql.service
Redirecting to /bin/systemctl stop mongod.service
Backing up Pulp data... 
Done.
Backing up postgres db...
Done.
Backing up mongo db... 
Done.
Redirecting to /bin/systemctl start mongod.service
Redirecting to /bin/systemctl start postgresql.service
Redirecting to /bin/systemctl start tomcat.service
Redirecting to /bin/systemctl start pulp_celerybeat.service
Redirecting to /bin/systemctl start pulp_resource_manager.service
Redirecting to /bin/systemctl start pulp_streamer.service
Redirecting to /bin/systemctl start pulp_workers.service
Redirecting to /bin/systemctl start httpd.service
Redirecting to /bin/systemctl start foreman-tasks.service
Done with backup: 2018-04-27 15:10:38 -0400
**** BACKUP Complete, contents can be found in: /tmp/backup/katello-backup-20180427150541 ****

-bash-4.2# catline 70 /usr/bin/katello-backup
  @dir = File.expand_path(ARGV[0].dup)

Comment 11 errata-xmlrpc 2018-05-21 20:16:43 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-2018:1672