[Users] How to scratch previous versions reports and dwh installation?

Hello, I have some problems, I think they are also due to PosgreSQL access rules changes from f18 to f19. In particular if one has passed from fedora 18 to Fedora 19 and form 3.2 to 3.3 as I did; see https://bugzilla.redhat.com/show_bug.cgi?id=1009335 Right now I have a problem with my AIO installation where trying to upgrade from 3.3.2 to 3.3.3 I got many problems related to RDBMS. Is there a way to completely get rid of prevous installtion and reinstall cleanly in 3.3.3 as I did on another system without getting problems. I tried removing packages: yum remove ovirt-engine-dwh ovirt-engine-reports and deleting related databases: drop database ovirt_engine_history; drop database ovirtenginereports; But then trying to install again packages and runnign setup I get this in log: 2014-01-30 00:37:30::DEBUG::common_utils::446::root:: running sql query on host: localhost, port: 5432, db: ovirt_engine_history, user: engine, query: 'select 1 from history_configuration;'. 2014-01-30 00:37:30::DEBUG::common_utils::907::root:: Executing command --> '/usr/bin/psql --pset=tuples_only=on --set ON_ERROR_STOP=1 --dbname ovirt_engine_history --host localhost --port 5432 --username engine -w -c select 1 from history_configuration;' in working directory '/root' 2014-01-30 00:37:30::DEBUG::common_utils::962::root:: output = 2014-01-30 00:37:30::DEBUG::common_utils::963::root:: stderr = ERROR: relation "history_configuration" does not exist LINE 1: select 1 from history_configuration; Can anyone tell if I have to run any other purge operation, suche as any users or table on engine db itself? And also what would be the expected configuration of /var/lib/pgsql/data/pg_hba.conf and eventually /var/lib/pgsql/data/postgresql.conf for a fedora 19 system so that a setup for reports and dwh could complete? Gianluca

