Bug 1761494

Summary: dwh-vacuum fails with 'vacuumdb: command not found'
Product: [oVirt] ovirt-engine-dwh Reporter: Lucie Leistnerova <lleistne>
Component: SetupAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: medium Docs Contact:
Priority: high    
Version: 4.3.6CC: adrianquintero, bugs, didi, sradco
Target Milestone: ovirt-4.3.8Flags: pm-rhel: ovirt-4.3+
pm-rhel: ovirt-4.4+
pm-rhel: exception+
Target Release: 4.3.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-dwh-4.3.8 Doc Type: Bug Fix
Doc Text:
Cause: dwh-vacuum did not activate the SCL environment for PostgreSQL, so did not have its utilities in the path. Consequence: When ran, it failed with the message: vacuumdb: command not found Fix: dwh-vacuum was fixed to correctly enable PostgreSQL SCL. Result: Now it does find vacuumdb and finishes successfully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-27 12:56:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1779631    

Description Lucie Leistnerova 2019-10-14 14:01:30 UTC
This bug was initially created as a copy of Bug #1637815

I am copying this bug because: The same need to be fixed for dwh-vacuum



Description of problem:

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

Version-Release number of selected component (if applicable):
ovirt-engine-4.3.6.7-0.1.el7.noarch

How reproducible:
Always

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

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

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

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

Comment 1 Adrian Quintero 2019-10-24 03:41:48 UTC
Hi,
Having the same issue:

[root@ovirtengine ~]# rpm -qa |grep ovirt-release
ovirt-release43-4.3.6-1.el7.noarch

/usr/share/ovirt-engine-dwh/bin/dwh-vacuum.sh: line 47: vacuumdb: command not found

Comment 2 Lucie Leistnerova 2019-10-24 05:50:58 UTC
Workaround is to enable scl manually.

scl enable rh-postgresql10 bash

Comment 3 Sandro Bonazzola 2019-10-28 07:08:59 UTC
Have we got a hint on how this regression got into 4.3.6?

Comment 4 RHEL Program Management 2019-10-28 07:09:06 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 5 Yedidyah Bar David 2019-10-28 07:45:23 UTC
(In reply to Sandro Bonazzola from comment #3)
> Have we got a hint on how this regression got into 4.3.6?

I am pretty certain that it's not a new regression, but existed "forever" (since SCL PG introduction in 4.2). The engine bug was reported a year ago, and dwh was simply forgotten. I still didn't try this myself, so not sure, but perhaps dwh-vacuum did work from inside engine-setup (because engine-setup itself runs with sclenv). engine-setup runs it with env=None, which means env is inherited from engine-setup. Also, I have a system with 4.3.5, and verified that 'engine-setup --offline' works (and successfully runs dwh-vacuum), but running 'dwh-vacuum" manually fails as reported in current bug.

Comment 6 Sandro Bonazzola 2019-11-20 10:07:44 UTC
Moved out to 4.3.8, missed 4.3.7 last RC.

Comment 7 Guilherme Santos 2020-01-14 15:54:23 UTC
Verified on:
ovirt-engine-setup-4.3.8.2-0.1.master.el7.noarch

Steps:
1. Run 'dwh-vacuum' command

Results:
Finish successfully with response 'vacuumdb: vacuuming database "ovirt_engine_history"'

Comment 8 Sandro Bonazzola 2020-01-27 12:56:04 UTC
This bugzilla is included in oVirt 4.3.8 release, published on January 27th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.3.8 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.