Bug 1323607

Summary: katello-backup returns with wrong exit code when failing
Product: Red Hat Satellite Reporter: Luc de Louw <ldelouw>
Component: Backup & RestoreAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.8CC: anerurka, bbuckingham, bkearney, brubisch, cfouant, chrobert, dhawke, jcallaha, jfenal, katello-qa-list, ktordeur, mtenheuv
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 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:
Bug Depends On:    
Bug Blocks: 1122832    

Description Luc de Louw 2016-04-04 08:41:09 UTC
Description of problem:

The katello-backup script calls tar to create backups. If tar is failing, i.e. No space left on device or i.e by just killing the tar process, the backup script returns zero.

As a consequence, the failure of the backups is not reported, in contrary all is looking fine. A restore attempt will fail.

Version-Release number of selected component (if applicable):
katello-common-2.2.0.18-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1./usr/bin/katello-backup /to/small/filesystem
2. tar: Removing leading `/' from member names

gzip: stdout: No space left on device
Done.
Backing up mongo db...
tar: Removing leading `/' from member names

gzip: stdout: No space left on device
Done.
[..]
**** BACKUP Complete, contents can be found in: /backup ****
[root@sat ~]#
3. echo $?

Actual results:
0

Expected results:
1 (or anything else non-zero

Additional info:

The script should look something like:
tar --selinux -czf config_files.tar.gz ${CONFIGS[*]} || exit $? to catch the  exit code of tar

Comment 1 Bryan Kearney 2016-07-26 19:00:27 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 2 Christine Fouant 2017-01-31 21:35:29 UTC
Created redmine issue http://projects.theforeman.org/issues/18333 from this bug

Comment 3 Satellite Program 2017-03-27 14:08:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18333 has been resolved.

Comment 5 Satellite Program 2017-03-28 20:08:16 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18333 has been resolved.

Comment 9 Peter Ondrejka 2017-08-16 10:57:04 UTC
Verified on 6.3 snap 11

Comment 10 Satellite Program 2018-02-21 16:54:37 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