Bug 1447347 - engine-setup fails if dwh service is running
Summary: engine-setup fails if dwh service is running
Keywords:
Status: CLOSED DUPLICATE of bug 1404812
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Engine
Version: ---
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Yedidyah Bar David
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-02 13:18 UTC by Michael Watters
Modified: 2017-05-07 08:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-07 08:46:48 UTC
oVirt Team: Integration
Embargoed:


Attachments (Terms of Use)
Logs collected by ovirt-log-collector. (66 bytes, text/plain)
2017-05-02 13:50 UTC, Michael Watters
no flags Details

Description Michael Watters 2017-05-02 13:18:32 UTC
The engine-setup script errors out if the dwhd service is running.  The upgrade script does not ask if this service should be stopped.

For example, when attempting to upgrade our engine the follow errors are shown after running engine-setup.

[ ERROR ] dwhd is currently running. Its hostname is mdct-ovirt-engine.example.com. Please stop it before running Setup.
[ ERROR ] Failed to execute stage 'Transaction setup': dwhd is currently running
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20170502091301-5uo9sr.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20170502091322-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed

Comment 1 Michael Watters 2017-05-02 13:50:50 UTC
Created attachment 1275694 [details]
Logs collected by ovirt-log-collector.

Logs provided as requested.

Comment 2 Yedidyah Bar David 2017-05-03 06:28:35 UTC
(In reply to Michael Watters from comment #1)
> Created attachment 1275694 [details]
> Logs collected by ovirt-log-collector.
> 
> Logs provided as requested.

The attachment is a link, and downloading it fails:

2017-05-03 09:20:27 ERROR 403: Forbidden.

Also please note that this is most likely a duplicate of bug 1404812. See especially bug 1404812 comment 31. Usually the flow is specifically:
1. Have some previous version of engine+dwh installed
2. yum update, that has an update to postgresql - thus restarting it
3. add later version repos, update setup packages and run engine-setup

Before the fix to bug 1404812, dwhd was disconnected from the db in step 2, and not (always) reconnected. So in step 3, engine-setup stopped it, but dwhd failed to update the database noting that it's stopped, so when engine-setup checks, it sees in the db that dwhd is still running, so failing as described by you.

I don't mind having a look at the logs, if you want, but you can look too - you should simply see in yum.log an update to postgresql-server shortly before running engine-setup. So please either verify by yourself and close this bug as duplicate of 1404812 or make the logs readable. Thanks.

Comment 3 Yedidyah Bar David 2017-05-07 08:43:25 UTC
Tried again, and the sosreport is now accessible. I see there:

In ovirt-engine-setup-20170502084726-7c1716.log:

2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                 Found the following problems in PostgreSQL configuration for the Engine database
:
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  autovacuum_vacuum_scale_factor required to be at most 0.01
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  autovacuum_analyze_scale_factor required to be at most 0.075
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  autovacuum_max_workers required to be at least 6
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  maintenance_work_mem required to be at least 65536
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                 Please set:
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  autovacuum_vacuum_scale_factor = 0.01
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  autovacuum_analyze_scale_factor = 0.075
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  autovacuum_max_workers = 6
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                  maintenance_work_mem = 65536
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                 in postgresql.conf on 'localhost'. Its location is usually /var/lib/pgsql/data , or somewhere under /etc/postgresql* .
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human human.queryString:145 query UPGRADE_PG_CONF_ENGINE
2017-05-02 08:51:27 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                 The database requires these configurations values to be changed. Setup can fix them for you or abort. Fix automatically? (Yes, No) [Yes]:
2017-05-02 08:52:03 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:RECEIVE    No

Then, in postgresql-Tue.log:

LOG:  database system was shut down at 2017-05-02 08:53:52 EDT

and then, in ovirt-engine-setup-20170502090816-k7ams8.log:

2017-05-02 09:10:36 DEBUG otopi.context context._executeMethod:128 Stage transaction-prepare METHOD otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._transactionBegin
2017-05-02 09:10:36 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:200 Database: 'None', Statement: '
            select * from GetDwhHistoryTimekeepingByVarName(
                %(name)s
            )
        ', args: {'name': 'DwhCurrentlyRunning'}
2017-05-02 09:10:36 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:205 Creating own connection
2017-05-02 09:10:36 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:250 Result: [{'var_value': '1', 'var_datetime': None, 'var_name': 'DwhCurrentlyRunning'}]
2017-05-02 09:10:36 ERROR otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl single_etl._transactionBegin:137 dwhd is currently running.
Its hostname is mdct-ovirt-engine.dartcontainer.com.
Please stop it before running Setup.
2017-05-02 09:10:36 DEBUG otopi.context context._executeMethod:142 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine-dwh/core/single_etl.py", line 140, in _transactionBegin
    raise RuntimeError(_('dwhd is currently running'))
RuntimeError: dwhd is currently running

Also, in parallel, in ovirt-engine-dwhd.log:

2017-05-02 08:54:06|vwTzQ0|yi4b5G|KfamNd|OVIRT_ENGINE_DWH|OsEnumUpdate|Default|6|Java Exception|tJDBCInput_4|org.postgresql.util.PSQLException:FATAL: terminating connection due to administrator command|1

Comment 4 Yedidyah Bar David 2017-05-07 08:46:48 UTC
So the flow seems to have been:

1. Run engine-setup trying to update from 4.0 to 4.1
2. Get a prompt about pg params that need to be changed
3. Abort setup, change these params, restart pg so that they take effect
At this point we see in dwhd log errors about connection to db closed.
4. Run setup again and get the error about dwhd

So it's indeed a duplicate.

Thanks for the report.

*** This bug has been marked as a duplicate of bug 1404812 ***


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