Bug 1870055 - OVESETUP_GRAFANA_CONFIG/grafanaUser might be undefined
Summary: OVESETUP_GRAFANA_CONFIG/grafanaUser might be undefined
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-dwh
Classification: oVirt
Component: Setup
Version: 4.4.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.6
: 4.4.6.2
Assignee: Yedidyah Bar David
QA Contact: Pavel Novotny
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-19 09:40 UTC by Yedidyah Bar David
Modified: 2021-05-14 07:24 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-dwh-4.4.6.2
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-14 07:24:32 UTC
oVirt Team: Integration
Embargoed:
pm-rhel: ovirt-4.4+
gdeolive: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 114333 0 master MERGED packaging: setup: Move initialization of user/group to common 2021-04-19 09:13:24 UTC

Description Yedidyah Bar David 2020-08-19 09:40:17 UTC
Description of problem:

Under certain conditions (see below), OVESETUP_GRAFANA_CONFIG/grafanaUser will not be set, and will cause certain utilities to fail with:

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-common/ovirt-engine-grafana-dwh/db/grafana.py", line 80, in _misc_set_access
    self.environment[ogdwhcons.ConfigEnv.GRAFANA_USER]
KeyError: 'OVESETUP_GRAFANA_CONFIG/grafanaUser'

This is because it's set only in engine-setup plugin, but used in common plugin - which is used in all utilities, including engine-cleanup and ovirt-engine-rename.

This is a result of the fix to bug 1846365, so is broken since it.

The flow where it happened was something like:

1. Run engine-setup with grafana and dwh enabled, but have it fail before starting grafana service
2. engine-cleanup

In our specific case, the flow was something like:

1. Install and setup 4.3 engine. Configure it to use 3rd-party cert and SSO.
2. Migrate dwh to its own machine.
3. Upgrade the engine to 4.4.
4. Upgrade dwh to 4.4:
4.1. Install el8 machine
4.2. Run engine-backup on the 4.3 dwh machine
4.3. Restore this backup on the el8 machine
4.4. engine-setup - It failed, due to bug 1866811, when starting httpd
5. engine-cleanup

Above flow is still not supported, though - see also bug 1846279.

Comment 1 Yedidyah Bar David 2021-04-19 07:58:40 UTC
This is now required, with patch [1] merged (for bug 1879373).

[1] https://gerrit.ovirt.org/c/ovirt-engine/+/114268

Comment 2 Yedidyah Bar David 2021-04-19 12:21:15 UTC
Reproduction/Verification, with a recent engine (that includes [1]):
- engine-setup
- engine-backup --file=f1
- engine-cleanup
- engine-backup --mode=restore --file=f1 --provision-all-databases

With an older engine, reproduction is harder. See comment 0.

(For reference:)

The reason that with [1] it's now mandatory also in this rather-simple flow, is that with [1], the grafana DB is no longer restored before we provision databases, and the condition in _misc_set_access also checks NEW_DATABASE - which will be true at this point. Before [1], it was false, so we didn't enter _misc_set_access, so didn't run into this bug.

[1] https://gerrit.ovirt.org/c/ovirt-engine/+/114268

Comment 3 Pavel Novotny 2021-05-10 22:36:56 UTC
Verified in
ovirt-engine-4.4.6.6-0.10.el8ev.noarch
ovirt-engine-dwh-4.4.6.2-1.el8ev.noarch

Verified according to steps in comment 2:
- engine install & engine-setup
- engine-backup --file=f1
- engine-cleanup
- engine-backup --mode=restore --file=f1 --provision-all-databases

All steps finished with success.


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