RHEV-M upgrade from 3.2.6 to 3.3.4 fails with error "event_subscriber_notification_methods_view" does not exist.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Virtualization 3.2.6

Issue

  • engine-setup reports the following error and failure when upgrading RHEV-M from 3.2.6 to 3.3.4
[ INFO  ] Updating database schema
[ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/upgrade.sh' failed to execute
[ INFO  ] Yum Performing yum transaction rollback
[ INFO  ] Rolling back database schema
[ INFO  ] Clearing database engine
[ INFO  ] Restoring database engine
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20160712115443.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20160712115629-upgrade.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of upgrade failed

Resolution

  • The solution for this requires modification to the Engine database to REVOKE the privileges of tables and views FROM the readonly user in the Engine database. Please contact Red Hat Technical Support and open a case.

Root Cause

  • The upgrade fails because the "event_subscriber_notification_methods_view" does not exist.

  • The problem is due to GRANT access privileges of tables and views in the Engine database assigned TO a readonly user.

                                          List of databases
         Name         |  Owner   | Encoding |  Collation  |    Ctype    |      Access privileges
----------------------+----------+----------+-------------+-------------+-----------------------------
 engine               | engine   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/engine
                                                                        : engine=CTc/engine
                                                                        : history_readonly=c/engine <<<<<======
 ovirt_engine_history | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
                                                                        : postgres=CTc/postgres
                                                                        : history_readonly=c/postgres 
  • According to the Administration Guide the readonly user access needs to be applied only to the ovirt_engine_history database.

Diagnostic Steps

  • From the ovirt-engine-setup-.log file, the generate_drop_all_views_syntax() calls to dump all views that exists.
    So the event_subscriber_notification_methods_view gets dropped.
 DROP VIEW if exists event_subscriber_notification_methods_view CASCADE;
  • Then the materialized_views_sp.sql granting the event_subscriber_notification_methods_view to history_readonly
********* QUERY **********
GRANT SELECT ON TABLE event_subscriber_notification_methods_view TO history_readonly;
*****
  • The upgrade fails when psql runs /tmp/tmp.3L5FfE2NBJ line 50 because event_subscriber_notification_methods_view does not exist.
psql:/tmp/tmp.3L5FfE2NBJ:50: ERROR:  relation "event_subscriber_notification_methods_view" does not exist  <<=====

2016-07-13 21:25:27 DEBUG otopi.context context._executeMethod:137 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/otopi/context.py", line 127, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/db/schema.py", line 336, in _miscUpgrade
    osetupcons.DBEnv.PGPASS_FILE
  File "/usr/lib/python2.6/site-packages/otopi/plugin.py", line 451, in execute
    command=args[0],
RuntimeError: Command '/usr/share/ovirt-engine/dbscripts/upgrade.sh' failed to execute
  • When checking file /tmp/tmp.3L5FfE2NBJ, line 50 is the following:
 50 GRANT SELECT ON TABLE event_subscriber_notification_methods_view TO history_readonly;

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.