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

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18333 0 None None None 2017-01-31 21:35:30 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 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


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