----- Original Message -----
From: "Gianluca Cecchi" <gianluca.cecchi@gmail.com> To: "users" <users@ovirt.org> Sent: Sunday, February 2, 2014 3:56:25 PM Subject: [Users] How to scratch previous versions reports and dwh installation?
Hello, I have some problems, I think they are also due to PosgreSQL access rules changes from f18 to f19. In particular if one has passed from fedora 18 to Fedora 19 and form 3.2 to 3.3 as I did; see https://bugzilla.redhat.com/show_bug.cgi?id=1009335
Right now I have a problem with my AIO installation where trying to upgrade from 3.3.2 to 3.3.3 I got many problems related to RDBMS.
Is this related to dwh/reports?
Is there a way to completely get rid of prevous installtion and reinstall cleanly in 3.3.3 as I did on another system without getting problems.
So you want to delete dwh/reports only or also the engine?
I tried removing packages: yum remove ovirt-engine-dwh ovirt-engine-reports
and deleting related databases:
drop database ovirt_engine_history; drop database ovirtenginereports;
This might not be enough. Sadly there is currently no cleanup tool for dwh/reports, similar to engine-cleanup for the engine. For things to delete look at /etc/ovirt*dwh* /etc/ovirt-*reports* /etc/ovirt-engine/*dwh* /etc/ovirt-engine/*reports* /var/lib/ovirt-engine/deployments/*reports*
But then trying to install again packages and runnign setup I get this in log:
2014-01-30 00:37:30::DEBUG::common_utils::446::root:: running sql query on host: localhost, port: 5432, db: ovirt_engine_history, user: engine, query: 'select 1 from history_configuration;'. 2014-01-30 00:37:30::DEBUG::common_utils::907::root:: Executing command --> '/usr/bin/psql --pset=tuples_only=on --set ON_ERROR_STOP=1 --dbname ovirt_engine_history --host localhost --port 5432 --username engine -w -c select 1 from history_configuration;' in working directory '/root' 2014-01-30 00:37:30::DEBUG::common_utils::962::root:: output = 2014-01-30 00:37:30::DEBUG::common_utils::963::root:: stderr = ERROR: relation "history_configuration" does not exist LINE 1: select 1 from history_configuration;
This in itself is not necessarily a problem, unless of course setup failed immediately after that. Which versions of relevant packages? Can you please post full logs?
Can anyone tell if I have to run any other purge operation, suche as any users or table on engine db itself?
IIRC nothing in the engine db itself. Didn't check that, though.
And also what would be the expected configuration of /var/lib/pgsql/data/pg_hba.conf
Manually-edited? On a remote database server? Or local, letting the setup programs edit it for you? Please post it if you have a specific problem that you think might be related.
and eventually /var/lib/pgsql/data/postgresql.conf
Only max_connections is edited by setup, to be 150. For a remote database you want to change listen_addresses.
for a fedora 19 system so that a setup for reports and dwh could complete?
In general, on a clean system, with a local database, the setup programs should do what's needed and no manual fixes are needed. Do note that, as Yaniv mentioned earlier, 3.3.3 should be used when released. 3.3.3-beta might probably be good enough if you can't wait. Regards, -- Didi

On Sun, Feb 2, 2014 at 3:34 PM, Yedidyah Bar David wrote:
----- Original Message -----
From: "Gianluca Cecchi" To: "users" <users@ovirt.org> Sent: Sunday, February 2, 2014 3:56:25 PM Subject: [Users] How to scratch previous versions reports and dwh installation?
Hello, I have some problems, I think they are also due to PosgreSQL access rules changes from f18 to f19. In particular if one has passed from fedora 18 to Fedora 19 and form 3.2 to 3.3 as I did; see https://bugzilla.redhat.com/show_bug.cgi?id=1009335
Right now I have a problem with my AIO installation where trying to upgrade from 3.3.2 to 3.3.3 I got many problems related to RDBMS.
Is this related to dwh/reports?
yes, engine is ok
Is there a way to completely get rid of prevous installtion and reinstall cleanly in 3.3.3 as I did on another system without getting problems.
So you want to delete dwh/reports only or also the engine?
Yes, only dwh/reports. Suppose I don't mind to maintain my previous (3.2.x settings in my case) and I want to start from new data Engine is ok
I tried removing packages: yum remove ovirt-engine-dwh ovirt-engine-reports
and deleting related databases:
drop database ovirt_engine_history; drop database ovirtenginereports;
This might not be enough. Sadly there is currently no cleanup tool for dwh/reports, similar to engine-cleanup for the engine.
For things to delete look at /etc/ovirt*dwh* /etc/ovirt-*reports* /etc/ovirt-engine/*dwh* /etc/ovirt-engine/*reports* /var/lib/ovirt-engine/deployments/*reports*
But then trying to install again packages and runnign setup I get this in log:
2014-01-30 00:37:30::DEBUG::common_utils::446::root:: running sql query on host: localhost, port: 5432, db: ovirt_engine_history, user: engine, query: 'select 1 from history_configuration;'. 2014-01-30 00:37:30::DEBUG::common_utils::907::root:: Executing command --> '/usr/bin/psql --pset=tuples_only=on --set ON_ERROR_STOP=1 --dbname ovirt_engine_history --host localhost --port 5432 --username engine -w -c select 1 from history_configuration;' in working directory '/root' 2014-01-30 00:37:30::DEBUG::common_utils::962::root:: output = 2014-01-30 00:37:30::DEBUG::common_utils::963::root:: stderr = ERROR: relation "history_configuration" does not exist LINE 1: select 1 from history_configuration;
This in itself is not necessarily a problem, unless of course setup failed immediately after that.
The actual problem that cause setup to abort was few lines below: 2014-01-30 00:37:42::DEBUG::common_utils::907::root:: Executing command --> '/usr/share/ovirt-engine-dwh/db-scripts/create_schema.sh -l /var/log/ovirt-engine/ovirt-history-db-install-2014_01_30_00_37_42.log -u engine_history -s localhost -p 5432 -g' in working directory '/root' 2014-01-30 00:37:42::DEBUG::common_utils::962::root:: output = 2014-01-30 00:37:42::DEBUG::common_utils::963::root:: stderr = psql: FATAL: password authentication failed for user "engine_history" FATAL: password authentication failed for user "engine_history" password retrieved from file "/tmp/pgpasss2gOEF.tmp" 2014-01-30 00:37:42::DEBUG::common_utils::964::root:: retcode = 2 2014-01-30 00:37:42::ERROR::decorators::27::root:: Traceback (most recent call last): File "/usr/share/ovirt-engine-dwh/decorators.py", line 20, in wrapped_f output = f(*args) File "/bin/ovirt-engine-dwh-setup", line 160, in createDbSchema envDict={'ENGINE_PGPASS': PGPASS_TEMP}, File "/usr/share/ovirt-engine-dwh/common_utils.py", line 967, in execCmd raise Exception(msg) Exception: Error while trying to create ovirt_engine_history db 2014-01-30 00:37:42::ERROR::ovirt-engine-dwh-setup::691::root:: Exception caught! 2014-01-30 00:37:42::ERROR::ovirt-engine-dwh-setup::692::root:: Traceback (most recent call last): File "/bin/ovirt-engine-dwh-setup", line 623, in main createDbSchema(db_dict) File "/usr/share/ovirt-engine-dwh/decorators.py", line 28, in wrapped_f raise Exception(instance) Exception: Error while trying to create ovirt_engine_history db
Which versions of relevant packages? Can you please post full logs?
I'm using packages from 3.3.3rc so: ovirt-engine-reports-3.3.3-1.fc19.noarch ovirt-engine-dwh-3.3.3-1.fc19.noarch
Can anyone tell if I have to run any other purge operation, suche as any users or table on engine db itself?
IIRC nothing in the engine db itself. Didn't check that, though.
And also what would be the expected configuration of /var/lib/pgsql/data/pg_hba.conf
Manually-edited? On a remote database server? Or local, letting the setup programs edit it for you? Please post it if you have a specific problem that you think might be related.
This is an All-In-One so that engine itself and its database, as the dwh and reports RDBMS are all on the same server I didn't edit anything, but I don't know if passing from f18 to f19 caused postgres yum update phase to change anything itself...
and eventually /var/lib/pgsql/data/postgresql.conf
Only max_connections is edited by setup, to be 150. For a remote database you want to change listen_addresses.
for a fedora 19 system so that a setup for reports and dwh could complete?
In general, on a clean system, with a local database, the setup programs should do what's needed and no manual fixes are needed.
I can try to remove packages and databases and suggested files you wrote again and rerun setup
Do note that, as Yaniv mentioned earlier, 3.3.3 should be used when released. 3.3.3-beta might probably be good enough if you can't wait.
Regards, -- Didi
See my full logs of attempts under /var/log/ovirt-engine here: https://drive.google.com/file/d/0BwoPbcrMv8mvb2lXVFVmTmVTTFE/edit?usp=sharin... and output of sessions of update of engine form 3.3.2 to 3.3.3 here https://drive.google.com/file/d/0BwoPbcrMv8mvMFdqNHk2SUJ1TkU/edit?usp=sharin... Gianluca

for example, - yum remove ovirt-engine-dwh ovirt-engine-reports - psql drop database ovirt_engine_history; drop database ovirtenginereports; cd /etc mv ovirt-engine-dwh/ ovirt-engine-dwh.old mv ovirt-engine-reports/ ovirt-engine-reports.old mv ovirt-engine/ovirt-engine-dwh ovirt-engine/ovirt-engine-dwh.old mv /var/lib/ovirt-engine/deployments/ovirt-engine-reports.war.dodeploy /var/lib/ovirt-engine/deployments/ovirt-engine-reports.war.dodeploy.old and run setup again after installing ovirt-engine-dwh-3.3.3-1.fc19.noarch (I currently have stable + updates-testing repos enabled) [root@tekkaman ~]# ovirt-engine-dwh-setup Welcome to ovirt-engine-dwh setup utility In order to proceed the installer must stop the ovirt-engine service Would you like to stop the ovirt-engine service (yes|no): yes Stopping ovirt-engine... [ DONE ] This utility can configure a read only user for DB access. Would you like to do so? (yes|no): yes Error: user name cannot be empty Provide a username for read-only user : ovirt_read Provide a password for read-only user: Warning: Weak Password. Re-type password: Should postgresql be setup with secure connection? (yes|no): yes Creating DB... [ ERROR ] Error encountered while installing ovirt-engine-dwh, please consult the log file: /var/log/ovirt-engine/ovirt-engine-dwh-setup-2014_02_02_16_29_34.log The main problem in log is: 2014-02-02 16:30:04::DEBUG::ovirt-engine-dwh-setup::144::root:: ovirt engine history db creation is logged at /var/log/ovirt-engine/ovirt-history-db-install-2014_02_02_16_30_04.log 2014-02-02 16:30:04::DEBUG::common_utils::907::root:: Executing command --> '/usr/share/ovirt-engine-dwh/db-scripts/create_schema.sh -l /var/log/ovirt-engine/ovirt-history-db-install-2014_02_02_16_30_04.log -u engine_history -s localhost -p 5432 -g' in working directory '/root' 2014-02-02 16:30:04::DEBUG::common_utils::962::root:: output = 2014-02-02 16:30:04::DEBUG::common_utils::963::root:: stderr = psql: FATAL: password authentication failed for user "engine_history" FATAL: password authentication failed for user "engine_history" password retrieved from file "/tmp/pgpassW0tW24.tmp" 2014-02-02 16:30:04::DEBUG::common_utils::964::root:: retcode = 2 2014-02-02 16:30:04::ERROR::decorators::27::root:: Traceback (most recent call last): File "/usr/share/ovirt-engine-dwh/decorators.py", line 20, in wrapped_f output = f(*args) File "/bin/ovirt-engine-dwh-setup", line 160, in createDbSchema envDict={'ENGINE_PGPASS': PGPASS_TEMP}, File "/usr/share/ovirt-engine-dwh/common_utils.py", line 967, in execCmd raise Exception(msg) Exception: Error while trying to create ovirt_engine_history db 2014-02-02 16:30:04::ERROR::ovirt-engine-dwh-setup::691::root:: Exception caught! 2014-02-02 16:30:04::ERROR::ovirt-engine-dwh-setup::692::root:: Traceback (most recent call last): File "/bin/ovirt-engine-dwh-setup", line 637, in main createDbSchema(db_dict) File "/usr/share/ovirt-engine-dwh/decorators.py", line 28, in wrapped_f raise Exception(instance) Exception: Error while trying to create ovirt_engine_history db So it seems a problem with creating db Currently [root@tekkaman ~]# grep -v ^# /var/lib/pgsql/data/pg_hba.conf local all postgres trust local all all md5 host ovirtenginereports engine_reports 0.0.0.0/0 md5 host ovirtenginereports engine_reports ::0/0 md5 host all all 127.0.0.1/32 md5 host all all ::1/128 md5 host ovirt_engine_history engine_history ::0/0 trust where is stored information for user engine_history do I have also to cleanup this user information? See my full log /var/log/ovirt-engine/ovirt-engine-dwh-setup-2014_02_02_16_29_34.log here: https://drive.google.com/file/d/0BwoPbcrMv8mvQnJlRkljTkhjMTg/edit?usp=sharin... Gianluca

On Sun, Feb 2, 2014 at 4:37 PM, Gianluca Cecchi wrote:
where is stored information for user engine_history do I have also to cleanup this user information?
So it seems it was related to postreSQL users needed to be dropped too, before running setup again. And I also noticed that in 3.3.3 rc the problem solved here: http://gerrit.ovirt.org/#/c/23304/2/packaging/ovirt-engine-reports-setup.py is not applied and reports setup fails. I hope someone is following to get into final 3.3.3..... This is my list of things to do in 3.3.3 to get a clean new install that worked today: Some steps could be not necessary depending on previous setup or previous errors and so incomplete deployments: 1) packages clean yum remove ovirt-engine-dwh ovirt-engine-reports 2) files and directory clean rm -rf /etc/ovirt-engine-dwh/ rm -rf /etc/ovirt-engine-reports/ rm -rf /etc/ovirt-engine/ovirt-engine-dwh rm -rf /var/lib/ovirt-engine/deployments/ovirt-engine-reports.war.dodeploy rm -rf /usr/share/ovirt-engine-dwh/ rm -rf /usr/share/ovirt-engine-reports 3) DB clean (substitute ovirt_ruser with your previously chosen read user) engine=# drop user engine_history; DROP ROLE engine=# drop user engine_reports; DROP ROLE engine=# drop user ovirt_ruser; DROP ROLE At the end you shold have something like: postgres=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------+----------- engine | Create DB | {} postgres | Superuser, Create role, Create DB, Replication | {} NOTE: it seems not necessary to purge the lines eventually addedd during previous setup into pg_hba.conf such as: host ovirtenginereports engine_reports 0.0.0.0/0 md5 host ovirtenginereports engine_reports ::0/0 md5 host ovirt_engine_history engine_history ::0/0 trust 3) DWH packages install and setup yum install ovirt-engine-dwh [root@tekkaman ~]# ovirt-engine-dwh-setup Welcome to ovirt-engine-dwh setup utility This utility can configure a read only user for DB access. Would you like to do so? (yes|no): yes Error: user name cannot be empty Provide a username for read-only user : ovirt_ruser Provide a password for read-only user: Warning: Weak Password. Re-type password: Should postgresql be setup with secure connection? (yes|no): yes Creating DB... [ DONE ] Creating read-only user... [ DONE ] Setting DB connectivity... [ DONE ] Starting ovirt-engine... [ DONE ] Starting oVirt-ETL... [ DONE ] Successfully installed ovirt-engine-dwh. 4) Install reports packages, patch and setup yum install ovirt-engine-reports in file /usr/share/ovirt-engine-reports/ovirt-engine-reports-setup.py line 1163 change if preserveReportsJobs: --> if preserveReports: [root@tekkaman ~]# ovirt-engine-reports-setup Welcome to ovirt-engine-reports setup utility In order to proceed the installer must stop the ovirt-engine service Would you like to stop the ovirt-engine service (yes|no): yes Stopping ovirt-engine... [ DONE ] Editing XML files... [ DONE ] Setting DB connectivity... [ DONE ] Please choose a password for the reports admin user(s) (ovirt-admin): Warning: Weak Password. Retype password: Warning: Weak Password. Deploying Server... [ DONE ] Updating Redirect Servlet... [ DONE ] Importing reports... [ DONE ] Customizing Server... [ DONE ] Running post setup steps... [ DONE ] Starting ovirt-engine... [ DONE ] Restarting httpd... [ DONE ] Succesfully installed ovirt-engine-reports. 5) Connect to Reports Portal with ovirt-admin user and verify correct access HIH others, Gianluca

----- Original Message -----
From: "Gianluca Cecchi" <gianluca.cecchi@gmail.com> To: "Yedidyah Bar David" <didi@redhat.com> Cc: "users" <users@ovirt.org>, "Yaniv Dary" <ydary@redhat.com> Sent: Sunday, February 2, 2014 7:58:05 PM Subject: Re: [Users] How to scratch previous versions reports and dwh installation?
On Sun, Feb 2, 2014 at 4:37 PM, Gianluca Cecchi wrote:
where is stored information for user engine_history do I have also to cleanup this user information?
So it seems it was related to postreSQL users needed to be dropped too, before running setup again.
And I also noticed that in 3.3.3 rc the problem solved here: http://gerrit.ovirt.org/#/c/23304/2/packaging/ovirt-engine-reports-setup.py
is not applied and reports setup fails. I hope someone is following to get into final 3.3.3.....
It is backported to 3.3: http://gerrit.ovirt.org/23335 so should enter 3.3.3.
This is my list of things to do in 3.3.3 to get a clean new install that worked today: Some steps could be not necessary depending on previous setup or previous errors and so incomplete deployments:
1) packages clean
yum remove ovirt-engine-dwh ovirt-engine-reports
2) files and directory clean
rm -rf /etc/ovirt-engine-dwh/ rm -rf /etc/ovirt-engine-reports/ rm -rf /etc/ovirt-engine/ovirt-engine-dwh rm -rf /var/lib/ovirt-engine/deployments/ovirt-engine-reports.war.dodeploy rm -rf /usr/share/ovirt-engine-dwh/ rm -rf /usr/share/ovirt-engine-reports
3) DB clean (substitute ovirt_ruser with your previously chosen read user)
engine=# drop user engine_history; DROP ROLE engine=# drop user engine_reports; DROP ROLE engine=# drop user ovirt_ruser; DROP ROLE
At the end you shold have something like:
postgres=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------+----------- engine | Create DB | {} postgres | Superuser, Create role, Create DB, Replication | {}
NOTE: it seems not necessary to purge the lines eventually addedd during previous setup into pg_hba.conf such as:
host ovirtenginereports engine_reports 0.0.0.0/0 md5 host ovirtenginereports engine_reports ::0/0 md5 host ovirt_engine_history engine_history ::0/0 trust
3) DWH packages install and setup
yum install ovirt-engine-dwh
[root@tekkaman ~]# ovirt-engine-dwh-setup Welcome to ovirt-engine-dwh setup utility
This utility can configure a read only user for DB access. Would you like to do so? (yes|no): yes Error: user name cannot be empty Provide a username for read-only user : ovirt_ruser Provide a password for read-only user: Warning: Weak Password. Re-type password: Should postgresql be setup with secure connection? (yes|no): yes Creating DB... [ DONE ] Creating read-only user... [ DONE ] Setting DB connectivity... [ DONE ] Starting ovirt-engine... [ DONE ] Starting oVirt-ETL... [ DONE ] Successfully installed ovirt-engine-dwh.
4) Install reports packages, patch and setup
yum install ovirt-engine-reports
in file /usr/share/ovirt-engine-reports/ovirt-engine-reports-setup.py line 1163 change if preserveReportsJobs: --> if preserveReports:
[root@tekkaman ~]# ovirt-engine-reports-setup Welcome to ovirt-engine-reports setup utility In order to proceed the installer must stop the ovirt-engine service Would you like to stop the ovirt-engine service (yes|no): yes Stopping ovirt-engine... [ DONE ] Editing XML files... [ DONE ] Setting DB connectivity... [ DONE ] Please choose a password for the reports admin user(s) (ovirt-admin): Warning: Weak Password. Retype password: Warning: Weak Password. Deploying Server... [ DONE ] Updating Redirect Servlet... [ DONE ] Importing reports... [ DONE ] Customizing Server... [ DONE ] Running post setup steps... [ DONE ] Starting ovirt-engine... [ DONE ] Restarting httpd... [ DONE ] Succesfully installed ovirt-engine-reports.
5) Connect to Reports Portal with ovirt-admin user and verify correct access
Good job. Thanks for the report! Please, if possible, open relevant bugs as you see fit. E.g. you might want to claim that if a db user engine_reports exists, setup should not fail, or at least fail with a clean message. Do note that in 3.4 the setup of dwh and reports was rewritten from scratch, and is integrated into engine-setup. I did not play with it yet myself yet. -- Didi
participants (2)
-
Gianluca Cecchi
-
Yedidyah Bar David