On Fri, Aug 3, 2018 at 3:52 PM, Gianluca Cecchi <gianluca.cecchi@gmail.com> wrote:
On Fri, Aug 3, 2018 at 2:14 PM, Jan Siml <jsiml@plusline.net> wrote:
Hello,

There are probably some more stale image transfers records,
can you please check whether 'image_transfers' table is empty?
If not, you can try removing them by executing:
"DELETE FROM image_transfers WHERE command_id NOT IN (SELECT command_entities.command_id FROM command_entities);"
(you can simply prepend it to '04_02_1210_add_foreign_key_to_image_transfers.sql')

that's how it worked and the update was successful. Thanks!

Regards

Jan

Jan,
are you saying that after your second update failure that failed also the the restore of the databases, you added the delete statement into the 04_02_1210_add_foreign_key_to_image_transfers.sql script?
How? because the yum rollback phase completed in my case so under /usr/share/ovirt-engine/dbscripts/upgrade/ I currently don't have it...
And the first update error leaves the engine down....




the snippet of the failed engine db restore inside log file is:

2018-08-03 14:15:47,017+0200 INFO otopi.ovirt_engine_setup.engine_common.database database.restore:869 
Restoring file '/var/lib/ovirt-engine/backups/engine-20180803141347.gdQfiz.dump' to database localhost:
engine.
2018-08-03 14:15:47,017+0200 DEBUG otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema plugin.execu
tePipeRaw:481 executePipeRaw: [0] popen kw={'stdin': None, 'stdout': -1, 'preexec_fn': <function _enabl
eSignals at 0x35fab18>, 'env': {'PGPASSWORD': '', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'SSH_CLIENT'
: '192.168.1.211 56098 22', 'SELINUX_USE_CURRENT_RANGE': '', 'LOGNAME': 'root', 'USER': 'root', 'HOME':
 '/root', 'PATH': '/opt/rh/rh-postgresql95/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/b
in:/root/bin', 'LD_LIBRARY_PATH': '/opt/rh/rh-postgresql95/root/usr/lib64', 'LANG': 'en_US.UTF-8', 'TER
M': 'xterm-256color', 'SHELL': '/bin/bash', 'LIBRARY_PATH': '/opt/rh/rh-postgresql95/root/usr/lib64', '
SHLVL': '5', 'HISTSIZE': '1000', 'POSTGRESQLENV': 'COMMAND/pg_dump=str:/opt/rh/rh-postgresql95/root/usr
/bin/pg_dump          COMMAND/psql=str:/opt/rh/rh-postgresql95/root/usr/bin/psql          COMMAND/pg_re
store=str:/opt/rh/rh-postgresql95/root/usr/bin/pg_restore          COMMAND/postgresql-setup=str:/opt/rh
/rh-postgresql95/root/usr/bin/postgresql-setup          OVESETUP_PROVISIONING/postgresService=str:rh-po
stgresql95-postgresql          OVESETUP_PROVISIONING/postgresConf=str:/var/opt/rh/rh-postgresql95/lib/p
gsql/data/postgresql.conf          OVESETUP_PROVISIONING/postgresPgHba=str:/var/opt/rh/rh-postgresql95/
lib/pgsql/data/pg_hba.conf          OVESETUP_PROVISIONING/postgresPgVersion=str:/var/opt/rh/rh-postgres
ql95/lib/pgsql/data/PG_VERSION', 'MANPATH': '/opt/rh/rh-postgresql95/root/usr/share/man:', 'X_SCLS': 'r
h-postgresql95 ', 'XDG_RUNTIME_DIR': '/run/user/0', 'PYTHONPATH': '/usr/share/ovirt-engine/setup/bin/..
::', 'PGPASSFILE': '/tmp/tmpM8aXOE', 'SELINUX_ROLE_REQUESTED': '', 'MAIL': '/var/spool/mail/root', 'PKG
_CONFIG_PATH': '/opt/rh/rh-postgresql95/root/usr/lib64/pkgconfig', 'XDG_SESSION_ID': '4386', 'sclenv': 
'rh-postgresql95', 'LS_COLORS': 'rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=3
8;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5
;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex

. . .

'XDG_CONFIG_DIRS': '/etc/opt/rh/rh-postgresql95/xdg:/etc/xdg', 'SSH_TTY': '/dev/pts/1', 'HOSTNAME': 'ovirt.lutwyn.org', 'JAVACONFDIRS': '/etc/opt/rh/rh-postgresql95/java:/etc/java', 'SELINUX_LEVEL_REQUESTED': '', 'HISTCONTROL': 'ignoredups', 'XDG_DATA_DIRS': '/opt/rh/rh-postgresql95/root/usr/share', 'PWD': '/root', 'CPATH': '/opt/rh/rh-postgresql95/root/usr/include', 'OTOPI_LOGFILE': '/var/log/ovirt-engine/setup/ovirt-engine-setup-20180803140934-1thg3k.log', 'SSH_CONNECTION': '192.168.1.211 56098 192.168.1.212 22', 'OTOPI_EXECDIR': '/root'}, 'close_fds': True, 'args': ['/opt/rh/rh-postgresql95/root/usr/bin/pg_restore', '-w', '-h', 'localhost', '-p', '5432', '-U', 'engine', '-d', 'engine', '--jobs=2', '/var/lib/ovirt-engine/backups/engine-20180803141347.gdQfiz.dump'], 'stderr': -1}
2018-08-03 14:15:47,041+0200 DEBUG otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema plugin.executePipeRaw:486 executePipeRaw: [0] pid pid=10100
2018-08-03 14:16:03,535+0200 DEBUG otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema plugin.executePipeRaw:603 executePipe-result: [0] ['/opt/rh/rh-postgresql95/root/usr/bin/pg_restore', '-w', '-h', 'localhost', '-p', '5432', '-U', 'engine', '-d', 'engine', '--jobs=2', '/var/lib/ovirt-engine/backups/engine-20180803141347.gdQfiz.dump'], rc=1
2018-08-03 14:16:03,536+0200 DEBUG otopi.ovirt_engine_setup.engine_common.database database.restore:922 db restore rc 1 stderr ['pg_restore: [archiver (db)] Error while PROCESSING TOC:', 'pg_restore: [archiver (db)] Error from TOC entry 7251; 0 0 COMMENT EXTENSION plpgsql ', 'pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql', "    Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';", '', '', '', 'pg_restore: [archiver (db)] Error from TOC entry 7252; 0 0 COMMENT EXTENSION "uuid-ossp" ', 'pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension uuid-ossp', '    Command was: COMMENT ON EXTENSION "uuid-ossp" IS \'generate universally unique identifiers (UUIDs)\';', '', '', '', 'pg_restore: WARNING:  column "user_role_title" has type "unknown"', 'DETAIL:  Proceeding with relation creation anyway.', 'pg_restore: WARNING:  no privileges could be revoked for "public"', 'pg_restore: WARNING:  no privileges could be revoked for "public"', 'pg_restore: WARNING:  no privileges were granted for "public"', 'pg_restore: WARNING:  no privileges were granted for "public"', 'WARNING: errors ignored on restore: 2']
2018-08-03 14:16:03,536+0200 ERROR otopi.ovirt_engine_setup.engine_common.database database.restore:937 Errors while restoring engine database, please check the log file for details
2018-08-03 14:16:03,536+0200 DEBUG otopi.ovirt_engine_setup.engine_common.database database.restore:942 Errors unfiltered during restore:

