Bug 1380518 - Cannot create disk after upgrading to Ovirt 4.0
Summary: Cannot create disk after upgrading to Ovirt 4.0
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.0.4
Hardware: x86_64
OS: Linux
unspecified
high vote
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-29 20:10 UTC by Rui Moreira
Modified: 2016-11-28 13:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)
Last Closed: 2016-10-24 15:38:28 UTC
oVirt Team: Virt
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Rui Moreira 2016-09-29 20:10:25 UTC
Description of problem:

After upgrading to version 4.0 of Ovirt I get a error 500 when trying to create a new disk 

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

rpm -qa |grep ovirt
ovirt-engine-lib-4.0.4.4-1.el7.centos.noarch
ovirt-imageio-daemon-0.4.0-1.el7.noarch
ovirt-engine-websocket-proxy-4.0.4.4-1.el7.centos.noarch
ovirt-engine-extensions-api-impl-4.0.4.4-1.el7.centos.noarch
ovirt-engine-backend-4.0.4.4-1.el7.centos.noarch
ovirt-setup-lib-1.0.2-1.el7.centos.noarch
ovirt-release36-3.6.7-1.noarch
ovirt-engine-setup-plugin-ovirt-engine-common-4.0.4.4-1.el7.centos.noarch
ovirt-host-deploy-1.5.2-1.el7.centos.noarch
ovirt-engine-extension-aaa-jdbc-1.1.0-1.el7.noarch
ovirt-imageio-proxy-0.4.0-0.201608310602.gita9b573b.el7.centos.noarch
ovirt-engine-4.0.4.4-1.el7.centos.noarch
ovirt-vmconsole-proxy-1.0.4-1.el7.centos.noarch
python-ovirt-engine-sdk4-4.0.1-1.el7.centos.x86_64
ovirt-imageio-common-0.4.0-1.el7.noarch
ovirt-engine-setup-base-4.0.4.4-1.el7.centos.noarch
ovirt-engine-setup-plugin-ovirt-engine-4.0.4.4-1.el7.centos.noarch
ovirt-engine-vmconsole-proxy-helper-4.0.4.4-1.el7.centos.noarch
ovirt-iso-uploader-4.0.1-1.el7.centos.noarch
ovirt-release40-4.0.4-1.noarch
ovirt-engine-webadmin-portal-4.0.4.4-1.el7.centos.noarch
ovirt-engine-restapi-4.0.4.4-1.el7.centos.noarch
ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch
ovirt-vmconsole-1.0.4-1.el7.centos.noarch
ovirt-engine-dwh-setup-4.0.2-1.el7.centos.noarch
ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.4.4-1.el7.centos.noarch
ovirt-engine-setup-4.0.4.4-1.el7.centos.noarch
ovirt-image-uploader-4.0.1-1.el7.centos.noarch
ovirt-engine-sdk-python-3.6.9.1-1.el7.centos.noarch
ovirt-engine-dashboard-1.0.3-1.el7.centos.noarch
ovirt-engine-userportal-4.0.4.4-1.el7.centos.noarch
ovirt-engine-dwh-4.0.2-1.el7.centos.noarch
ovirt-engine-wildfly-10.0.0-1.el7.x86_64
ovirt-engine-cli-3.6.8.1-1.el7.centos.noarch
ovirt-imageio-proxy-setup-0.4.0-0.201608310602.gita9b573b.el7.centos.noarch
ovirt-engine-tools-backup-4.0.4.4-1.el7.centos.noarch
ovirt-engine-dbscripts-4.0.4.4-1.el7.centos.noarch
ovirt-engine-jboss-as-7.1.1-1.el7.centos.x86_64
ovirt-engine-setup-plugin-websocket-proxy-4.0.4.4-1.el7.centos.noarch
ovirt-host-deploy-java-1.5.2-1.el7.centos.noarch
ovirt-engine-tools-4.0.4.4-1.el7.centos.noarch
How reproducible:


Steps to Reproduce:

1. select one of the vms 
2. click add disk 
3. ui returns error 500 and logs the message

