Bug 1402425

Summary: Failed to run VM - Exception: org.springframework.jdbc.BadSqlGrammarException: Prepa redStatementCallback; bad SQL grammar
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: BLL.NetworkAssignee: Martin Mucha <mmucha>
Status: CLOSED CURRENTRELEASE QA Contact: Meni Yakove <myakove>
Severity: high Docs Contact:
Priority: high    
Version: 4.1.0CC: bugs, michal.skrivanek
Target Milestone: ovirt-4.1.0-betaFlags: rule-engine: ovirt-4.1+
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-12 09:57:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
engine log none

Description Michael Burman 2016-12-07 14:26:46 UTC
Created attachment 1229066 [details]
engine log

Description of problem:
Failed to run VM - Exception: org.springframework.jdbc.BadSqlGrammarException: Prepa redStatementCallback; bad SQL grammar

Version-Release number of selected component (if applicable):
 4.1.0-0.2.master.20161206231204.git3921e29.el7.centos

How reproducible:
100

Steps to Reproduce:
1. Try to run VM on latest master 4.1.0-0.2.master.20161206231204.git3921e29.el7.centos


Actual results:
Failed 
2016-12-07 16:03:39,659+02 ERROR [org.ovirt.engine.core.bll.RunVmCommand] (org.ovirt.thread.pool-6-thread-9) [bb854e95-dff7-4149-9817-f924ee7af797] Command 'org.ovirt.engine.core.bll.RunVmCommand' failed: Prepared
StatementCallback; bad SQL grammar [select * from  getvnicprofilebyvnicprofileid(?)]; nested exception is org.postgresql.util.PSQLException: The column name migratable was not found in this ResultSet.
2016-12-07 16:03:39,659+02 ERROR [org.ovirt.engine.core.bll.RunVmCommand] (org.ovirt.thread.pool-6-thread-9) [bb854e95-dff7-4149-9817-f924ee7af797] Exception: org.springframework.jdbc.BadSqlGrammarException: Prepa
redStatementCallback; bad SQL grammar [select * from  getvnicprofilebyvnicprofileid(?)]; nested exception is org.postgresql.util.PSQLException: The column name migratable was not found in this ResultSet.
        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99) [spring-jdbc.jar:4.2.4.RELEASE]


Expected results:
Should work

Additional info:
It is caused by the 'migratable' parameter we added for vNIC profile.
Please note this is also affecting the vNIC profile sub tab, it is broken and can't be loaded.
Another thing is that when trying to create new vNIC profile the 'migratable' property is checked by default.

Comment 1 Michael Burman 2016-12-07 14:47:22 UTC
This bug affecting another scenario like
remove network from dc

2016-12-07 16:45:05,936+02 ERROR [org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand] (org.ovirt.thread.pool-6-thread-37) [2072dcd2-a20c-477c-84ee-845e1a20110d] Command 'org.ovirt.engine.core.bll.network.dc
.RemoveNetworkCommand' failed: PreparedStatementCallback; bad SQL grammar [select * from  getvnicprofilesbynetworkid(?)]; nested exception is org.postgresql.util.PSQLException: The column name migratable was not found in this ResultSet.
2016-12-07 16:45:05,936+02 ERROR [org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand] (org.ovirt.thread.pool-6-thread-37) [2072dcd2-a20c-477c-84ee-845e1a20110d] Exception: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select * from  getvnicprofilesbynetworkid(?)]; nested exception is org.postgresql.util.PSQLException: The column name migratable was not found in this ResultSet.
        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99) [spring-jdbc.jar:4.2.4.RELEASE]

Comment 2 Michal Skrivanek 2016-12-07 15:53:31 UTC
note the setup I've seen this happening on was quite dirty with other exceptions, so proabably not all db upgrade scripts were executed correctly. Please check that

Comment 3 Meni Yakove 2016-12-12 09:57:38 UTC
this issue no longer shows up after upgrade to recent master branch.