Bug 1637818

Summary: [downstream clone - 4.2.8] engine-vacuum fails with 'vacuumdb: command not found'
Product: Red Hat Enterprise Virtualization Manager Reporter: Miguel Martin <mmartinv>
Component: ovirt-engineAssignee: Martin Perina <mperina>
Status: CLOSED ERRATA QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.6CC: bugs, emesika, lsvaty, mgoldboi, mmartinv, ratamir, Rhev-m-bugs
Target Milestone: ovirt-4.2.8Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.8.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1637815 Environment:
Last Closed: 2019-01-22 12:44:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1637815    
Bug Blocks:    

Description Miguel Martin 2018-10-10 07:23:13 UTC
+++ This bug was initially created as a clone of Bug #1637815 +++

Description of problem:

engine-vacuum fails with 'vacuumdb: command not found'

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

How reproducible:
Always

Steps to Reproduce:
1. Open an SSH console to the oVirt manager
2. Run 'engine-vacuum' command

Actual results:
It fails with the error: 
~~~
[root@ovirt ~]# engine-vacuum
"/usr/bin/engine-vacuum: line 47: vacuumdb: command not found"
~~~

Expected results:
It should finish successfully:
~~~
[root@ovirt ~]# engine-vacuum
vacuumdb: vacuuming database "engine"
~~~

Additional info:
engine-vacuum does not load SCL environment.

Comment 1 Eli Mesika 2018-10-14 08:17:48 UTC
vacuumdb is provided with the postgresql package (client) and installed in /usr/bin which should be in the PATH

Can you please provide the output of :

# rpm -qa |grep postgresql

Comment 2 Miguel Martin 2018-10-15 07:58:18 UTC
In RHV 4.2 'postgresql' package is not installed because SCL is used to provide the required binaries, the one containing vacuumdb command is:
~~~
[root@rhvm-42 ~]# rpm -qf /opt/rh/rh-postgresql95/root/bin/vacuumdb 
rh-postgresql95-postgresql-9.5.14-1.el7.x86_64
~~~ 

'engine-backup' command detects when SCL is used:
~~~
   1933 if ! [ -z "$sclenv" ]; then
   1934         log "Setting scl env for ${sclenv}"
   1935         . scl_source enable ${sclenv}
   1936 fi
~~~

So the same is needed for 'engine-vacuum'

Comment 3 Lucie Leistnerova 2018-11-19 10:22:54 UTC
engine-vacuum works as expected without setting PATH or enabling scl

verified in ovirt-engine-tools-4.2.8-0.0.master.20181114165442.gitd4ff8e5.el7.noarch

Comment 5 Raz Tamir 2018-11-28 15:30:20 UTC
QE verification bot: the bug was verified upstream

Comment 7 errata-xmlrpc 2019-01-22 12:44:50 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/RHBA-2019:0121