2016-09-29 21:05:46,605 ERROR [org.jboss.as.ejb3.invocation] (default task-24) WFLYEJB0034: EJB Invocation failed on component Backend for method public abstract org.ovirt.engine.core.common.action.VdcReturnValueBase org.ovirt.engine.core.common.interfaces.BackendLocal.runAction(org.ovirt.engine.core.common.action.VdcActionType,org.ovirt.engine.core.common.action.VdcActionParametersBase): javax.ejb.EJBException: org.springframework.jdbc.BadSqlGrammarException: CallableStatementCallback; bad SQL grammar [{call insertorupdatecommandentity(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; nested exception is org.postgresql.util.PSQLException: ERROR: column "parent_command_id" of relation "command_entities" does not exist
  Where: PL/pgSQL function insertcommandentity(uuid,bigint,uuid,integer,uuid,uuid,uuid,uuid,text,character varying,timestamp with time zone,character varying,boolean,boolean,text,character varying,text) line 4 at SQL statement
SQL statement "SELECT InsertCommandEntity(
                      v_user_id,
                      v_engine_session_seq_id,
                      v_command_id,
                      v_command_type,
                      v_parent_command_id,
                      v_root_command_id,
                      v_job_id,
                      v_step_id,
                      v_command_parameters,
                      v_command_params_class,
                      v_created_at,
                      v_status,
                      v_executed,
                      v_callback_enabled,
                      v_return_value,
                      v_return_value_class,
                      v_data)" 

Actual results:

errir 500 

Expected results:

disk is added 

Additional info:

Comment 1 Rui Moreira 2016-09-29 20:12:18 UTC
According to the error message, there seems to be a missing field in the database.

Comment 2 Michal Skrivanek 2016-09-30 04:45:36 UTC
What did you upgrade from? Please share upgrade logs

Comment 3 Rui Moreira 2016-09-30 08:11:10 UTC
Hello Michal 


This setup was upgraded from 3.6 to 4.0.4 a few days ago via yum.
I am not too sure what log you are referring to, can you be a bit more specific ?


Thank you for all your help 

Rui

Comment 4 Rui Moreira 2016-09-30 16:41:47 UTC
Hello again Michal 


I was able to solve this by creating the field 

ALTER TABLE command_entities ADD COLUMN parent_command_id uuid;

And now it allows me to create the vdisk and vm.
One question though is there any way I Can verify the integrity of the database in the future ? 

Thank you 

Rui

Comment 5 Tomas Jelinek 2016-10-11 07:32:17 UTC
this is pretty strange. This particular DB field was supposed to be added by 03_06_1920_add_cmd_entity_parent_command_id.sql
in 3.6.2. What exact version of 3.6 were you upgrading from?

Also please provide the logs from
/var/log/ovirt-engine/setup/ovirt-engine-setup<something>.log

thank you

Comment 6 Rui Moreira 2016-10-11 14:36:21 UTC
The last 3.6.x version I updated was apparently 3.6.7 

Apr 04 20:29:42 Updated: ovirt-engine-setup-plugin-ovirt-engine-3.6.4.1-1.el7.centos.noarch
Apr 04 20:29:42 Updated: ovirt-engine-setup-plugin-vmconsole-proxy-helper-3.6.4.1-1.el7.centos.noarch
Apr 04 20:29:42 Updated: ovirt-engine-setup-plugin-websocket-proxy-3.6.4.1-1.el7.centos.noarch
Apr 04 20:29:53 Updated: ovirt-engine-websocket-proxy-3.6.4.1-1.el7.centos.noarch
Apr 04 20:29:53 Updated: ovirt-engine-vmconsole-proxy-helper-3.6.4.1-1.el7.centos.noarch
Apr 04 20:29:53 Updated: ovirt-engine-setup-3.6.4.1-1.el7.centos.noarch
Apr 04 20:29:53 Updated: ovirt-engine-extensions-api-impl-3.6.4.1-1.el7.centos.noarch
Jul 31 21:07:55 Updated: ovirt-engine-lib-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:05 Updated: ovirt-engine-setup-base-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:06 Updated: ovirt-engine-setup-plugin-ovirt-engine-common-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:06 Updated: ovirt-engine-setup-plugin-websocket-proxy-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:41 Updated: ovirt-engine-extensions-api-impl-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:41 Updated: ovirt-engine-extension-aaa-jdbc-1.0.7-1.el7.noarch
Jul 31 21:09:41 Updated: ovirt-engine-setup-plugin-vmconsole-proxy-helper-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:42 Updated: ovirt-engine-setup-plugin-ovirt-engine-3.6.7.5-1.el7.centos.noarch
Jul 31 21:09:51 Updated: ovirt-engine-setup-3.6.7.5-1.el7.centos.noarch


I went from there to 4.0.1 

I will attach the log you have required as soon as possible.

Comment 7 Rui Moreira 2016-10-24 15:38:28 UTC
Cannot reproduce, sorry I would like to add more information here but it's no longer posible.


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