Bug 1323607 - katello-backup returns with wrong exit code when failing
Summary: katello-backup returns with wrong exit code when failing
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Backup & Restore
Version: 6.1.8
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2016-04-04 08:41 UTC by Luc de Louw
Modified: 2019-04-01 20:27 UTC (History)
12 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-02-21 16:54:37 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 18333 None None None 2017-01-31 21:35 UTC

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 pm-sat@redhat.com 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 pm-sat@redhat.com 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 pm-sat@redhat.com 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


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