Bug 1469974 - engine-setup fails due to some : Command '/usr/share/ovirt-engine/dbscripts/schema.sh' failed to execute
engine-setup fails due to some : Command '/usr/share/ovirt-engine/dbscripts/s...
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Eli Mesika
meital avital
Depends On:
  Show dependency treegraph
Reported: 2017-07-12 03:49 EDT by Tareq Alayan
Modified: 2017-07-12 04:50 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-07-12 04:50:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
engine-setup-log (2.26 MB, text/plain)
2017-07-12 03:50 EDT, Tareq Alayan
no flags Details
db-dump (2.41 MB, application/octet-stream)
2017-07-12 04:31 EDT, Tareq Alayan
no flags Details

  None (edit)
Description Tareq Alayan 2017-07-12 03:49:25 EDT
Description of problem:
fail to run engine-setup 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. i have rhevm- 
2. added repos for 3.6.12 (there is no updates for engine)
3. ran engine-setup 

Actual results:
[ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/schema.sh' failed to execute

snipet from log:
2017-07-12 10:05:11 DEBUG otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema plugin.execute:941 execute-output: ['/usr/share/ovirt-engine/dbscripts/schema.sh', '-s', 'localhost', '-p', '5432', '-u', 'engine
', '-d', 'engine', '-l', '/var/log/ovirt-engine/setup/ovirt-engine-setup-20170712100438-qske9v.log', '-c', 'apply'] stderr:
psql:/usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade/0030_set_default_cluster_for_registration.sql:19: ERROR:  null value in column "option_value" violates not-null constraint
CONTEXT:  SQL statement "update vdc_options set option_value = (select vds_group_id from vds_groups LIMIT 1) where option_name = 'AutoRegistrationDefaultVdsGroupID' and version = 'general'"
PL/pgSQL function "__temp_set_default_cluster_for_registration" line 9 at SQL statement
FATAL: Cannot execute sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade/0030_set_default_cluster_for_registration.sql

2017-07-12 10:05:11 DEBUG otopi.context context._executeMethod:156 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/otopi/context.py", line 146, in _executeMethod
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/schema.py", line 291, in _misc
  File "/usr/lib/python2.6/site-packages/otopi/plugin.py", line 946, in execute
RuntimeError: Command '/usr/share/ovirt-engine/dbscripts/schema.sh' failed to execute
2017-07-12 10:05:11 ERROR otopi.context context._executeMethod:165 Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/schema.sh' failed to execute
2017-07-12 10:05:11 DEBUG otopi.transaction transaction.abort:134 aborting 'Yum Transaction'
2017-07-12 10:05:11 INFO otopi.plugins.otopi.packagers.yumpackager yumpackager.info:95 Yum Performing yum transaction rollback
Loaded plugins: product-id, versionlock

Expected results:
run with no errors even that there is no updates for engine 

Additional info:
Comment 1 Tareq Alayan 2017-07-12 03:50 EDT
Created attachment 1296771 [details]
Comment 2 Tareq Alayan 2017-07-12 04:31 EDT
Created attachment 1296779 [details]
Comment 3 Martin Perina 2017-07-12 04:50:26 EDT
The issue is happening if you don't have any cluster in your system, which means you don't have any hosts/VMs in your setup. If that's the case why would you want to upgrade such setup?

I'm closing as WONTFIX as I think it's not worth to fix this case (it is highly unlikely to happen in production)

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