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 1390924

Summary: Make katello-backup aware of Puppet4
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: Backup & RestoreAssignee: Christine Fouant <cfouant>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: bbuckingham, cfouant, ehelms, lhellebr
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: 2018-02-21 17:08:20 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 Lukas Pramuk 2016-11-02 09:17:40 UTC
Description of problem:

Puppet4 files live in different locations than for Puppet3.
This tools needs changes to be able to handle them.

Expected result:
katello-backup should backup puppet4 files too.

Comment 1 Lukas Pramuk 2016-11-02 09:22:34 UTC
/usr/bin/katello-backup:73:    '/var/lib/puppet/foreman_cache_data',
/usr/bin/katello-backup:74:    '/var/lib/puppet/ssl'

Comment 4 Christine Fouant 2017-01-17 21:13:49 UTC
Created redmine issue http://projects.theforeman.org/issues/18117 from this bug

Comment 5 Satellite Program 2017-01-24 21:04:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18117 has been resolved.

Comment 6 Lukas Pramuk 2017-08-08 12:14:43 UTC
FailedQA.

The changes make it failing even on puppet3 Satellite and on puppet4 Satellite

# katello-backup bkp
...
Backing up config files... 
Failed 'tar --selinux --create --gzip --file=bkp/katello-backup-20170808075949/config_files.tar.gz --listed-incremental=bkp/katello-backup-20170808075949/.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

# ll bkp/katello-backup-20170808075949/config_files.tar.gz
ls: cannot access bkp/katello-backup-20170808075949/config_files.tar.gz: No such file or directory


Running tar command separately makes it obvious why tar is failing
Non-existent directories
On puppet4 Satellite it's p3 dirs, on puppet3 Satellite it's p4 dirs

# tar --selinux --create --gzip --file=bkp/katello-backup-20170808075949/config_files.tar.gz --listed-incremental=bkp/katello-backup-20170808075949/.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
tar: /etc/puppet: Cannot stat: No such file or directory
tar: /var/lib/puppet/foreman_cache_data: Cannot stat: No such file or directory
tar: /var/lib/puppet/ssl: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
tar: /etc/puppet: Cannot stat: No such file or directory
tar: /var/lib/puppet/foreman_cache_data: Cannot stat: No such file or directory
tar: /var/lib/puppet/ssl: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Is there tar option to ignore this type of errors?

Comment 7 Lukas Pramuk 2017-08-08 17:16:38 UTC
@satellite-6.3.0-16.0.beta.el7sat.noarch
katello-common-3.4.4-2.el7sat.noarch

Comment 8 Christine Fouant 2017-08-16 14:50:58 UTC
(In reply to Lukas Pramuk from comment #6)
> FailedQA.
> 
> The changes make it failing even on puppet3 Satellite and on puppet4
> Satellite
> 
> # katello-backup bkp
> ...
> Backing up config files... 
> Failed 'tar --selinux --create --gzip
> --file=bkp/katello-backup-20170808075949/config_files.tar.gz
> --listed-incremental=bkp/katello-backup-20170808075949/.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
> 
> # ll bkp/katello-backup-20170808075949/config_files.tar.gz
> ls: cannot access bkp/katello-backup-20170808075949/config_files.tar.gz: No
> such file or directory
> 
> 
> Running tar command separately makes it obvious why tar is failing
> Non-existent directories
> On puppet4 Satellite it's p3 dirs, on puppet3 Satellite it's p4 dirs
> 
> # tar --selinux --create --gzip
> --file=bkp/katello-backup-20170808075949/config_files.tar.gz
> --listed-incremental=bkp/katello-backup-20170808075949/.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
> tar: /etc/puppet: Cannot stat: No such file or directory
> tar: /var/lib/puppet/foreman_cache_data: Cannot stat: No such file or
> directory
> tar: /var/lib/puppet/ssl: Cannot stat: No such file or directory
> tar: Removing leading `/' from member names
> tar: /etc/puppet: Cannot stat: No such file or directory
> tar: /var/lib/puppet/foreman_cache_data: Cannot stat: No such file or
> directory
> tar: /var/lib/puppet/ssl: Cannot stat: No such file or directory
> tar: Exiting with failure status due to previous errors
> 
> Is there tar option to ignore this type of errors?

This looks like you are writing the backup to a directory to which postgres does not have access to write. I believe it's in the docs that this is required? So basically, needs to be written to /tmp and then pushed to whatever location you like afterwards

Comment 9 Lukáš Hellebrandt 2017-10-02 12:05:54 UTC
Verified with Sat6.3 snap 17.

Tried with both puppet 3 and 4 and checked whether:
1) katello-backup ran without errors
2) either files for puppet 3, OR files for puppet 4 are present in the archive

For puppet 3:
/etc/puppet

For puppet 4:
/etc/puppetlabs

The files are indeed present. Actually, as on puppet 4 machine, the puppet has been upgraded from puppet 3, there are both directories present: which is probably not necessary but is on the safe side.

Commit review shows the result has been achieved by trying to tar both paths and redirecting output to /dev/null which doesn't look like a good practice to me. However, the issue is fixed and no regression found -> verified.


Note: when running katello-backup, you MUST use ABSOLUTE path either in /tmp or /var/tmp, otherwise the tool won't work:

# cd /tmp
# katello-backup /tmp/bkp
# ls bkp

Comment 10 Bryan Kearney 2018-02-21 17:08:20 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