Bug 2113980

Summary: engine-setup on a separate machine fails with: 'Plugin' object has no attribute '_remote_engine'
Product: [oVirt] ovirt-engine-dwh Reporter: Yedidyah Bar David <didi>
Component: SetupAssignee: Aviv Litman <alitman>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: high Docs Contact:
Priority: high    
Version: 4.5.3CC: bugs, dfodor, mperina, sradco
Target Milestone: ovirt-4.5.3Keywords: Reopened, Upstream
Target Release: ---Flags: mperina: ovirt-4.5+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-dwh-4.5.4 Doc Type: Bug Fix
Doc Text:
Cause: A recent patch added support for upgrading to keycloak,removing the condition about env[NEW_DATABASE]. Consequence: This breaks upgrade on a separate dwh machine. Fix: Fix, by copying parts of the condition on _misc_grafana_config. Result: Upgrade works with remote dwh.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-05 12:45:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Metrics RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2122174    
Bug Blocks:    

Description Yedidyah Bar David 2022-08-02 13:34:50 UTC
Description of problem:

Copying from an ovirt-users thread with subject "[ovirt-users] Issue with oVirt 4.5 and Data Warehouse installed on a Separate Machine":

while upgrading from version 4.5.0 to 4.5.1, i see now the following error (Logfile):
"
...
2022-07-26 14:49:25,108+0000 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND               
2022-07-26 14:49:25,112+0000 DEBUG otopi.context context._executeMethod:127 Stage closeup METHOD otopi.plugins.ovirt_engine_setup.ovirt_engine_grafana_dwh.core.config.Plugin._closeup_engine_grafana_access
2022-07-26 14:49:25,112+0000 DEBUG otopi.context context._executeMethod:145 method exception
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine-grafana-dwh/core/config.py", line 398, in _closeup_engine_grafana_access
    self._remote_engine.copy_to_engine(
AttributeError: 'Plugin' object has no attribute '_remote_engine'
2022-07-26 14:49:25,127+0000 ERROR otopi.context context._executeMethod:154 Failed to execute stage 'Closing up': 'Plugin' object has no attribute '_remote_engine'
2022-07-26 14:49:25,127+0000 DEBUG otopi.context context.dumpEnvironment:765 ENVIRONMENT DUMP - BEGIN
...
"

It looks like an error at the clean up stage:

"
[ ERROR ] Failed to execute stage 'Closing up': 'Plugin' object has no attribute '_remote_engine'
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20220726150224-tbwn3w.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20220726150307-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed
"

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

How reproducible:
Always

Steps to Reproduce:
1. Install and setup a 4.4 engine on machine A, 4.4 dwh+grafana on machine B
2. Upgrade both to oVirt 4.5.1 (dwh version 4.5.3)
3. Try again to run engine-setup on the dwh machine (can be with --offline)

Actual results:
Fails as above

Expected results:
Succeeds

Additional info:

Was reported by Igor Davidoff on ovirt-users. Thanks!

This patch was verified by him to fix the issue:

https://github.com/oVirt/ovirt-dwh/pull/44

Thanks also for verifying!

Comment 1 Pavel Novotny 2022-08-29 12:39:19 UTC
Verification blocked by bug 2122174.

Comment 2 Casper (RHV QE bot) 2022-09-12 12:30:41 UTC
This bug has low overall severity and is not going to be further verified by QE. If you believe special care is required, feel free to properly align relevant severity, flags and keywords to raise PM_Score or use one of the Bumps ('PrioBumpField', 'PrioBumpGSS', 'PrioBumpPM', 'PrioBumpQA') in Keywords to raise it's PM_Score above verification threashold (1000).

Comment 3 Casper (RHV QE bot) 2022-09-12 12:30:43 UTC
This bug has low overall severity and passed an automated regression suite, and is not going to be further verified by QE. If you believe special care is required, feel free to re-open to ON_QA status.

Comment 5 Yedidyah Bar David 2022-09-19 13:52:59 UTC
I am now working on adding a "dwh on a separate machine" suite to ovirt-system-tests, with keycloak enabled, and realized that grafana is broken in this case. So current patch is good enough only for the case of aaa, not keycloak. Still not sure what we'll do about the other case, when keycloak is enabled.

For reference, the original report was here:

https://lists.ovirt.org/archives/list/users@ovirt.org/thread/7E3U6JYC2LUPWW3335WS6THIBB67HJL6/

Comment 6 Pavel Novotny 2022-10-30 23:10:02 UTC
Verified in
ovirt-engine-4.5.3.2-1.el8ev.noarch
ovirt-engine-dwh-4.5.7-1.el8ev.noarch

Verification steps:
1. Installed engine (ovirt-engine-4.5.0.7-0.9.el8ev.noarch) on machine A.
2. Then installed DWH+Grafana (ovirt-engine-dwh-4.5.2-1.el8ev.noarch) on machine B.
3. Upgraded both machines to 4.5 (see the versions at the top).
4. Executed again engine-setup on machine B. Tried with and without the "--offline" option.

Result: success, no errors occured.