Bug 1240923

Summary: engine-backup does not fail cleanly when parsing arguments
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Setup.EngineAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: low Docs Contact:
Priority: low    
Version: 3.6.0CC: bugs, gklein, lsurette, pkubica, rbalakri, rmohr, sbonazzo, yeylon, ykaul, ylavi
Target Milestone: ovirt-3.6.2Flags: rule-engine: ovirt-3.6.z+
rule-engine: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+
Target Release: 3.6.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: A bug caused engine-backup to try to notify the engine again if notification failed. Consequence: Under certain conditions, a failure could cause an endless loop of attempts to notify the engine. Fix: The code was fixed to only try once to notify the engine. Result: A failure does not cause such an endless loop.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-18 11:16:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yedidyah Bar David 2015-07-08 07:13:42 UTC
Description of problem:

When running:

engine-backup --file=f1 --mode=backup

it should fail, saying:
--log is missing

When running:

engine-backup --file=f1 --mode=backup --log=l1 --db-user=u1

it should fail, saying:
Please use --change-db-credentials to change engine db credentials

In both of them it enters instead an endless loop (while trying to notify the engine).

Version-Release number of selected component (if applicable):

Current master

How reproducible:

Always

Steps to Reproduce:
1. See above
2.
3.

Actual results:

Endless loop

Expected results:

output message and exit

Additional info:

Comment 1 Yedidyah Bar David 2015-07-08 07:15:20 UTC
Reported by Roman Mohr, who also suggested to change USAGE to something like:
    /usr/bin/engine-backup --mode=restore [--scope=SCOPE]
    /usr/bin/engine-backup --mode=backup [--scope=SCOPE] --file=FILE --log=FILE

Comment 2 Sandro Bonazzola 2015-10-01 07:19:50 UTC
Since there's a command line change involved, moved to 4.0

Comment 3 Roman Mohr 2015-10-01 08:06:37 UTC
(In reply to Sandro Bonazzola from comment #2)
> Since there's a command line change involved, moved to 4.0

Is there really a command line change? When I ran into these problems my impression was that only the check for the required arguments failed. They are required anyway.

Comment 4 Yedidyah Bar David 2015-10-06 09:01:06 UTC
(In reply to Roman Mohr from comment #3)
> (In reply to Sandro Bonazzola from comment #2)
> > Since there's a command line change involved, moved to 4.0

Roman suggested a change in the usage text, not to the parsing. Not really related to this bug.

> 
> Is there really a command line change? When I ran into these problems my
> impression was that only the check for the required arguments failed. They
> are required anyway.

Indeed. The bug is caused by the work to notify the engine about backup failure/success, but 1188143.

Not sure about the best fix, but it does not involve iiuc any change in ui etc.
I'd suggest to move to 3.6.1.

Comment 5 Gonza 2015-10-07 12:30:10 UTC
I get the same endless loop when setting [1] before running the engine-backup.

[1]
export PGPASSWORD=wrongpass
export BACKUP_ENV_CLEAN=1

Comment 6 Red Hat Bugzilla Rules Engine 2015-10-19 10:59:00 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 7 Yedidyah Bar David 2015-11-16 06:41:53 UTC
*** Bug 1255418 has been marked as a duplicate of this bug. ***

Comment 8 Gonza 2015-11-25 17:39:35 UTC
Still failing with endless loop.

Verified with:
ovirt-engine-3.6.2-0.0.master.20151124181807.git6d4897e.fc22.noarch

# engine-backup --file=f1 --mode=backup 
FATAL: --log is missing
readlink: missing operand
Try 'readlink --help' for more information.
/usr/bin/engine-backup: line 1405: : No such file or directory
Notifying engine
/usr/bin/engine-backup: line 1472: : No such file or directory
/usr/bin/engine-backup: line 1405: : No such file or directory
readlink: missing operand
Try 'readlink --help' for more information.
/usr/bin/engine-backup: line 1405: : No such file or directory
Notifying engine
/usr/bin/engine-backup: line 1472: : No such file or directory
/usr/bin/engine-backup: line 1405: : No such file or directory
readlink: missing operand
...
...

Comment 9 Red Hat Bugzilla Rules Engine 2015-11-27 05:10:38 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 10 Yedidyah Bar David 2015-11-29 12:47:19 UTC
Sorry, some patches were not backported to 3.6.

Comment 11 Sandro Bonazzola 2015-12-23 13:42:32 UTC
oVirt 3.6.2 RC1 has been released for testing, moving to ON_QA

Comment 12 Gonza 2016-01-07 11:35:52 UTC
Verified with:
ovirt-engine-3.6.3-0.0.master.20160105173810.git7421257.el6.noarch

# engine-backup --file=f1 --mode=backup
FATAL: --log is missing
readlink: missing operand
Try `readlink --help' for more information.
/usr/bin/engine-backup: line 1405: : No such file or directory
Notifying engine
/usr/bin/engine-backup: line 1472: : No such file or directory
/usr/bin/engine-backup: line 1405: : No such file or directory
FATAL: Failed notifying engine

No more endless loop.