pg_restore: [archiver (db)] Error from TOC entry 7252; 0 0 COMMENT EXTENSION "uuid-ossp" 
pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension uuid-ossp

2018-08-03 14:16:03,537+0200 DEBUG otopi.context context.dumpEnvironment:859 ENVIRONMENT DUMP - BEGIN
2018-08-03 14:16:03,537+0200 DEBUG otopi.context context.dumpEnvironment:869 ENV BASE/error=bool:'True'
2018-08-03 14:16:03,537+0200 DEBUG otopi.context context.dumpEnvironment:869 ENV BASE/exceptionInfo=list:'[(<type 'exceptions.RuntimeError'>, RuntimeError('Engine schema refresh failed',), <traceback object at 0x412ad40>)]'
2018-08-03 14:16:03,539+0200 DEBUG otopi.context context.dumpEnvironment:873 ENVIRONMENT DUMP - END
2018-08-03 14:16:03,539+0200 INFO otopi.context context.runSequence:741 Stage: Clean up
2018-08-03 14:16:03,539+0200 DEBUG otopi.context context.runSequence:745 STAGE cleanup
2018-08-03 14:16:03,541+0200 DEBUG otopi.context context._executeMethod:128 Stage cleanup METHOD otopi.plugins.otopi.dialog.answer_file.Plugin._generate_answer_file
2018-08-03 14:16:03,541+0200 DEBUG otopi.context context.dumpEnvironment:859 ENVIRONMENT DUMP - BEGIN
2018-08-03 14:16:03,542+0200 DEBUG otopi.context context.dumpEnvironment:869 ENV DIALOG/answerFileContent=str:'# OTOPI answer file, generated by human dialog
[environment:default]
QUESTION/1/ENGINE_VACUUM_FULL=str:yes
QUESTION/1/OVESETUP_CORE_ENGINE_STOP=str:ok
QUESTION/1/OVESETUP_DWH_PERFORM_BACKUP=str:yes
QUESTION/1/OVESETUP_UPDATE_FIREWALL=str:yes
QUESTION/1/OVESETUP_DIALOG_CONFIRM_SETTINGS=str:ok
QUESTION/1/DWH_VACUUM_FULL=str:yes
QUESTION/1/OVESETUP_RPMDISTRO_PACKAGE_UPGRADE=str:yes
'
2018-08-03 14:16:03,543+0200 DEBUG otopi.context context.dumpEnvironment:873 ENVIRONMENT DUMP - END
2018-08-03 14:16:03,544+0200 DEBUG otopi.context context._executeMethod:128 Stage cleanup METHOD otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._cleanup